/* =========================================================
   1. VARIÁVEIS
========================================================= */

:root {
    --bg: #f4f7fb;
    --surface: #ffffff;
    --line: #e6ebf2;

    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --primary-soft: #eef2ff;

    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;

    --text: #111827;
    --text-soft: #64748b;
    --text-muted: #94a3b8;

    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-pill: 999px;

    --shadow-card:
        0 12px 28px rgba(15, 23, 42, .05),
        0 2px 6px rgba(15, 23, 42, .04);

    --shadow-card-hover:
        0 22px 50px rgba(79, 70, 229, .10),
        0 8px 18px rgba(15, 23, 42, .06);

    --transition-fast: .18s;
    --transition-normal: .25s;
}


/* =========================================================
   2. BASE
========================================================= */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: radial-gradient(circle at top, #fafcff, #eef3f9);
    color: var(--text);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}


/* =========================================================
   3. LAYOUT
========================================================= */

.layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: 100vh;
}

main {
    padding: 40px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

section {
    padding: 0 22px 22px;
    overflow: auto;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 22px;
    margin-top: 26px;
}


/* =========================================================
   4. SIDEBAR
========================================================= */

.sidebar {
    z-index: 10;
    display: flex;
    flex-direction: column;
    padding: 24px 18px;
    background: var(--surface);
    border-right: 1px solid var(--line);
    box-shadow: 10px 0 35px rgba(15, 23, 42, .04);
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    margin: 0 auto 36px;
    border-radius: 20px;
    background: linear-gradient(135deg, #5b52f4, var(--primary-dark));
    color: #ffffff;
    font-size: 1.4rem;
    font-weight: 700;
    box-shadow: 0 16px 32px rgba(79, 70, 229, .28);
    transition: transform var(--transition-normal);
}

.logo:hover {
    transform: translateY(-3px) scale(1.04);
}

nav a {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 15px 18px;
    margin-bottom: 6px;
    border-radius: var(--radius-md);
    color: var(--text-soft);
    text-decoration: none;
    font-weight: 500;
    transition:
        background var(--transition-fast),
        color var(--transition-fast),
        transform var(--transition-fast);
}

nav a:hover {
    background: #f3f4ff;
    color: var(--primary-dark);
    transform: translateX(6px);
}

nav a.active {
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-weight: 600;
}

.icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    font-size: 1rem;
    transition: transform .2s;
}

nav a:hover .icon {
    transform: scale(1.15);
}


/* =========================================================
   5. BOTÕES
========================================================= */

.primary,
.ghost,
.step button {
    padding: 11px 16px;
    border: 0;
    border-radius: 12px;
    cursor: pointer;
}

.primary {
    background: var(--primary);
    color: #ffffff;
}

.ghost {
    background: var(--primary-soft);
    color: var(--primary-dark);
}


/* =========================================================
   6. DRAWER
========================================================= */

.overlay {
    position: fixed;
    inset: 0;
    display: none;
    justify-content: flex-end;
    background: rgba(15, 23, 42, .35);
    backdrop-filter: blur(3px);
}

.overlay.open {
    display: flex;
}

.drawer {
    display: flex;
    flex-direction: column;
    width: 420px;
    height: 100%;
    background: var(--surface);
    animation: drawer-slide-in .22s;
}

header,
footer {
    padding: 22px;
}


/* =========================================================
   7. FORMULÁRIOS E DRAG & DROP
========================================================= */

label {
    display: block;
    margin: 16px 0 8px;
    font-weight: 600;
}

input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    transition:
        border-color .2s,
        box-shadow .2s;
}

input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, .12);
}

.step {
    display: grid;
    grid-template-columns: 28px 1fr 40px;
    gap: 10px;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fafcff;
    transition:
        opacity .2s,
        transform .2s,
        border-color .2s,
        background .2s;
}

.step.dragging {
    opacity: .5;
    transform: scale(.98);
}

.step.over {
    border-color: var(--primary);
    background: var(--primary-soft);
}

.drag {
    display: grid;
    place-items: center;
    color: var(--text-muted);
    cursor: grab;
}


/* =========================================================
   8. TOAST
========================================================= */

.toast {
    position: fixed;
    right: 24px;
    bottom: 24px;
    padding: 14px 18px;
    border-radius: 12px;
    background: #111827;
    color: #ffffff;
    opacity: 0;
    transform: translateY(15px);
    transition:
        opacity var(--transition-normal),
        transform var(--transition-normal);
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}


/* =========================================================
   9. CARDS
========================================================= */

.card {
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    gap: 22px;
    min-height: 340px;
    padding: 26px;
    overflow: hidden;
    border: 1px solid rgba(79, 70, 229, .06);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-card);
    cursor: pointer;
    will-change: transform, box-shadow;
    transition:
        transform .22s cubic-bezier(.22, .61, .36, 1),
        box-shadow .22s ease,
        border-color .22s ease,
        background .22s ease;
}

.card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background:
        linear-gradient(
            180deg,
            rgba(255, 255, 255, .30),
            transparent 40%
        );
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal);
}

.card::after {
    content: "";
    position: absolute;
    top: -80px;
    right: -60px;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background:
        radial-gradient(
            rgba(79, 70, 229, .08),
            transparent 70%
        );
    pointer-events: none;
}

.card:hover {
    transform: translateY(-8px) scale(1.012);
    border-color: #d8dfff;
    box-shadow: var(--shadow-card-hover);
}

.card:hover::before {
    opacity: 1;
}


/* Suporte aos cards antigos ainda presentes no HTML */

.cardIcon {
    margin-bottom: 10px;
    font-size: 34px;
}

.menu {
    position: absolute;
    top: 16px;
    right: 16px;
    opacity: 0;
    transition: opacity .2s;
}

.card:hover .menu {
    opacity: 1;
}


/* Barra superior da categoria */

.accent {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: var(--primary);
    transition:
        filter var(--transition-normal),
        opacity var(--transition-normal);
}

.accent.green,
.green {
    background: var(--success);
}

.accent.orange,
.orange {
    background: var(--warning);
}

.card:hover .accent {
    filter: brightness(1.12);
}


/* Cabeçalho */

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.card-left,
.card-title {
    display: flex;
    align-items: center;
    gap: 16px;
}

.card-title {
    gap: 14px;
}

.card-icon-circle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    background: var(--primary-soft);
    font-size: 1.5rem;
}

.card-left h3 {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
}

.card-title h3 {
    margin: 0;
    font-size: 1.1rem;
}


/* Badge e status */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    margin-top: 8px;
    border-radius: var(--radius-pill);
    background: var(--primary-soft);
    color: var(--primary);
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .2px;
    transition:
        transform var(--transition-fast),
        box-shadow var(--transition-fast);
}

.card:hover .badge {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(79, 70, 229, .12);
}

.card-status {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: var(--radius-pill);
    font-size: .75rem;
    font-weight: 700;
}

.status-progress {
    background: #fef3c7;
    color: #b45309;
}


/* Progresso */

.progress {
    width: 100%;
    height: 12px;
    overflow: hidden;
    border-radius: var(--radius-pill);
    background: #eef2f7;
}

.progress-fill {
    position: relative;
    width: 75%;
    height: 100%;
    overflow: hidden;
    border-radius: var(--radius-pill);
    background: linear-gradient(90deg, var(--primary), #6366f1);
    box-shadow: 0 4px 10px rgba(79, 70, 229, .35);
}

.progress-fill::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(
            110deg,
            transparent 10%,
            rgba(255, 255, 255, .45) 45%,
            transparent 80%
        );
    transform: translateX(-120%);
}

.card:hover .progress-fill::after {
    animation: progress-shine .9s linear;
}

.progress-info,
.card-info {
    display: flex;
    justify-content: space-between;
    color: var(--text-soft);
    font-size: .88rem;
}

.card-info {
    font-size: .85rem;
}


/* Prévia das etapas */

.task-preview {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 6px;
}

.task {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid transparent;
    border-radius: 14px;
    background: #fafbfd;
    transition:
        transform var(--transition-fast) ease,
        background var(--transition-fast) ease,
        border-color var(--transition-fast) ease,
        box-shadow var(--transition-fast) ease;
}

.task:hover {
    transform: translateX(4px);
    border-color: #dde4ff;
    background: #f4f6ff;
    box-shadow: 0 6px 18px rgba(15, 23, 42, .05);
}

.task.done {
    color: var(--text-muted);
    text-decoration: line-through;
}


/* Rodapé e menu */

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 18px;
    margin-top: auto;
    border-top: 1px solid #edf1f6;
    color: var(--text-soft);
    opacity: .78;
    transition: opacity var(--transition-fast);
}

.card:hover .card-footer {
    opacity: 1;
}

.card-menu {
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    cursor: pointer;
    transition: background .2s;
}

.card-menu:hover {
    background: var(--primary-soft);
}


/* =========================================================
   10. ANIMAÇÕES
========================================================= */

@keyframes drawer-slide-in {
    from {
        transform: translateX(100%);
    }

    to {
        transform: translateX(0);
    }
}

@keyframes progress-shine {
    to {
        transform: translateX(120%);
    }
}

/* =========================================================
   11. DRAWER 2.0 — EDITOR DE ROTINAS
========================================================= */

body.drawer-open {
    overflow: hidden;
}

.overlay {
    z-index: 1000;
    display: flex;
    opacity: 0;
    visibility: hidden;
    transition:
        opacity var(--transition-normal),
        visibility var(--transition-normal);
}

.overlay.open {
    opacity: 1;
    visibility: visible;
}

.drawer {
    width: min(520px, 100vw);
    border-left: 1px solid var(--line);
    box-shadow: -24px 0 70px rgba(15, 23, 42, .16);
    transform: translateX(100%);
    animation: none;
    transition: transform .32s cubic-bezier(.22, .61, .36, 1);
}

.overlay.open .drawer {
    transform: translateX(0);
}

.drawer-header {
    position: sticky;
    top: 0;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 24px 26px 20px;
    background: rgba(255, 255, 255, .94);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(14px);
}

.drawer-heading {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.drawer-icon {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 1.35rem;
}

.drawer-title {
    min-width: 0;
}

.drawer-title h2 {
    margin: 0;
    font-size: 1.15rem;
    line-height: 1.25;
}

.drawer-title p {
    margin: 5px 0 0;
    color: var(--text-soft);
    font-size: .82rem;
}

.icon-button {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 0;
    border-radius: 11px;
    background: transparent;
    color: var(--text-soft);
    cursor: pointer;
    transition:
        background var(--transition-fast),
        color var(--transition-fast),
        transform var(--transition-fast);
}

.icon-button:hover {
    background: var(--primary-soft);
    color: var(--primary-dark);
    transform: scale(1.04);
}

.drawer-body {
    flex: 1;
    padding: 26px;
    overflow-y: auto;
}

.editor-section + .editor-section {
    margin-top: 30px;
}

.editor-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.editor-label label {
    margin: 0;
    font-size: .86rem;
}

.editor-hint {
    color: var(--text-muted);
    font-size: .74rem;
}

.routine-name-input {
    padding: 14px 15px;
    border-radius: 13px;
    font-size: 1.05rem;
    font-weight: 650;
}

.routine-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 12px;
}

.meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 10px;
    border: 1px solid #e2e7f3;
    border-radius: var(--radius-pill);
    background: #f8faff;
    color: var(--text-soft);
    font-size: .76rem;
}

.steps-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.step {
    grid-template-columns: 26px minmax(0, 1fr) 108px 34px;
    align-items: center;
    margin: 0;
    padding: 9px 9px 9px 8px;
    border-color: #e9edf4;
    border-radius: 14px;
    background: #fbfcfe;
    box-shadow: 0 1px 0 rgba(15, 23, 42, .02);
}

.step:hover {
    border-color: #dce3f4;
    background: #ffffff;
    box-shadow: 0 8px 22px rgba(15, 23, 42, .05);
}

.step input {
    padding: 10px 11px;
    border-color: transparent;
    background: transparent;
    font-size: .9rem;
}

.step input:hover {
    background: #f7f9fc;
}

.step input:focus {
    background: #ffffff;
}

.drag {
    width: 26px;
    height: 34px;
    border-radius: 8px;
    user-select: none;
    transition:
        color var(--transition-fast),
        background var(--transition-fast),
        transform var(--transition-fast);
}

.drag:hover {
    background: var(--primary-soft);
    color: var(--primary);
    transform: scale(1.05);
}

.step-remove {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    padding: 0 !important;
    border-radius: 9px !important;
    background: transparent;
    color: var(--text-muted);
    opacity: .2;
    transition:
        opacity var(--transition-fast),
        background var(--transition-fast),
        color var(--transition-fast);
}

.step:hover .step-remove,
.step:focus-within .step-remove {
    opacity: 1;
}

.step-remove:hover {
    background: #fff1f2;
    color: var(--danger);
}

.step.dragging {
    opacity: .65;
    transform: rotate(.5deg) scale(1.015);
    border-color: #cfd8ff;
    background: #ffffff;
    box-shadow: 0 18px 36px rgba(79, 70, 229, .14);
}

.step.drop-before {
    box-shadow:
        0 -3px 0 var(--primary),
        0 8px 22px rgba(15, 23, 42, .05);
}

.step.drop-after {
    box-shadow:
        0 3px 0 var(--primary),
        0 8px 22px rgba(15, 23, 42, .05);
}

.add-step-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: 100%;
    margin-top: 12px;
    border: 1px dashed #cfd7ea;
    background: #fafbff;
    color: var(--primary-dark);
    transition:
        background var(--transition-fast),
        border-color var(--transition-fast),
        transform var(--transition-fast);
}

.add-step-button:hover {
    border-color: #aebcff;
    background: var(--primary-soft);
    transform: translateY(-1px);
}

.drawer-footer {
    position: sticky;
    bottom: 0;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 18px 26px;
    background: rgba(255, 255, 255, .96);
    border-top: 1px solid var(--line);
    backdrop-filter: blur(14px);
}

.drawer-shortcut {
    color: var(--text-muted);
    font-size: .75rem;
}

.drawer-actions {
    display: flex;
    gap: 10px;
}

.drawer-actions .primary,
.drawer-actions .ghost {
    min-width: 92px;
    transition:
        transform var(--transition-fast),
        box-shadow var(--transition-fast),
        background var(--transition-fast);
}

.drawer-actions .primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 9px 20px rgba(79, 70, 229, .22);
}

.drawer-actions .primary.is-saving {
    pointer-events: none;
    opacity: .72;
}

.routine-name-input[aria-invalid="true"] {
    border-color: var(--danger);
    box-shadow: 0 0 0 4px rgba(239, 68, 68, .12);
}

@media (max-width: 720px) {
    .drawer {
        width: 100vw;
    }

    .drawer-header,
    .drawer-body,
    .drawer-footer {
        padding-left: 18px;
        padding-right: 18px;
    }

    .drawer-shortcut {
        display: none;
    }
}

/* =========================================================
   13. SPRINT 12 — RESPONSIVIDADE E NAVEGAÇÃO MOBILE
========================================================= */

.page-header {
    gap: 20px;
}

.page-heading {
    display: flex;
    align-items: center;
    gap: 14px;
}

.page-heading h1,
.page-heading p {
    margin-top: 0;
}

.page-heading h1 {
    margin-bottom: 6px;
}

.page-heading p {
    margin-bottom: 0;
    color: var(--text-soft);
}

.mobile-menu-button,
.sidebar-close,
.sidebar-backdrop {
    display: none;
}

.new-routine-button {
    flex: 0 0 auto;
}

.card-status::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    opacity: .75;
}

.status-idle {
    background: #eff6ff;
    color: #2563eb;
}

.status-complete {
    background: #ecfdf5;
    color: #15803d;
}

.card .task.pending {
    border-color: #e7eafe;
    background: #f8f9ff;
}

@media (max-width: 900px) {
    body.sidebar-open {
        overflow: hidden;
    }

    .layout {
        display: block;
        min-height: 100vh;
    }

    .sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        z-index: 1200;
        width: min(290px, 86vw);
        min-height: 100vh;
        transform: translateX(-105%);
        transition: transform .28s cubic-bezier(.22, .61, .36, 1);
        box-shadow: 24px 0 60px rgba(15, 23, 42, .18);
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
    }

    .sidebar-close {
        position: absolute;
        top: 14px;
        right: 14px;
        display: grid;
        place-items: center;
        width: 36px;
        height: 36px;
        padding: 0;
        border: 0;
        border-radius: 11px;
        background: #f5f6fb;
        color: var(--text-soft);
        cursor: pointer;
    }

    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        z-index: 1100;
        display: block;
        padding: 0;
        border: 0;
        background: rgba(15, 23, 42, .38);
        opacity: 0;
        visibility: hidden;
        backdrop-filter: blur(2px);
        transition: opacity .25s, visibility .25s;
    }

    body.sidebar-open .sidebar-backdrop {
        opacity: 1;
        visibility: visible;
    }

    .mobile-menu-button {
        display: grid;
        place-items: center;
        flex: 0 0 auto;
        width: 42px;
        height: 42px;
        padding: 0;
        border: 1px solid var(--line);
        border-radius: 13px;
        background: var(--surface);
        color: var(--primary-dark);
        font-size: 1.2rem;
        cursor: pointer;
        box-shadow: 0 6px 18px rgba(15, 23, 42, .06);
    }

    main {
        width: 100%;
        padding: 26px 22px 38px;
    }

    .grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 620px) {
    main {
        padding: 20px 14px 30px;
    }

    .page-header {
        align-items: stretch;
        flex-direction: column;
        margin-bottom: 18px;
        padding: 0;
    }

    .page-heading {
        align-items: flex-start;
    }

    .page-heading h1 {
        font-size: 1.65rem;
    }

    .new-routine-button {
        width: 100%;
        min-height: 46px;
    }

    section {
        padding-left: 0;
        padding-right: 0;
    }

    .grid {
        gap: 16px;
        margin-top: 18px;
    }

    .card {
        min-height: 0;
        padding: 22px 18px;
        gap: 17px;
        border-radius: 20px;
    }

    .card-header {
        gap: 12px;
    }

    .card-left {
        min-width: 0;
        gap: 12px;
    }

    .card-left h3 {
        overflow: hidden;
        font-size: 1.16rem;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .card-icon-circle {
        width: 46px;
        height: 46px;
        border-radius: 14px;
        font-size: 1.3rem;
    }

    .card-status {
        padding: 6px 9px;
        font-size: .68rem;
    }

    .task-preview {
        gap: 7px;
    }

    .task {
        padding: 10px 11px;
        font-size: .84rem;
    }

    .card-footer {
        gap: 10px;
        font-size: .75rem;
    }

    .card-updated {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

/* =========================================================
   14. SPRINT 12.1 — CARROSSEL E CONTADOR REFINADO
========================================================= */

.routine-carousel {
    padding: 0;
    margin-top: 30px;
    overflow: visible;
}

.carousel-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}

.carousel-header h2 {
    margin: 0;
    font-size: 1.08rem;
}

.carousel-header p {
    margin: 5px 0 0;
    color: var(--text-soft);
    font-size: .84rem;
}

.carousel-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.carousel-position {
    min-width: 76px;
    margin-right: 4px;
    color: var(--text-soft);
    font-size: .78rem;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.carousel-button {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 255, 255, .9);
    color: var(--text);
    font-size: 1.05rem;
    cursor: pointer;
    box-shadow: 0 5px 16px rgba(15, 23, 42, .05);
    transition:
        transform var(--transition-fast),
        border-color var(--transition-fast),
        background var(--transition-fast),
        color var(--transition-fast),
        opacity var(--transition-fast);
}

.carousel-button:hover:not(:disabled) {
    transform: translateY(-2px);
    border-color: #cfd8ff;
    background: var(--primary-soft);
    color: var(--primary-dark);
}

.carousel-button:disabled {
    opacity: .35;
    cursor: default;
    box-shadow: none;
}

.carousel-viewport {
    width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    overscroll-behavior-inline: contain;
}

.carousel-viewport::-webkit-scrollbar {
    display: none;
}

.carousel-viewport .grid {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: calc((100% - 44px) / 3);
    grid-template-columns: none;
    gap: 22px;
    width: max-content;
    min-width: 100%;
    padding: 8px 3px 28px;
    margin: 0;
    overflow: visible;
}

.carousel-viewport .card {
    width: 100%;
    min-width: 0;
    scroll-snap-align: start;
}

.task-more {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 38px;
    padding: 8px 11px;
    border: 1px dashed #cfd8e8;
    border-radius: 12px;
    background: linear-gradient(180deg, #fbfcff, #f7f9fe);
    color: var(--text-soft);
    font-size: .8rem;
    font-weight: 550;
    transition:
        transform var(--transition-fast),
        border-color var(--transition-fast),
        background var(--transition-fast),
        color var(--transition-fast);
}

.task-more::before {
    content: "+";
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    border-radius: 8px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: .9rem;
    font-weight: 800;
}

.card:hover .task-more {
    transform: translateX(3px);
    border-color: #bfcaff;
    background: var(--primary-soft);
    color: var(--primary-dark);
}

.card.is-new-card {
    animation: card-arrival .48s cubic-bezier(.22, .61, .36, 1);
}

@keyframes card-arrival {
    from {
        opacity: 0;
        transform: translateX(28px) scale(.97);
    }

    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@media (max-width: 1300px) and (min-width: 901px) {
    .carousel-viewport .grid {
        grid-auto-columns: calc((100% - 22px) / 2);
    }
}

@media (max-width: 900px) {
    .routine-carousel {
        margin-top: 24px;
    }

    .carousel-header {
        align-items: center;
    }

    .carousel-header p,
    .carousel-controls {
        display: none;
    }

    .carousel-viewport {
        overflow: visible;
        scroll-snap-type: none;
    }

    .carousel-viewport .grid {
        display: grid;
        grid-auto-flow: row;
        grid-auto-columns: auto;
        grid-template-columns: minmax(0, 1fr);
        width: 100%;
        min-width: 0;
        padding: 0 0 20px;
    }
}

/* =========================================================
   15. SPRINT 12.2 — CONTENÇÃO DO CARROSSEL
========================================================= */

html,
body {
    max-width: 100%;
    overflow-x: clip;
}

.layout,
main,
.routine-carousel,
.carousel-viewport {
    min-width: 0;
}

.routine-carousel {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.carousel-viewport {
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    contain: inline-size;
}

.carousel-viewport .grid {
    box-sizing: border-box;
}

@media (max-width: 900px) {
    .routine-carousel,
    .carousel-viewport {
        overflow: visible;
    }

    html,
    body {
        overflow-x: hidden;
    }
}

/* =========================================================
   16. SPRINT 12.2.1 — LARGURA ESTÁVEL DOS CARDS
========================================================= */

/*
 * O trilho passa a usar Flexbox. Assim, a largura de cada card
 * é calculada pela área visível do carrossel e não pelo tamanho
 * total do conteúdo, evitando que os cards cresçam quando novas
 * rotinas são adicionadas.
 */
.carousel-viewport .grid {
    display: flex;
    flex-flow: row nowrap;
    gap: 22px;
    width: 100%;
    min-width: 100%;
    padding: 8px 3px 28px;
    margin: 0;
}

.carousel-viewport .card {
    flex: 0 0 calc((100% - 44px) / 3);
    width: calc((100% - 44px) / 3);
    min-width: 0;
}

@media (max-width: 1300px) and (min-width: 901px) {
    .carousel-viewport .card {
        flex-basis: calc((100% - 22px) / 2);
        width: calc((100% - 22px) / 2);
    }
}

@media (max-width: 900px) {
    .carousel-viewport .grid {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 22px;
        width: 100%;
        min-width: 0;
        padding: 0 0 20px;
    }

    .carousel-viewport .card {
        width: 100%;
        min-width: 0;
    }
}

/* =========================================================
   16. SPRINT 13 — VIEWS E LISTA DO DIA
========================================================= */

.app-view {
    padding: 0;
    overflow: visible;
}

.app-view[hidden] {
    display: none !important;
}

.app-view.active {
    animation: view-enter .28s ease;
}

.eyebrow {
    margin: 0 0 5px;
    color: var(--primary);
    font-size: .74rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.today-header {
    align-items: flex-start;
}

.reset-day-button {
    color: var(--text-soft);
}

.today-summary {
    display: grid;
    grid-template-columns: 150px 150px minmax(260px, 1fr);
    gap: 16px;
    padding: 0;
    margin: 26px 0 22px;
    overflow: visible;
}

.summary-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 118px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: rgba(255, 255, 255, .86);
    box-shadow: 0 10px 28px rgba(15, 23, 42, .045);
}

.summary-card span {
    color: var(--text-soft);
    font-size: .78rem;
    font-weight: 600;
}

.summary-card strong {
    margin-top: 4px;
    font-size: 1.85rem;
}

.summary-card small {
    margin-top: 2px;
    color: var(--text-muted);
}

.summary-progress-card {
    gap: 18px;
}

.summary-progress-card > div:first-child {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.today-progress {
    height: 10px;
    overflow: hidden;
    border-radius: var(--radius-pill);
    background: #edf1f6;
}

.today-progress div {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--primary), #7768ff);
    transition: width .38s cubic-bezier(.22, .61, .36, 1);
}

.today-panel {
    padding: 26px;
    overflow: visible;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-card);
}

.today-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding-bottom: 22px;
    border-bottom: 1px solid #edf1f6;
}

.today-panel-header h2 {
    margin: 0;
}

.today-panel-header p {
    margin: 6px 0 0;
    color: var(--text-soft);
    font-size: .88rem;
}

.today-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.today-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 20px;
}

.today-item {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    min-height: 58px;
    padding: 10px 12px;
    border: 1px solid #e8edf5;
    border-radius: 15px;
    background: #fbfcfe;
    transition:
        transform var(--transition-fast),
        border-color var(--transition-fast),
        background var(--transition-fast),
        box-shadow var(--transition-fast);
}

.today-item:hover {
    transform: translateX(3px);
    border-color: #d6ddf2;
    background: #ffffff;
    box-shadow: 0 8px 20px rgba(15, 23, 42, .045);
}

.today-check {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 2px solid #cbd4e4;
    border-radius: 9px;
    background: #ffffff;
    color: transparent;
    cursor: pointer;
    transition:
        border-color var(--transition-fast),
        background var(--transition-fast),
        color var(--transition-fast),
        transform var(--transition-fast);
}

.today-check:hover {
    border-color: var(--primary);
    transform: scale(1.06);
}

.today-item.completed .today-check {
    border-color: var(--success);
    background: var(--success);
    color: #ffffff;
}

.today-item-content {
    min-width: 0;
}

.today-item-title {
    display: block;
    overflow: hidden;
    font-size: .92rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.today-item.completed .today-item-title {
    color: var(--text-muted);
    text-decoration: line-through;
}

.today-item-meta {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-top: 5px;
    color: var(--text-muted);
    font-size: .74rem;
}

.today-source {
    padding: 3px 8px;
    border-radius: var(--radius-pill);
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-weight: 600;
}

.today-remove {
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    opacity: .25;
    transition:
        opacity var(--transition-fast),
        color var(--transition-fast),
        background var(--transition-fast);
}

.today-item:hover .today-remove {
    opacity: 1;
}

.today-remove:hover {
    background: #fff1f2;
    color: var(--danger);
}

.today-empty {
    display: grid;
    justify-items: center;
    padding: 54px 20px 38px;
    text-align: center;
}

.today-empty[hidden] {
    display: none;
}

.empty-icon {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    border-radius: 19px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 1.55rem;
    font-weight: 700;
}

.today-empty h3 {
    margin: 16px 0 6px;
}

.today-empty p {
    max-width: 430px;
    margin: 0;
    color: var(--text-soft);
    line-height: 1.55;
}


/* =========================================================
   17. MODAIS DA LISTA DO DIA
========================================================= */

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(15, 23, 42, .38);
    opacity: 0;
    visibility: hidden;
    backdrop-filter: blur(5px);
    transition:
        opacity var(--transition-normal),
        visibility var(--transition-normal);
}

.modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.app-modal {
    width: min(560px, 100%);
    max-height: min(720px, calc(100vh - 40px));
    padding: 24px;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, .7);
    border-radius: 24px;
    background: var(--surface);
    box-shadow: 0 28px 80px rgba(15, 23, 42, .20);
    transform: translateY(12px) scale(.985);
    transition: transform var(--transition-normal);
}

.modal-overlay.open .app-modal {
    transform: translateY(0) scale(1);
}

.compact-modal {
    width: min(450px, 100%);
}

.app-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
}

.app-modal-header h2 {
    margin: 0;
}

.app-modal-header p,
.compact-modal > p {
    margin: 7px 0 0;
    color: var(--text-soft);
    font-size: .86rem;
    line-height: 1.5;
}

.app-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 22px;
}

.routine-picker-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.routine-picker-option {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    align-items: center;
    gap: 13px;
    width: 100%;
    padding: 13px;
    border: 1px solid #e7ebf3;
    border-radius: 15px;
    background: #fbfcfe;
    text-align: left;
    cursor: pointer;
    transition:
        transform var(--transition-fast),
        border-color var(--transition-fast),
        background var(--transition-fast),
        box-shadow var(--transition-fast);
}

.routine-picker-option:hover {
    transform: translateY(-2px);
    border-color: #cfd8ff;
    background: var(--primary-soft);
    box-shadow: 0 10px 22px rgba(79, 70, 229, .08);
}

.picker-icon {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 13px;
    background: #ffffff;
    font-size: 1.2rem;
}

.picker-title {
    display: block;
    font-weight: 700;
}

.picker-meta {
    display: block;
    margin-top: 4px;
    color: var(--text-soft);
    font-size: .76rem;
}

.picker-add {
    color: var(--primary);
    font-size: 1.2rem;
    font-weight: 700;
}

.confirmation-icon {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    margin-bottom: 16px;
    border-radius: 17px;
    background: #fff7ed;
    color: #c2410c;
    font-size: 1.4rem;
    font-weight: 700;
}

.compact-modal > h2 {
    margin: 0;
}

.danger-button {
    padding: 11px 16px;
    border: 0;
    border-radius: 12px;
    background: var(--danger);
    color: #ffffff;
    cursor: pointer;
}


/* =========================================================
   18. RESPONSIVIDADE DA SPRINT 13
========================================================= */

@media (max-width: 900px) {
    .today-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .summary-progress-card {
        grid-column: 1 / -1;
    }

    .today-panel-header {
        flex-direction: column;
    }

    .today-actions {
        width: 100%;
        justify-content: stretch;
    }

    .today-actions button {
        flex: 1;
    }
}

@media (max-width: 560px) {
    .today-summary {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .summary-card {
        min-height: 102px;
        padding: 16px;
    }

    .summary-progress-card {
        min-height: 96px;
    }

    .today-panel {
        padding: 18px;
    }

    .today-actions {
        flex-direction: column;
    }

    .today-item {
        grid-template-columns: 34px minmax(0, 1fr) 30px;
    }

    .routine-picker-option {
        grid-template-columns: 40px minmax(0, 1fr) auto;
    }
}

@keyframes view-enter {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================================================
   19. SPRINT 14 — PERSONALIZAÇÃO E HORIZONTES DE TAREFAS
========================================================= */

.daily-quote {
    position: relative;
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 18px;
    padding: 22px 24px;
    margin: 24px 0 18px;
    overflow: hidden;
    border: 1px solid rgba(79, 70, 229, .11);
    border-radius: 22px;
    background:
        linear-gradient(135deg, rgba(238, 242, 255, .94), rgba(255, 255, 255, .9));
    box-shadow: 0 12px 30px rgba(79, 70, 229, .055);
}

.daily-quote::after {
    content: "";
    position: absolute;
    top: -80px;
    right: -50px;
    width: 190px;
    height: 190px;
    border-radius: 50%;
    background: radial-gradient(rgba(79, 70, 229, .12), transparent 68%);
    pointer-events: none;
}

.quote-mark {
    display: grid;
    place-items: center;
    align-self: start;
    width: 52px;
    height: 52px;
    border-radius: 17px;
    background: #ffffff;
    color: var(--primary);
    font-family: Georgia, serif;
    font-size: 2.3rem;
    line-height: 1;
    box-shadow: 0 8px 20px rgba(79, 70, 229, .09);
}

.quote-label {
    color: var(--primary);
    font-size: .7rem;
    font-weight: 750;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.daily-quote blockquote {
    max-width: 820px;
    margin: 7px 0 8px;
    color: #273149;
    font-family: Georgia, serif;
    font-size: 1.04rem;
    line-height: 1.58;
}

.daily-quote cite {
    color: var(--text-soft);
    font-size: .8rem;
    font-style: normal;
    font-weight: 600;
}

.task-horizon {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 0;
    overflow: visible;
}

.task-section {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-card);
}

.section-kicker {
    display: block;
    margin-bottom: 5px;
    color: var(--primary);
    font-size: .68rem;
    font-weight: 750;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.future-section {
    overflow: hidden;
}

.future-section-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto 34px;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 19px 22px;
    border: 0;
    background: #ffffff;
    color: var(--text);
    text-align: left;
    cursor: pointer;
}

.future-section-header strong {
    font-size: 1rem;
}

.section-count {
    display: grid;
    place-items: center;
    min-width: 30px;
    height: 30px;
    padding: 0 8px;
    border-radius: var(--radius-pill);
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-size: .76rem;
    font-weight: 750;
}

.section-chevron {
    color: var(--text-soft);
    font-size: 1.2rem;
    text-align: center;
    transition: transform var(--transition-fast);
}

.future-section-header[aria-expanded="false"] .section-chevron {
    transform: rotate(-90deg);
}

.future-section-content {
    padding: 0 22px 20px;
    border-top: 1px solid #edf1f6;
}

.future-section-content.collapsed {
    display: none;
}

.future-empty {
    padding: 26px 10px 8px;
    color: var(--text-muted);
    font-size: .84rem;
    text-align: center;
}

.future-empty[hidden] {
    display: none;
}

.today-item-completed-at {
    color: #64748b;
    font-size: .72rem;
}

.today-item.completed .today-item-completed-at {
    color: #168a4a;
    font-weight: 600;
}

.today-due {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.today-due.overdue {
    color: var(--danger);
    font-weight: 650;
}

.today-due.today {
    color: #b45309;
    font-weight: 650;
}


/* =========================================================
   20. ONBOARDING
========================================================= */

.onboarding-overlay {
    z-index: 1500;
    background:
        radial-gradient(circle at top left, rgba(79, 70, 229, .34), transparent 38%),
        rgba(15, 23, 42, .64);
}

.welcome-modal {
    width: min(460px, 100%);
    padding: 34px;
    text-align: center;
}

.welcome-brand {
    display: grid;
    place-items: center;
    width: 68px;
    height: 68px;
    margin: 0 auto 20px;
    border-radius: 22px;
    background: linear-gradient(135deg, #5b52f4, #4338ca);
    color: #ffffff;
    font-size: 1.5rem;
    font-weight: 750;
    box-shadow: 0 18px 38px rgba(79, 70, 229, .28);
}

.welcome-modal h2 {
    margin: 8px 0 10px;
    font-size: 1.55rem;
}

.welcome-modal p {
    margin: 0 0 22px;
    color: var(--text-soft);
    font-size: .88rem;
    line-height: 1.55;
}

.welcome-modal label {
    text-align: left;
}

.welcome-modal input {
    padding: 14px;
    font-size: 1rem;
}

.welcome-submit {
    width: 100%;
    margin-top: 18px;
}


/* =========================================================
   21. SELETOR DE PERÍODO
========================================================= */

.period-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 9px;
    padding: 0;
    margin: 20px 0;
    border: 0;
}

.period-selector legend {
    grid-column: 1 / -1;
    margin-bottom: 1px;
    font-size: .86rem;
    font-weight: 600;
}

.period-option {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 82px;
    padding: 12px;
    margin: 0;
    border: 1px solid #e1e6ef;
    border-radius: 14px;
    background: #fbfcfe;
    cursor: pointer;
    transition:
        border-color var(--transition-fast),
        background var(--transition-fast),
        transform var(--transition-fast);
}

.period-option:hover {
    transform: translateY(-2px);
    border-color: #cfd8ff;
    background: var(--primary-soft);
}

.period-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.period-option:has(input:checked) {
    border-color: #aebcff;
    background: var(--primary-soft);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, .08);
}

.period-option span {
    color: var(--text);
    font-size: .82rem;
    font-weight: 700;
}

.period-option small {
    margin-top: 6px;
    color: var(--text-soft);
    font-size: .7rem;
    line-height: 1.35;
}

.optional-label {
    color: var(--text-muted);
    font-size: .74rem;
    font-weight: 500;
}


/* =========================================================
   22. PROGRESSO CONCLUÍDO E MOVIMENTO REDUZIDO
========================================================= */

.summary-progress-card.complete {
    border-color: rgba(34, 197, 94, .22);
    background: linear-gradient(135deg, #f0fdf4, #ffffff);
}

.summary-progress-card.complete .today-progress div {
    background: linear-gradient(90deg, #22c55e, #16a34a);
    box-shadow: 0 4px 12px rgba(34, 197, 94, .26);
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}

@media (max-width: 640px) {
    .daily-quote {
        grid-template-columns: 42px minmax(0, 1fr);
        gap: 13px;
        padding: 18px;
    }

    .quote-mark {
        width: 42px;
        height: 42px;
        border-radius: 14px;
        font-size: 1.9rem;
    }

    .daily-quote blockquote {
        font-size: .94rem;
    }

    .period-selector {
        grid-template-columns: 1fr;
    }

    .period-option {
        min-height: auto;
    }
}

/* =========================================================
   23. SPRINT 14.1 — POLIMENTO, ROTINAS ATIVAS E DRAG & DROP
========================================================= */

.daily-quote {
    animation: quote-enter .55s cubic-bezier(.22, .61, .36, 1);
}

.daily-quote::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(
            110deg,
            transparent 20%,
            rgba(255, 255, 255, .52) 48%,
            transparent 76%
        );
    transform: translateX(-120%);
    pointer-events: none;
}

.daily-quote:hover::before {
    animation: quote-shine 1.25s ease;
}

.daily-quote blockquote {
    position: relative;
}

.daily-quote cite {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.daily-quote cite::before {
    content: "";
    width: 18px;
    height: 1px;
    background: currentColor;
    opacity: .45;
}

.reset-day-button {
    border: 1px solid #e5e9f2;
}

.reset-day-button:hover {
    background: #fff7ed;
    color: #c2410c;
}


/* Rotina ativa/desativada */

.routine-enabled-setting {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px 15px;
    margin-top: 18px;
    border: 1px solid #e5e9f2;
    border-radius: 14px;
    background: #fbfcfe;
    cursor: pointer;
}

.routine-enabled-setting > span:first-child {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.routine-enabled-setting strong {
    font-size: .86rem;
}

.routine-enabled-setting small {
    color: var(--text-soft);
    font-size: .74rem;
    line-height: 1.4;
}

.switch-control {
    position: relative;
    flex: 0 0 auto;
    width: 46px;
    height: 26px;
}

.switch-control input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.switch-track {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: #cbd5e1;
    transition:
        background var(--transition-fast),
        box-shadow var(--transition-fast);
}

.switch-track::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .18);
    transition: transform var(--transition-fast);
}

.switch-control input:checked + .switch-track {
    background: var(--success);
    box-shadow: 0 0 0 4px rgba(34, 197, 94, .10);
}

.switch-control input:checked + .switch-track::after {
    transform: translateX(20px);
}

.routine-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 9px;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-pill);
    background: #ffffff;
    color: var(--text-soft);
    font-size: .72rem;
    font-weight: 700;
    cursor: pointer;
    transition:
        transform var(--transition-fast),
        border-color var(--transition-fast),
        background var(--transition-fast),
        color var(--transition-fast);
}

.routine-toggle:hover {
    transform: translateY(-1px);
    border-color: #cbd5e1;
}

.routine-toggle-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #94a3b8;
}

.routine-toggle.enabled {
    border-color: rgba(34, 197, 94, .25);
    background: #f0fdf4;
    color: #15803d;
}

.routine-toggle.enabled .routine-toggle-dot {
    background: var(--success);
    box-shadow: 0 0 0 4px rgba(34, 197, 94, .10);
}


/* Drag & drop das tarefas */

.today-list[data-task-list] {
    min-height: 10px;
    border-radius: 16px;
    transition:
        background var(--transition-fast),
        box-shadow var(--transition-fast);
}

.today-list[data-task-list].is-drop-target {
    background: rgba(238, 242, 255, .68);
    box-shadow: inset 0 0 0 2px rgba(79, 70, 229, .18);
}

.today-item {
    cursor: grab;
}

.today-item:active {
    cursor: grabbing;
}

.today-item.dragging {
    opacity: .58;
    transform: rotate(.4deg) scale(1.012);
    border-color: #cfd8ff;
    background: #ffffff;
    box-shadow: 0 18px 34px rgba(79, 70, 229, .14);
}

.today-item.drop-before {
    box-shadow:
        0 -3px 0 var(--primary),
        0 8px 20px rgba(15, 23, 42, .045);
}

.today-item.drop-after {
    box-shadow:
        0 3px 0 var(--primary),
        0 8px 20px rgba(15, 23, 42, .045);
}


/* Progresso por faixas */

.summary-progress-card[data-progress-level="critical"] {
    border-color: rgba(220, 38, 38, .20);
    background: linear-gradient(135deg, #fef2f2, #ffffff);
}

.summary-progress-card[data-progress-level="low"] {
    border-color: rgba(239, 68, 68, .18);
    background: linear-gradient(135deg, #fff7f7, #ffffff);
}

.summary-progress-card[data-progress-level="medium"] {
    border-color: rgba(245, 158, 11, .20);
    background: linear-gradient(135deg, #fffaf0, #ffffff);
}

.summary-progress-card[data-progress-level="good"] {
    border-color: rgba(132, 204, 22, .20);
    background: linear-gradient(135deg, #f7fee7, #ffffff);
}

.summary-progress-card[data-progress-level="excellent"] {
    border-color: rgba(34, 197, 94, .22);
    background: linear-gradient(135deg, #f0fdf4, #ffffff);
}

.today-progress div {
    transition:
        width .42s cubic-bezier(.22, .61, .36, 1),
        background .42s ease,
        box-shadow .42s ease;
}


/* Rodapé */

.site-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 26px 20px 34px;
    margin-left: 240px;
    color: var(--text-soft);
    text-align: left;
}

.site-footer strong,
.site-footer small {
    display: block;
}

.site-footer strong {
    color: #334155;
    font-size: .82rem;
}

.site-footer small {
    margin-top: 3px;
    font-size: .7rem;
}

.footer-signal {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 10px;
    background: var(--primary-soft);
}

.footer-signal span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 0 0 rgba(79, 70, 229, .32);
    animation: footer-pulse 2.2s ease-out infinite;
}

@media (max-width: 900px) {
    .site-footer {
        margin-left: 0;
    }
}

@media (max-width: 560px) {
    .today-actions .reset-day-button {
        width: 100%;
    }

    .routine-enabled-setting {
        align-items: flex-start;
    }
}

@keyframes quote-enter {
    from {
        opacity: 0;
        transform: translateY(7px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes quote-shine {
    to {
        transform: translateX(120%);
    }
}

@keyframes footer-pulse {
    70% {
        box-shadow: 0 0 0 9px rgba(79, 70, 229, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(79, 70, 229, 0);
    }
}


/* =========================================================
   24. SPRINT 15 — LEMBRETES E AGENDA
========================================================= */
.next-reminder-card{display:grid;grid-template-columns:48px minmax(0,1fr) auto;align-items:center;gap:14px;padding:15px 17px;margin:0 0 18px;border:1px solid rgba(79,70,229,.14);border-radius:18px;background:linear-gradient(135deg,#fff,#f6f7ff);box-shadow:0 10px 28px rgba(79,70,229,.055)}
.next-reminder-icon{display:grid;place-items:center;width:46px;height:46px;border-radius:14px;background:var(--primary-soft);font-size:1.25rem;animation:reminder-breathe 2.8s ease-in-out infinite}
.next-reminder-copy{min-width:0}.next-reminder-copy span,.next-reminder-copy strong,.next-reminder-copy small{display:block}.next-reminder-copy span{color:var(--primary);font-size:.68rem;font-weight:750;letter-spacing:.08em;text-transform:uppercase}.next-reminder-copy strong{margin-top:4px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.next-reminder-copy small{margin-top:4px;color:var(--text-soft)}
.task-schedule-grid,.reminder-controls{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.reminder-setting{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:13px 14px;margin-top:18px;border:1px solid #e5e9f2;border-radius:14px;background:#fbfcfe;cursor:pointer}
.reminder-setting>span:first-child{display:flex;flex-direction:column;gap:4px}.reminder-setting strong{font-size:.84rem}.reminder-setting small{color:var(--text-soft);font-size:.72rem;line-height:1.4}
.reminder-controls{padding:14px;margin-top:10px;border:1px solid #e6eaf2;border-radius:14px;background:#f8faff}.reminder-controls[hidden]{display:none}.reminder-controls label{margin-top:0}
select{width:100%;padding:12px;border:1px solid var(--line);border-radius:var(--radius-sm);background:#fff;color:var(--text);font:inherit}
.today-reminder{display:inline-flex;align-items:center;gap:4px;color:var(--primary-dark);font-weight:650}.today-time{display:inline-flex;align-items:center;gap:4px;color:#334155;font-weight:650}
.today-item.reminder-due{border-color:rgba(245,158,11,.42);background:#fffbeb;animation:task-reminder-pulse 1.5s ease-in-out 2}
.agenda-shell{padding:24px;overflow:visible;border:1px solid var(--line);border-radius:var(--radius-lg);background:var(--surface);box-shadow:var(--shadow-card)}
.agenda-toolbar{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;padding-bottom:20px;border-bottom:1px solid #edf1f6}.agenda-toolbar h2{margin:0}.agenda-toolbar p{margin:6px 0 0;color:var(--text-soft);font-size:.84rem}
.notification-status{padding:6px 10px;border-radius:var(--radius-pill);background:#f1f5f9;color:var(--text-soft);font-size:.72rem;font-weight:650}.notification-status.enabled{background:#f0fdf4;color:#15803d}.notification-status.blocked{background:#fff1f2;color:#be123c}
.agenda-list{display:flex;flex-direction:column;gap:10px;padding-top:20px}.agenda-day{margin-top:16px}.agenda-day:first-child{margin-top:0}.agenda-day-title{margin:0 0 9px;color:var(--text-soft);font-size:.73rem;font-weight:750;letter-spacing:.08em;text-transform:uppercase}
.agenda-item{display:grid;grid-template-columns:74px minmax(0,1fr) auto;align-items:center;gap:14px;padding:14px;border:1px solid #e7ebf3;border-radius:15px;background:#fbfcfe;transition:transform var(--transition-fast),border-color var(--transition-fast),box-shadow var(--transition-fast)}
.agenda-item:hover{transform:translateY(-2px);border-color:#cfd8ff;box-shadow:0 10px 24px rgba(15,23,42,.05)}.agenda-time{color:var(--primary);font-size:1rem;font-weight:750}.agenda-copy strong,.agenda-copy small{display:block}.agenda-copy small{margin-top:5px;color:var(--text-soft);font-size:.74rem}
.agenda-badge{padding:5px 9px;border-radius:var(--radius-pill);background:var(--primary-soft);color:var(--primary-dark);font-size:.68rem;font-weight:700}.agenda-empty{display:grid;justify-items:center;padding:58px 20px 36px;text-align:center}.agenda-empty[hidden]{display:none}.agenda-empty h3{margin:15px 0 6px}.agenda-empty p{max-width:430px;margin:0;color:var(--text-soft)}
.reminder-toast{position:fixed;right:24px;bottom:24px;z-index:2000;display:grid;grid-template-columns:44px minmax(180px,1fr);gap:12px;width:min(430px,calc(100vw - 32px));padding:16px;border:1px solid rgba(79,70,229,.22);border-radius:20px;background:rgba(255,255,255,.97);box-shadow:0 24px 70px rgba(15,23,42,.22);backdrop-filter:blur(16px);animation:reminder-toast-enter .34s cubic-bezier(.22,.61,.36,1)}
.reminder-toast[hidden]{display:none}.reminder-toast-icon{display:grid;place-items:center;width:44px;height:44px;border-radius:14px;background:var(--primary-soft);font-size:1.15rem}.reminder-toast-content span,.reminder-toast-content strong,.reminder-toast-content small{display:block}.reminder-toast-content span{color:var(--primary);font-size:.68rem;font-weight:750;letter-spacing:.08em;text-transform:uppercase}.reminder-toast-content strong{margin-top:4px}.reminder-toast-content small{margin-top:5px;color:var(--text-soft)}
.reminder-toast-actions{grid-column:1/-1;display:flex;justify-content:flex-end;gap:8px;padding-top:3px}.reminder-toast-actions button{min-width:auto;padding:8px 11px;font-size:.75rem}
@media(max-width:640px){.next-reminder-card{grid-template-columns:42px minmax(0,1fr)}.next-reminder-card>button{grid-column:1/-1;width:100%}.task-schedule-grid,.reminder-controls{grid-template-columns:1fr}.agenda-toolbar{flex-direction:column}.agenda-item{grid-template-columns:60px minmax(0,1fr)}.agenda-badge{grid-column:2;justify-self:start}.reminder-toast{right:16px;bottom:16px}}
@keyframes reminder-breathe{50%{transform:translateY(-2px);box-shadow:0 8px 20px rgba(79,70,229,.12)}}@keyframes task-reminder-pulse{50%{box-shadow:0 0 0 5px rgba(245,158,11,.10)}}@keyframes reminder-toast-enter{from{opacity:0;transform:translateY(12px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}


/* =========================================================
   25. VERSÃO 15.1 — EDIÇÃO, ORDENAÇÃO E SINCRONIZAÇÃO
========================================================= */
.step-time-input{
    min-width:0;
    padding:9px 8px!important;
    border:1px solid #e5e9f2!important;
    border-radius:10px!important;
    background:#fff!important;
    color:#334155;
    font-size:.8rem!important;
}
.today-item-content{
    cursor:pointer;
    border-radius:10px;
    outline:none;
}
.today-item-content:focus-visible{
    box-shadow:0 0 0 3px rgba(79,70,229,.18);
}
.today-item.completed{
    order:99;
    background:#f8fafc;
    opacity:.82;
}
.notification-toggle-button{
    min-width:176px;
    transition:background var(--transition-fast),color var(--transition-fast),border-color var(--transition-fast),box-shadow var(--transition-fast);
}
.notification-toggle-button.active{
    border-color:#86efac;
    background:#f0fdf4;
    color:#15803d;
    box-shadow:0 0 0 3px rgba(34,197,94,.08);
}
.notification-status.disabled{
    background:#f1f5f9;
    color:#475569;
}
.notification-status.enabled::before,
.notification-status.disabled::before,
.notification-status.blocked::before{
    display:inline-block;
    margin-right:6px;
    font-weight:900;
}
.notification-status.enabled::before{content:"●"}
.notification-status.disabled::before{content:"○"}
.notification-status.blocked::before{content:"!"}
.agenda-item{
    cursor:pointer;
    outline:none;
}
.agenda-item:focus-visible{
    border-color:var(--primary);
    box-shadow:0 0 0 3px rgba(79,70,229,.15);
}
@media(max-width:640px){
    .step{grid-template-columns:24px minmax(0,1fr) 34px}
    .step-time-input{grid-column:2/3;width:100%}
    .step-remove{grid-column:3;grid-row:1/3}
    .notification-toggle-button{width:100%}
}


/* =========================================================
   22. VERSÃO 15.2 — CONFIGURAÇÕES, EXCLUSÃO E ESTADO INICIAL
========================================================= */

.routine-delete-button {
    color: #b91c1c;
    font-size: .9rem;
}

.routine-delete-button:hover {
    background: #fef2f2;
}

.routine-empty {
    display: grid;
    justify-items: center;
    padding: 58px 20px 28px;
    text-align: center;
}

.routine-empty[hidden] {
    display: none;
}

.routine-empty h3 {
    margin: 15px 0 6px;
}

.routine-empty p {
    max-width: 430px;
    margin: 0;
    color: var(--text-soft);
}

.drawer-delete-button {
    padding: 10px 13px;
    border: 1px solid #fecaca;
    border-radius: 12px;
    background: #fff;
    color: #b91c1c;
    cursor: pointer;
}

.drawer-delete-button:hover {
    background: #fef2f2;
}

.settings-layout {
    display: grid;
    gap: 22px;
    max-width: 920px;
    margin-top: 28px;
}

.settings-card {
    padding: 26px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: var(--surface);
    box-shadow: var(--shadow-soft);
}

.settings-card-heading {
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.settings-card-heading h2,
.settings-card-heading p {
    margin: 0;
}

.settings-card-heading p {
    margin-top: 6px;
    color: var(--text-soft);
    line-height: 1.55;
}

.settings-icon {
    display: grid;
    place-items: center;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: var(--primary-soft);
}

.settings-form {
    margin-top: 24px;
}

.settings-form label {
    display: block;
    margin-bottom: 8px;
    font-size: .83rem;
    font-weight: 700;
}

.settings-inline-form {
    display: flex;
    gap: 12px;
}

.settings-inline-form input {
    flex: 1;
    min-width: 0;
}

.danger-zone {
    border-color: #fecaca;
    background: linear-gradient(180deg, #fff, #fffafa);
}

.danger-icon,
.danger-confirmation-icon {
    background: #fef2f2;
    color: #b91c1c;
}

.danger-zone-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding-top: 22px;
    margin-top: 22px;
    border-top: 1px solid #fee2e2;
}

.danger-zone-action p {
    margin: 6px 0 0;
    color: var(--text-soft);
    font-size: .84rem;
    line-height: 1.5;
}

.danger-acknowledgement {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px;
    margin-top: 20px;
    border: 1px solid #fecaca;
    border-radius: 14px;
    background: #fffafa;
    color: #7f1d1d;
    cursor: pointer;
}

.danger-acknowledgement input {
    margin-top: 3px;
}

.danger-button:disabled {
    cursor: not-allowed;
    opacity: .46;
}

@media (max-width: 720px) {
    .settings-inline-form,
    .danger-zone-action {
        align-items: stretch;
        flex-direction: column;
    }

    .settings-inline-form button,
    .danger-zone-action button {
        width: 100%;
    }

    .drawer-actions {
        flex-wrap: wrap;
        justify-content: flex-end;
    }
}


/* =========================================================
   26. VERSÃO 16 — PROGRAMAÇÃO E CARDS EXPANSÍVEIS
========================================================= */
.routine-schedule-panel{display:grid;gap:9px;margin-top:14px;padding:14px;border:1px solid #e5e9f2;border-radius:14px;background:#fbfcfe}.routine-schedule-panel>label{font-size:.78rem;font-weight:700}.routine-schedule-panel select{width:100%;padding:10px 12px;border:1px solid #dfe5ee;border-radius:10px;background:#fff;color:var(--text)}.weekday-picker{display:flex;flex-wrap:wrap;gap:7px}.weekday-picker label{display:inline-flex;align-items:center;gap:5px;padding:7px 9px;border:1px solid #dfe5ee;border-radius:999px;background:#fff;font-size:.72rem;cursor:pointer}.weekday-picker label:has(input:checked){border-color:#aebcff;background:var(--primary-soft);color:var(--primary-dark)}
.step{grid-template-columns:24px minmax(180px,1fr) 116px 112px 34px}.step-reminder-input{width:100%;min-width:0;padding:10px;border:1px solid #dfe5ee;border-radius:10px;background:#fff;color:var(--text)}
.today-item{align-items:start;height:auto!important;min-height:84px}.today-item-content{min-width:0;white-space:normal!important;overflow:visible!important}.today-item-title{display:block;overflow:visible!important;text-overflow:clip!important;white-space:normal!important;overflow-wrap:anywhere;word-break:normal;line-height:1.48}.today-item-meta{flex-wrap:wrap}.today-check,.today-remove{margin-top:2px}
@media(max-width:760px){.step{grid-template-columns:24px minmax(0,1fr) 34px}.step-time-input,.step-reminder-input{grid-column:2;width:100%}.today-item{grid-template-columns:42px minmax(0,1fr) 28px;padding:14px 12px}.today-item-title{font-size:.94rem;line-height:1.5}.today-item-meta{margin-top:8px}}


/* =========================================================
   27. VERSÃO 16.1 — PROGRAMAÇÃO PROGRESSIVA E EDITOR DE TAREFAS
========================================================= */
.drawer-body{
    overflow-x:hidden;
}
.routine-schedule-panel[hidden]{
    display:none!important;
}
.routine-schedule-panel{
    animation:schedule-panel-enter .2s ease-out;
}
@keyframes schedule-panel-enter{
    from{opacity:0;transform:translateY(-4px)}
    to{opacity:1;transform:translateY(0)}
}

.step{
    display:grid;
    grid-template-columns:24px minmax(0,1fr) 34px!important;
    align-items:start;
    gap:10px;
    padding:12px 10px 12px 8px;
    overflow:hidden;
}
.step-main{
    display:grid;
    min-width:0;
    gap:10px;
}
.step-input{
    display:block;
    width:100%;
    min-width:0;
    min-height:44px;
    max-height:240px;
    resize:none;
    overflow-y:auto;
    padding:10px 11px!important;
    border:1px solid transparent!important;
    border-radius:10px!important;
    background:transparent!important;
    color:var(--text);
    font:inherit;
    font-size:.9rem!important;
    line-height:1.45;
}
.step-input:hover{background:#f7f9fc!important}
.step-input:focus{background:#fff!important;border-color:#cfd8ff!important}
.step-options{
    display:flex;
    align-items:flex-end;
    flex-wrap:wrap;
    gap:9px;
}
.step-field{
    display:grid;
    gap:5px;
    min-width:0;
    color:var(--text-soft);
    font-size:.68rem;
    font-weight:700;
}
.step-field>span{
    padding-left:2px;
}
.step-time-field{
    width:148px;
}
.step-time-input,
.step-reminder-input{
    width:100%!important;
    min-width:0!important;
    height:40px;
    padding:8px 10px!important;
    border:1px solid #dfe5ee!important;
    border-radius:10px!important;
    background:#fff!important;
    color:var(--text)!important;
}
.step-reminder-toggle{
    display:inline-flex;
    align-items:center;
    gap:7px;
    min-height:40px;
    padding:8px 11px;
    border:1px solid #dfe5ee;
    border-radius:10px;
    background:#fff;
    color:var(--text-soft);
    font-size:.72rem;
    font-weight:700;
    cursor:pointer;
}
.step-reminder-toggle input{
    width:16px;
    height:16px;
    padding:0!important;
    accent-color:var(--primary);
}
.step-reminder-toggle:has(input:checked){
    border-color:#aebcff;
    background:var(--primary-soft);
    color:var(--primary-dark);
}
.step-reminder-toggle.disabled{
    opacity:.48;
    cursor:not-allowed;
}
.step-reminder-field{
    width:126px;
}
.step-reminder-field[hidden]{
    display:none!important;
}
.step-remove{
    grid-column:3;
    grid-row:1;
    margin-top:4px;
}
.drag{
    grid-column:1;
    grid-row:1;
    margin-top:4px;
}

@media(max-width:760px){
    .drawer-body{padding-inline:18px}
    .step-options{
        display:grid;
        grid-template-columns:minmax(0,1fr);
        align-items:stretch;
    }
    .step-time-field,
    .step-reminder-field{
        width:100%;
    }
    .step-reminder-toggle{
        justify-content:flex-start;
    }
}


/* =========================================================
   26. VERSÃO 16.2 — ROTINA OFICIAL PROTEGIDA
========================================================= */

.routine-badges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
}

.system-routine-badge {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #dbe3ee;
}

.card:hover .system-routine-badge {
    transform: none;
    box-shadow: none;
}

.routine-toggle-locked {
    cursor: default;
    user-select: none;
    border-color: #dbe3ee;
    background: #f8fafc;
    color: #475569;
}

.routine-toggle-locked:hover {
    transform: none;
    border-color: #dbe3ee;
}

.system-routine-footer {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #64748b;
    font-size: .76rem;
    font-weight: 700;
}

.system-routine-notice {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 13px;
    align-items: start;
    padding: 15px 16px;
    border: 1px solid #cbd5e1;
    border-radius: 16px;
    background: #f8fafc;
    color: #334155;
}

.system-routine-notice[hidden] {
    display: none;
}

.system-routine-notice-icon {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 13px;
    background: #e2e8f0;
    font-size: 1.15rem;
}

.system-routine-notice strong {
    display: block;
    margin-bottom: 4px;
    color: #1e293b;
}

.system-routine-notice p {
    margin: 0;
    color: #64748b;
    font-size: .88rem;
    line-height: 1.5;
}

.drawer-readonly .routine-name-input:disabled,
.drawer-readonly select:disabled,
.drawer-readonly input:disabled,
.drawer-readonly textarea:disabled {
    color: #334155;
    -webkit-text-fill-color: #334155;
    opacity: 1;
    cursor: default;
}

.drawer-readonly .routine-enabled-setting,
.drawer-readonly .routine-schedule-panel,
.drawer-readonly .step {
    background: #f8fafc;
}

.drawer-readonly .step {
    cursor: default;
}

.drawer-readonly .step .drag,
.drawer-readonly .step-remove {
    opacity: .35;
}

.drawer-readonly .switch-control,
.drawer-readonly .step-reminder-toggle {
    pointer-events: none;
}

@media (max-width: 640px) {
    .routine-badges {
        gap: 5px;
    }

    .system-routine-notice {
        grid-template-columns: 38px minmax(0, 1fr);
        padding: 13px;
    }

    .system-routine-notice-icon {
        width: 38px;
        height: 38px;
    }
}


/* =========================================================
   28. VERSÃO 17.1 — NOVO DIA RESPONSIVO
========================================================= */

.new-day-notice {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
    padding: 15px 17px;
    border: 1px solid #c7d2fe;
    border-radius: 18px;
    background: linear-gradient(135deg, #f7f8ff 0%, #eef2ff 100%);
    box-shadow: 0 12px 30px rgba(79, 70, 229, .08);
}

.new-day-notice[hidden] {
    display: none !important;
}

.new-day-notice-icon {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 8px 20px rgba(79, 70, 229, .10);
    font-size: 1.25rem;
}

.new-day-notice-copy {
    min-width: 0;
}

.new-day-notice-copy strong {
    display: block;
    color: var(--text);
}

.new-day-notice-copy p {
    margin: 4px 0 0;
    color: var(--text-soft);
    font-size: .86rem;
    line-height: 1.45;
}

.new-day-notice-action {
    white-space: nowrap;
}

.new-day-overlay {
    background: rgba(15, 23, 42, .55);
    backdrop-filter: blur(8px);
}

.new-day-modal {
    width: min(610px, 100%);
    padding: 0;
    overflow: hidden auto;
    border-color: rgba(199, 210, 254, .82);
}

.new-day-hero {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    align-items: center;
    gap: 17px;
    padding: 26px 28px 22px;
    background: linear-gradient(135deg, #eef2ff 0%, #ffffff 70%, #f5f3ff 100%);
    border-bottom: 1px solid #e4e7f5;
}

.new-day-icon {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 14px 32px rgba(79, 70, 229, .14);
    font-size: 1.65rem;
}

.new-day-kicker {
    display: block;
    margin-bottom: 5px;
    color: var(--primary);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .11em;
    text-transform: uppercase;
}

.new-day-hero h2 {
    margin: 0;
    font-size: clamp(1.42rem, 3vw, 1.85rem);
}

.new-day-date {
    margin: 6px 0 0;
    color: var(--text-soft);
    font-size: .9rem;
    line-height: 1.4;
}

.new-day-description {
    margin: 0;
    padding: 22px 28px 0;
    color: var(--text-soft);
    line-height: 1.6;
}

.new-day-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 11px;
    margin: 19px 28px 0;
}

.new-day-summary > div {
    padding: 15px 16px;
    border: 1px solid #e5e9f3;
    border-radius: 15px;
    background: #fafbff;
}

.new-day-summary span {
    display: block;
    color: var(--text-soft);
    font-size: .72rem;
    font-weight: 700;
    line-height: 1.35;
}

.new-day-summary strong {
    display: block;
    margin-top: 6px;
    color: var(--primary-dark);
    font-size: 1.5rem;
}

.new-day-routine-list {
    display: grid;
    gap: 9px;
    max-height: 220px;
    margin: 16px 28px 0;
    overflow-y: auto;
}

.new-day-routine-item {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    padding: 11px 13px;
    border: 1px solid #e7eaf2;
    border-radius: 14px;
    background: #ffffff;
}

.new-day-routine-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--primary-soft);
    font-size: 1.05rem;
}

.new-day-routine-item strong,
.new-day-routine-item small {
    display: block;
}

.new-day-routine-item small {
    margin-top: 3px;
    color: var(--text-soft);
    font-size: .76rem;
}

.new-day-no-routines {
    margin: 0;
    padding: 14px 15px;
    border: 1px dashed #cbd5e1;
    border-radius: 14px;
    color: var(--text-soft);
    background: #f8fafc;
    font-size: .84rem;
    line-height: 1.5;
}

.new-day-actions {
    margin: 22px 28px 0;
    padding: 0 0 27px;
}

.new-day-actions button {
    min-width: 136px;
}

@media (max-width: 640px) {
    .modal-overlay.new-day-overlay {
        place-items: end center;
        padding: 12px;
    }

    .new-day-modal {
        width: 100%;
        max-height: calc(100dvh - 24px);
        border-radius: 24px 24px 18px 18px;
    }

    .new-day-hero {
        grid-template-columns: 52px minmax(0, 1fr);
        gap: 13px;
        padding: 21px 19px 18px;
    }

    .new-day-icon {
        width: 52px;
        height: 52px;
        border-radius: 16px;
        font-size: 1.35rem;
    }

    .new-day-description {
        padding: 18px 19px 0;
        font-size: .9rem;
    }

    .new-day-summary {
        gap: 8px;
        margin: 16px 19px 0;
    }

    .new-day-summary > div {
        padding: 13px;
    }

    .new-day-summary strong {
        font-size: 1.3rem;
    }

    .new-day-routine-list {
        max-height: 190px;
        margin: 13px 19px 0;
    }

    .new-day-actions {
        flex-direction: column;
        margin: 18px 19px 0;
        padding-bottom: 19px;
    }

    .new-day-actions button {
        width: 100%;
        min-height: 46px;
    }

    .new-day-actions .primary {
        order: -1;
    }

    .new-day-notice {
        grid-template-columns: 40px minmax(0, 1fr);
        gap: 11px;
        padding: 13px;
    }

    .new-day-notice-icon {
        width: 40px;
        height: 40px;
        border-radius: 12px;
        font-size: 1.05rem;
    }

    .new-day-notice-action {
        grid-column: 1 / -1;
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .new-day-modal,
    .new-day-notice {
        transition: none;
    }
}

/* =========================================================
   VERSÃO 18.0 — BASE DE CONHECIMENTO
========================================================= */
.sidebar-help-link {
    margin-top: 22px;
    border-top: 1px solid var(--line);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    padding-top: 20px;
}
.knowledge-header { gap: 24px; }
.knowledge-version {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 8px 12px;
    border: 1px solid #d8ddfb;
    border-radius: var(--radius-pill);
    color: var(--primary-dark);
    background: var(--primary-soft);
    font-size: .78rem;
    font-weight: 750;
    white-space: nowrap;
}
.knowledge-search-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin: 8px 0 22px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: rgba(255,255,255,.9);
    box-shadow: var(--shadow-card);
    overflow: visible;
}
.knowledge-search {
    position: relative;
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
    flex: 1;
    padding: 0 14px;
    border: 1px solid #dce2ed;
    border-radius: 14px;
    background: #f9fbfe;
}
.knowledge-search > span { color: var(--primary); font-size: 1.25rem; }
.knowledge-search input {
    width: 100%;
    min-width: 0;
    height: 50px;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
    font-size: 1rem;
}
.knowledge-search input::-webkit-search-cancel-button { display: none; }
.knowledge-search button {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 9px;
    color: var(--text-soft);
    background: transparent;
}
.knowledge-search button:hover { background: #edf1f7; color: var(--text); }
.knowledge-stats { color: var(--text-soft); font-size: .88rem; white-space: nowrap; }
.knowledge-featured,
.knowledge-browser {
    margin-bottom: 24px;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: rgba(255,255,255,.92);
    box-shadow: var(--shadow-card);
    overflow: visible;
}
.knowledge-featured { background: linear-gradient(145deg, #f6f7ff, #fff); border-color: #dfe2ff; }
.knowledge-section-heading,
.knowledge-results-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 16px;
}
.knowledge-section-heading h2,
.knowledge-results-heading h2 { margin: 3px 0 0; font-size: 1.35rem; }
.knowledge-results-heading > span { color: var(--text-soft); font-size: .84rem; }
.knowledge-featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
}
.knowledge-featured-card,
.knowledge-procedure-open,
.knowledge-question {
    width: 100%;
    border: 0;
    color: inherit;
    text-align: left;
    cursor: pointer;
}
.knowledge-featured-card {
    display: grid;
    grid-template-columns: 42px minmax(0,1fr) auto;
    gap: 12px;
    align-items: center;
    min-height: 118px;
    padding: 16px;
    border: 1px solid #e0e3f8;
    border-radius: 16px;
    background: white;
    transition: transform .18s, box-shadow .18s, border-color .18s;
}
.knowledge-featured-card:hover { transform: translateY(-2px); border-color: #b9c0fa; box-shadow: var(--shadow-card-hover); }
.knowledge-featured-copy,
.knowledge-card-copy { min-width: 0; display: grid; gap: 5px; }
.knowledge-featured-copy small,
.knowledge-card-copy small { color: var(--primary); font-size: .72rem; font-weight: 750; text-transform: uppercase; letter-spacing: .04em; }
.knowledge-featured-copy strong,
.knowledge-card-copy strong { color: var(--text); line-height: 1.5; }
.knowledge-featured-copy > span:last-child,
.knowledge-card-copy > span { color: var(--text-soft); font-size: .86rem; line-height: 1.45; }
.knowledge-card-icon {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    color: var(--primary-dark);
    background: var(--primary-soft);
    font-size: 1rem;
    font-weight: 800;
}
.knowledge-card-icon.procedure { color: #97520b; background: #fff4df; }
.knowledge-filter-bar {
    display: flex;
    gap: 9px;
    margin-bottom: 22px;
    padding-bottom: 4px;
    overflow-x: auto;
    scrollbar-width: thin;
}
.knowledge-filter {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex: 0 0 auto;
    padding: 9px 13px;
    border: 1px solid #dce2ec;
    border-radius: var(--radius-pill);
    color: var(--text-soft);
    background: white;
    font-weight: 650;
    cursor: pointer;
}
.knowledge-filter:hover,
.knowledge-filter.active { color: var(--primary-dark); border-color: #aeb6fa; background: var(--primary-soft); }
.knowledge-content-list { display: grid; gap: 12px; }
.knowledge-card {
    border: 1px solid var(--line);
    border-radius: 18px;
    background: white;
    overflow: hidden;
    transition: border-color .18s, box-shadow .18s;
}
.knowledge-card:hover { border-color: #cbd2e0; box-shadow: 0 10px 24px rgba(15,23,42,.045); }
.knowledge-question,
.knowledge-procedure-open {
    display: grid;
    grid-template-columns: 42px minmax(0,1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 17px 18px;
    background: white;
}
.knowledge-question-chevron { color: var(--primary); font-size: 1.35rem; font-weight: 500; }
.knowledge-answer { padding: 0 18px 18px 74px; }
.knowledge-answer-text {
    padding-top: 15px;
    border-top: 1px solid var(--line);
    color: #39455a;
    line-height: 1.7;
}
.knowledge-answer-text p { margin: 0; }
.knowledge-card-footer { margin-top: 12px; }
.knowledge-link-button {
    border: 0;
    padding: 0;
    color: var(--primary);
    background: transparent;
    font-weight: 750;
    cursor: pointer;
}
.knowledge-step-count {
    display: inline-flex;
    width: max-content;
    margin-top: 3px;
    padding: 3px 8px;
    border-radius: 999px;
    color: #8a4b07 !important;
    background: #fff4df;
    font-size: .7rem !important;
    font-weight: 750;
}
.knowledge-keywords { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 13px; }
.knowledge-keywords span {
    padding: 4px 8px;
    border-radius: 999px;
    color: #526075;
    background: #f0f3f8;
    font-size: .72rem;
}
.knowledge-empty {
    padding: 42px 20px;
    text-align: center;
    color: var(--text-soft);
}
.knowledge-empty h3 { margin-bottom: 6px; color: var(--text); }
.knowledge-detail-overlay { z-index: 55; }
.knowledge-detail-modal {
    width: min(780px, calc(100vw - 32px));
    max-height: min(88vh, 900px);
    padding: 0;
    overflow: hidden;
}
.knowledge-detail-header { padding: 24px 26px 18px; border-bottom: 1px solid var(--line); }
.knowledge-detail-header > div { min-width: 0; }
.knowledge-detail-header h2 { margin: 8px 0 6px; font-size: clamp(1.55rem, 3vw, 2.15rem); line-height: 1.15; }
.knowledge-detail-header p { margin: 0; color: var(--text-soft); line-height: 1.55; }
.knowledge-detail-meta { display: flex; flex-wrap: wrap; gap: 7px; }
.knowledge-detail-meta span {
    padding: 5px 8px;
    border-radius: 999px;
    color: var(--primary-dark);
    background: var(--primary-soft);
    font-size: .7rem;
    font-weight: 750;
}
.knowledge-detail-meta span:first-child[data-type="procedure"] { color: #8b4b08; background: #fff3dd; }
.knowledge-detail-body {
    display: grid;
    gap: 18px;
    max-height: calc(88vh - 245px);
    padding: 22px 26px;
    overflow-y: auto;
}
.knowledge-detail-section { color: #374256; line-height: 1.7; }
.knowledge-detail-section h3 { margin: 0 0 8px; color: var(--text); font-size: 1rem; }
.knowledge-detail-section p { margin: 0; }
.knowledge-detail-section ul { margin: 0; padding-left: 20px; }
.knowledge-procedure-steps { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.knowledge-procedure-steps li { display: grid; grid-template-columns: 34px minmax(0,1fr); gap: 12px; align-items: start; }
.knowledge-procedure-steps li > span { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; color: white; background: var(--primary); font-size: .82rem; font-weight: 800; }
.knowledge-procedure-steps p { padding-top: 3px; }
.knowledge-attention,
.knowledge-contact { padding: 14px 15px; border-radius: 13px; }
.knowledge-attention { color: #73420c; background: #fff6e7; border: 1px solid #f7ddb5; }
.knowledge-contact { color: #244a73; background: #eef6ff; border: 1px solid #d5e7fa; }
.knowledge-related { padding: 0 26px 20px; }
.knowledge-related h3 { font-size: .94rem; }
.knowledge-related > div { display: grid; grid-template-columns: repeat(auto-fit,minmax(200px,1fr)); gap: 8px; }
.knowledge-related button {
    display: grid;
    grid-template-columns: 30px minmax(0,1fr);
    gap: 3px 9px;
    padding: 11px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fafbfe;
    text-align: left;
    cursor: pointer;
}
.knowledge-related button span { grid-row: 1 / span 2; }
.knowledge-related button strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.knowledge-related button small { color: var(--text-soft); }
.knowledge-detail-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 16px 26px;
    border-top: 1px solid var(--line);
    background: #fafbfe;
}
.knowledge-detail-footer small { color: var(--text-soft); }

@media (max-width: 760px) {
    .knowledge-header,
    .knowledge-search-panel,
    .knowledge-section-heading,
    .knowledge-results-heading { align-items: stretch; flex-direction: column; }
    .knowledge-version { align-self: flex-start; }
    .knowledge-search-panel { padding: 15px; }
    .knowledge-stats { white-space: normal; }
    .knowledge-featured,
    .knowledge-browser { padding: 16px; }
    .knowledge-featured-grid { grid-template-columns: 1fr; }
    .knowledge-question,
    .knowledge-procedure-open { grid-template-columns: 38px minmax(0,1fr) auto; gap: 10px; padding: 15px 13px; }
    .knowledge-answer { padding: 0 13px 15px; }
    .knowledge-detail-overlay { align-items: flex-end; padding: 0; }
    .knowledge-detail-modal { width: 100%; max-height: 94vh; border-radius: 24px 24px 0 0; }
    .knowledge-detail-header { padding: 20px 18px 15px; }
    .knowledge-detail-body { max-height: calc(94vh - 235px); padding: 18px; }
    .knowledge-related { padding: 0 18px 18px; }
    .knowledge-detail-footer { align-items: stretch; flex-direction: column; padding: 14px 18px calc(14px + env(safe-area-inset-bottom)); }
    .knowledge-detail-footer .primary { width: 100%; }
}

/* =========================================================
   VERSÃO 18.1 — BETA, DESTAQUES E CONTEÚDOS RELACIONADOS
========================================================= */
.logo-lockup { position: relative; width: 64px; margin: 0 auto 36px; }
.logo-lockup .logo { margin: 0; }
.app-beta-badge {
    position: absolute; right: -12px; bottom: -8px; z-index: 2;
    display: inline-flex; align-items: center; justify-content: center;
    padding: 3px 6px; border: 2px solid white; border-radius: 999px;
    color: #7c2d12; background: #fed7aa; box-shadow: 0 4px 12px rgba(124,45,18,.16);
    font-size: .52rem; font-weight: 900; letter-spacing: .08em;
}
.beta-settings-card { border-color: #fed7aa; background: linear-gradient(145deg,#fffaf2,#fff); }
.beta-settings-icon { width: auto !important; min-width: 58px; padding: 0 8px; color: #7c2d12 !important; background: #ffedd5 !important; font-size: .7rem !important; font-weight: 900; letter-spacing: .08em; }

.knowledge-featured { background: linear-gradient(145deg,#f9faff,#fff); }
.knowledge-carousel-controls { display: flex; gap: 7px; }
.knowledge-carousel-controls button {
    display: grid; place-items: center; width: 36px; height: 36px;
    border: 1px solid #d7ddea; border-radius: 11px; color: #42506a; background: white;
    font-size: 1.15rem; font-weight: 800;
}
.knowledge-carousel-controls button:hover:not(:disabled) { border-color: #9faee7; color: var(--primary); background: #f7f8ff; }
.knowledge-carousel-controls button:disabled { opacity: .35; cursor: not-allowed; }
.knowledge-carousel-controls button[aria-pressed="true"] { color: #7c2d12; background: #fff0e4; border-color: #fdba74; }
.knowledge-featured-grid {
    display: flex; gap: 14px; overflow-x: hidden; scroll-behavior: smooth; scroll-snap-type: x mandatory;
    scrollbar-width: none;
}
.knowledge-featured-grid::-webkit-scrollbar { display: none; }
.knowledge-featured-card {
    flex: 0 0 calc((100% - 14px)/2); min-width: 0; min-height: 150px; scroll-snap-align: start;
    border-width: 1px; box-shadow: 0 9px 24px rgba(15,23,42,.045);
}
.knowledge-featured-card .knowledge-featured-copy > span:last-child {
    display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 3;
}
.knowledge-featured-card.tone-1 { border-color: #b9d8f8; background: linear-gradient(145deg,#eef7ff,#fff); }
.knowledge-featured-card.tone-1 .knowledge-card-icon { color: #075985; background: #dbeafe; }
.knowledge-featured-card.tone-1 small { color: #0369a1; }
.knowledge-featured-card.tone-2 { border-color: #b9eadf; background: linear-gradient(145deg,#ecfdf7,#fff); }
.knowledge-featured-card.tone-2 .knowledge-card-icon { color: #0f766e; background: #ccfbf1; }
.knowledge-featured-card.tone-2 small { color: #0f766e; }
.knowledge-featured-card.tone-3 { border-color: #ead5ad; background: linear-gradient(145deg,#fff8e8,#fff); }
.knowledge-featured-card.tone-3 .knowledge-card-icon { color: #92400e; background: #ffedd5; }
.knowledge-featured-card.tone-3 small { color: #a16207; }
.knowledge-featured-card.tone-4 { border-color: #d9c9f4; background: linear-gradient(145deg,#f7f2ff,#fff); }
.knowledge-featured-card.tone-4 .knowledge-card-icon { color: #6d28d9; background: #ede9fe; }
.knowledge-featured-card.tone-4 small { color: #6d28d9; }
.knowledge-card-arrow { align-self: center; color: currentColor; font-size: 1.2rem; }
.knowledge-carousel-dots { display: flex; justify-content: center; gap: 6px; margin-top: 14px; }
.knowledge-carousel-dots span { width: 7px; height: 7px; border-radius: 999px; background: #cbd3e0; transition: width .2s, background .2s; }
.knowledge-carousel-dots span.active { width: 22px; background: var(--primary); }

.knowledge-detail-modal { display: grid; grid-template-rows: auto minmax(0,1fr) auto; }
.knowledge-detail-header { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: start; gap: 11px; }
.knowledge-detail-header > div { min-width: 0; }
.knowledge-detail-back { margin-top: 1px; }
.knowledge-detail-scroll { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.knowledge-detail-body { max-height: none; overflow: visible; }
.knowledge-related { padding-top: 4px; padding-bottom: 25px; }
.knowledge-related > div { grid-template-columns: repeat(auto-fit,minmax(260px,1fr)); gap: 10px; }
.knowledge-related button {
    grid-template-columns: 40px minmax(0,1fr) auto; align-items: center; gap: 10px;
    min-height: 68px; padding: 12px 13px; overflow: visible;
}
.knowledge-related-icon {
    display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px;
    color: #075985; background: #dbeafe; font-weight: 900;
}
.knowledge-related-icon.procedure { color: #92400e; background: #ffedd5; }
.knowledge-related-copy { min-width: 0; display: grid; gap: 3px; }
.knowledge-related-copy strong { overflow: visible !important; text-overflow: clip !important; white-space: normal !important; line-height: 1.32; }
.knowledge-related-copy small { line-height: 1.35; }
.knowledge-related-arrow { color: var(--primary); font-size: 1.15rem; }

.system-routine-toggle { cursor: pointer; }
.card.system-routine-disabled { opacity: 1; }
.card.system-routine-disabled .accent { filter: none; opacity: .62; }
.card.system-routine-disabled .progress-info strong::after { content: " · modo manual"; font-weight: 500; color: var(--text-soft); }
.site-footer strong { line-height: 1.4; }

@media (max-width: 760px) {
    .knowledge-section-heading { flex-direction: row; align-items: center; }
    .knowledge-carousel-controls { margin-left: auto; }
    .knowledge-featured-card { flex-basis: 100%; min-height: 160px; }
    .knowledge-detail-header { grid-template-columns: auto minmax(0,1fr) auto; }
    .knowledge-detail-scroll { max-height: calc(94vh - 155px); }
    .knowledge-related > div { grid-template-columns: 1fr; }
    .knowledge-related button { min-height: 74px; }
    .app-beta-badge { right: -10px; bottom: -7px; }
}


/* =========================================================
   VERSÃO 18.4 — SELO BETA E MODO MANUAL DAS ROTINAS
========================================================= */
.logo-lockup .app-beta-badge { transform: translate(0,0); }
.system-routine-toggle:not(.enabled) { color: #475569; background: #f1f5f9; border-color: #d7ddea; }
.system-routine-toggle:not(.enabled) .routine-toggle-dot { background: #94a3b8; }

/* Versão 18.4 — ícones SVG e origem das tarefas */
.rotina-svg-icon { width: 1em; height: 1em; display: block; fill: currentColor; }
.rotina-text-icon { display: inline-grid; place-items: center; }
.card-icon-circle .app-routine-svg-icon { width: 1.35rem; height: 1.35rem; }
.picker-icon .app-picker-svg-icon { width: 1.2rem; height: 1.2rem; }
.new-day-routine-icon .app-new-day-svg-icon { width: 1.2rem; height: 1.2rem; }
.knowledge-filter-svg { width: .92rem; height: .92rem; }

.today-source { border: 1px solid transparent; }
.today-source.source-standalone {
    color: #1859a7;
    border-color: #b9d7fb;
    background: #eaf4ff;
}
.today-source.source-personal {
    color: #4c3bc8;
    border-color: #d5d0ff;
    background: #f0eeff;
}
.today-source.source-system {
    color: #08706b;
    border-color: #b6e4df;
    background: #e6f7f4;
}
.today-item.completed .today-source { opacity: .7; filter: saturate(.55); }

/* =========================================================
   VERSÃO 18.4 — MODAIS CENTRAIS, BASE EXPANSÍVEL E NOTIFICAÇÕES
========================================================= */
@media(max-width:760px){
    .modal-overlay,
    .modal-overlay.new-day-overlay,
    .knowledge-detail-overlay { place-items:center; align-items:center; padding:14px; }
    .new-day-modal,
    .knowledge-detail-modal { width:100%; max-height:calc(100dvh - 28px); border-radius:24px; }
    .knowledge-detail-scroll { max-height:calc(100dvh - 190px); }
    .knowledge-detail-footer { padding-bottom:14px; }
}
.knowledge-inline-body { padding:0 18px 18px 74px; }
.knowledge-inline-body[hidden] { display:none; }
.knowledge-inline-sections { display:grid; gap:13px; }
.knowledge-inline-section { color:#374256; line-height:1.65; }
.knowledge-inline-section h4 { margin:0 0 6px; color:var(--text); font-size:.9rem; }
.knowledge-inline-section p { margin:0; }
.knowledge-inline-attention,.knowledge-inline-contact,.knowledge-inline-info { padding:12px 13px; border-radius:12px; }
.knowledge-inline-attention { color:#73420c; background:#fff6e7; border:1px solid #f7ddb5; }
.knowledge-inline-contact { color:#244a73; background:#eef6ff; border:1px solid #d5e7fa; }
.knowledge-inline-info { color:#1e4f75; background:#f0f8ff; border:1px solid #cfe4f7; }
.knowledge-safe-rich h3,.knowledge-safe-rich h4 { margin:12px 0 6px; color:var(--text); }
.knowledge-safe-rich p { margin:0 0 9px; }
.knowledge-safe-rich ul,.knowledge-safe-rich ol { margin:7px 0; padding-left:22px; }
.knowledge-safe-rich a { color:var(--primary); text-decoration:underline; overflow-wrap:anywhere; }
.knowledge-safe-rich u { text-underline-offset:2px; }
.knowledge-safe-rich .rich-divider { height:1px; margin:12px 0; background:var(--line); }
.notification-help { display:grid; gap:10px; margin-top:14px; padding:14px 15px; border:1px solid #fecdd3; border-radius:14px; color:#9f1239; background:#fff1f2; }
.notification-help[hidden] { display:none; }
.notification-help p { margin:0; font-size:.84rem; line-height:1.5; }
.notification-help-actions { display:flex; flex-wrap:wrap; gap:8px; }
.notification-help-actions button { min-height:38px; }
@media(max-width:760px){
    .knowledge-inline-body { padding:0 13px 15px; }
}

/* =========================================================
   VERSÃO 18.4 — AVISOS ADMINISTRATIVOS
========================================================= */
.administrative-notices-container { display:grid; gap:10px; margin-bottom:16px; }
.administrative-notices-container[hidden] { display:none; }
.administrative-notice-banner { display:grid; grid-template-columns:50px minmax(0,1fr) auto; gap:13px; align-items:center; padding:15px 16px; border:1px solid #cbdaf2; border-left:5px solid #3971d6; border-radius:17px; color:#173b6d; background:#f3f7ff; box-shadow:0 10px 24px rgba(37,80,145,.07); }
.administrative-notice-banner.notice-novelty { border-color:#ddcff8; border-left-color:#7f56d9; color:#56348b; background:#faf7ff; }
.administrative-notice-banner.notice-warning { border-color:#f5d8ad; border-left-color:#e69221; color:#74430d; background:#fff9ef; }
.administrative-notice-banner.notice-urgent { border-color:#f3c7c3; border-left-color:#d92d20; color:#8f2119; background:#fff5f4; }
.administrative-notice-icon { display:grid; place-items:center; width:50px; height:50px; border-radius:14px; color:currentColor; background:rgba(255,255,255,.72); }
.administrative-notice-icon .rotina-svg-icon { width:25px; height:25px; }
.administrative-notice-copy { min-width:0; }
.administrative-notice-copy > small { display:block; margin-bottom:2px; font-size:.68rem; font-weight:900; text-transform:uppercase; letter-spacing:.08em; }
.administrative-notice-copy > strong { display:block; color:var(--text); font-size:1rem; }
.administrative-notice-message { color:inherit; font-size:.85rem; line-height:1.55; }
.administrative-notice-message p { margin:4px 0 0; }
.administrative-notice-message ul { margin:7px 0 0; padding-left:20px; }
.administrative-notice-message a { color:currentColor; text-decoration:underline; overflow-wrap:anywhere; }
.administrative-notice-actions { display:flex; align-items:center; gap:8px; }
.administrative-notice-actions .ghost { white-space:nowrap; }
.notice-dismiss { display:grid; place-items:center; width:34px; height:34px; border:0; border-radius:999px; color:currentColor; background:rgba(255,255,255,.72); font-size:22px; cursor:pointer; }
.administrative-notice-modal { padding:14px; border:1px solid #d7e1f0; border-left:5px solid #3971d6; border-radius:14px; color:#1e416f; background:#f5f8ff; }
.administrative-notice-modal.notice-novelty { border-left-color:#7f56d9; color:#57358c; background:#faf8ff; }
.administrative-notice-modal.notice-warning { border-left-color:#e69221; color:#74430d; background:#fffaf1; }
.administrative-notice-modal.notice-urgent { border-left-color:#d92d20; color:#8f2119; background:#fff6f5; }
.administrative-notice-modal-heading { display:flex; align-items:center; gap:9px; margin-bottom:7px; }
.administrative-notice-modal-heading > span { display:grid; place-items:center; width:38px; height:38px; border-radius:11px; background:rgba(255,255,255,.85); }
.administrative-notice-modal-heading .rotina-svg-icon { width:20px; height:20px; }
.administrative-notice-modal-heading small { font-weight:900; text-transform:uppercase; letter-spacing:.08em; }
@media(max-width:700px){
    .administrative-notice-banner { grid-template-columns:42px minmax(0,1fr); padding:13px; }
    .administrative-notice-icon { width:42px; height:42px; }
    .administrative-notice-actions { grid-column:2; justify-content:flex-start; flex-wrap:wrap; }
}


/* =========================================================
   VERSÃO 18.6 — BLOCOS DA BASE DE CONHECIMENTO
========================================================= */
.rich-divider { height:1px; margin:20px 0; background:var(--line); }
.knowledge-callout { display:grid; grid-template-columns:34px minmax(0,1fr); gap:10px; align-items:flex-start; padding:13px 14px; border:1px solid; border-radius:14px; }
.knowledge-callout-icon { display:grid; place-items:center; width:32px; height:32px; border-radius:10px; }
.knowledge-callout-icon .rotina-svg-icon { width:18px; height:18px; }
.knowledge-callout h4 { margin:1px 0 6px; font-size:.88rem; }
.knowledge-callout .knowledge-safe-rich p:last-child { margin-bottom:0; }
.knowledge-callout-success { color:#176b36; border-color:#a7ddb6; background:#effcf3; }
.knowledge-callout-success .knowledge-callout-icon { background:#d8f5e1; }
.knowledge-callout-danger { color:#9f2219; border-color:#f2b1ab; background:#fff2f1; }
.knowledge-callout-danger .knowledge-callout-icon { background:#fee4e2; }
.knowledge-callout-alert { color:#785000; border-color:#eed28a; background:#fff9e8; }
.knowledge-callout-alert .knowledge-callout-icon { background:#ffefbd; }
.knowledge-callout-info { color:#174f92; border-color:#b4d6f4; background:#eff8ff; }
.knowledge-callout-info .knowledge-callout-icon { background:#dcebff; }
.knowledge-callout-light { color:#3f4b5d; border-color:#d8dee7; background:#fbfcfe; }
.knowledge-callout-light .knowledge-callout-icon { background:#eef2f6; }
.knowledge-callout-dark { color:#f8fafc; border-color:#334155; background:#1f2937; }
.knowledge-callout-dark h4,.knowledge-callout-dark .knowledge-safe-rich h3,.knowledge-callout-dark .knowledge-safe-rich h4 { color:#fff; }
.knowledge-callout-dark .knowledge-callout-icon { color:#fff; background:#475569; }
.knowledge-callout-dark a { color:#bfdbfe; }
.knowledge-bullet-list { margin:8px 0; padding-left:23px; }
.knowledge-numbered-list { display:grid; gap:0; margin:10px 0; padding:0; list-style:none; counter-reset:knowledge-step; }
.knowledge-numbered-list li { position:relative; display:grid; grid-template-columns:38px minmax(0,1fr); gap:10px; align-items:start; min-height:48px; counter-increment:knowledge-step; }
.knowledge-numbered-list li::before { content:counter(knowledge-step); position:relative; z-index:2; display:grid; place-items:center; width:34px; height:34px; border-radius:999px; color:#fff; background:var(--primary); font-size:.78rem; font-weight:850; box-shadow:0 5px 12px rgba(36,72,180,.18); }
.knowledge-numbered-list li:not(:last-child)::after { content:""; position:absolute; left:16px; top:34px; bottom:0; width:2px; background:#d8e2f1; }
.knowledge-numbered-list li > span { padding:5px 0 13px; line-height:1.55; }


/* =========================================================
   VERSÃO 18.6 — LEMBRETES AVANÇADOS E TAREFAS ATRASADAS
========================================================= */
.today-item.overdue-task { border-color:#f1b9b5; border-left:5px solid #dc3f35; background:linear-gradient(135deg,#fff,#fff7f6); box-shadow:0 10px 26px rgba(180,38,28,.07); }
.today-item.overdue-task .today-check { color:#b42318; border-color:#efc7c3; background:#fff; }
.today-time.overdue { color:#b42318; font-weight:800; }
.today-overdue-badge { display:inline-flex; align-items:center; gap:5px; padding:4px 8px; border-radius:999px; color:#9f2119; background:#feeceb; font-size:.69rem; font-weight:800; }
.today-overdue-badge > span { display:grid; place-items:center; width:16px; height:16px; border-radius:50%; color:#fff; background:#d92d20; font-size:.65rem; }
.today-overdue-actions { display:flex; flex-wrap:wrap; gap:7px; margin-top:10px; }
.overdue-action { min-height:32px; padding:6px 10px; border:1px solid #e8c3bf; border-radius:9px; color:#8f2d26; background:#fff; font:inherit; font-size:.72rem; font-weight:750; cursor:pointer; }
.overdue-action.complete { color:#176b3a; border-color:#b9dec7; background:#f2fbf5; }
.overdue-action:hover { transform:translateY(-1px); box-shadow:0 5px 12px rgba(15,23,42,.06); }

.agenda-overdue-day { padding:13px; border:1px solid #f2cbc7; border-radius:17px; background:#fff8f7; }
.agenda-item-overdue { border-color:#efc3bf; border-left:4px solid #d92d20; background:#fff; }
.agenda-item-overdue .agenda-time { color:#b42318; }
.agenda-badge.overdue { color:#9f2119; background:#feeceb; }

.pending-reminders-panel { display:grid; gap:13px; margin-top:18px; padding:17px; border:1px solid #e7c88f; border-radius:18px; background:linear-gradient(135deg,#fffdf5,#fff8e8); }
.pending-reminders-panel[hidden] { display:none; }
.pending-reminders-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; }
.pending-reminders-heading h3 { margin:3px 0 4px; }
.pending-reminders-heading p { margin:0; color:#785621; font-size:.8rem; line-height:1.45; }
.pending-reminders-list { display:grid; gap:9px; }
.pending-reminder-item { display:grid; grid-template-columns:40px minmax(0,1fr) auto; align-items:center; gap:11px; padding:11px 12px; border:1px solid #edd8ad; border-radius:13px; background:rgba(255,255,255,.84); }
.pending-reminder-icon { display:grid; place-items:center; width:40px; height:40px; border-radius:12px; background:#fff3cb; }
.pending-reminder-item strong,.pending-reminder-item small { display:block; }
.pending-reminder-item small { margin-top:4px; color:#755b31; font-size:.73rem; }
.pending-reminder-actions { display:flex; align-items:center; gap:6px; }
.pending-reminder-actions button { min-height:34px; padding:7px 9px; font-size:.7rem; }

.reminder-preferences-grid { display:grid; grid-template-columns:1fr 1fr; gap:14px; margin-top:18px; }
.reminder-preferences-grid > label:not(.settings-reminder-toggle) { display:grid; gap:7px; color:var(--text-soft); font-size:.78rem; font-weight:700; }
.settings-reminder-toggle { grid-column:1/-1; margin:0; }
.reminder-boost-toggle { background:linear-gradient(135deg,#fbfcff,#f7f5ff); border-color:#ddd8ff; }
.reminder-boost-toggle small { max-width:62ch; }
.reminder-volume-field { grid-column:1/-1; }
.reminder-volume-field > span { display:flex; justify-content:space-between; gap:10px; }
.reminder-volume-field output { color:var(--primary); font-weight:800; }
.reminder-volume-field input[type="range"] { width:100%; accent-color:var(--primary); }
.reminder-audio-actions { display:flex; align-items:center; justify-content:space-between; gap:15px; margin-top:15px; padding-top:14px; border-top:1px solid #e9edf3; }
.reminder-audio-status { color:#805c1b; font-size:.78rem; line-height:1.45; }
.reminder-audio-status.ready { color:#177245; }
.reminder-audio-status.disabled { color:#64748b; }
.reminder-audio-status.blocked { color:#b42318; }
.reminder-settings-icon { background:#f1eeff; }

@media(max-width:760px) {
    .today-item.overdue-task { border-left-width:4px; }
    .today-overdue-actions { display:grid; grid-template-columns:1fr 1fr; }
    .pending-reminders-heading { display:grid; }
    .pending-reminders-heading button { width:100%; }
    .pending-reminder-item { grid-template-columns:38px minmax(0,1fr); }
    .pending-reminder-actions { grid-column:1/-1; display:grid; grid-template-columns:1fr 1fr auto; }
    .reminder-preferences-grid { grid-template-columns:1fr; }
    .settings-reminder-toggle,.reminder-volume-field { grid-column:auto; }
    .reminder-audio-actions { align-items:stretch; flex-direction:column; }
    .reminder-audio-actions button { width:100%; }
}

/* ===== Ajuda do ROTINA · Versão 18.6 ===== */
.help-header { align-items: flex-start; }
.help-search-panel {
    display: grid;
    grid-template-columns: minmax(220px, .8fr) minmax(320px, 1.45fr) auto;
    gap: 18px;
    align-items: center;
    margin-bottom: 28px;
    padding: 22px;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 22px;
    background: linear-gradient(135deg, rgba(91,92,226,.08), rgba(255,255,255,.98) 56%, rgba(46,196,182,.07));
    box-shadow: 0 12px 32px rgba(15,23,42,.055);
}
.help-search-intro { display:flex; gap:14px; align-items:center; min-width:0; }
.help-main-icon {
    display:grid; place-items:center; width:52px; height:52px; flex:0 0 52px;
    border-radius:17px; color:#fff; font-size:1.55rem; font-weight:900;
    background:linear-gradient(145deg,#5856d6,#7472ec); box-shadow:0 10px 24px rgba(88,86,214,.22);
}
.help-search-intro strong { display:block; font-size:1.05rem; color:#172033; }
.help-search-intro p { margin:4px 0 0; color:#64748b; line-height:1.45; font-size:.9rem; }
.help-search-panel .help-search { margin:0; }
.help-search-panel .knowledge-stats { white-space:nowrap; }
.help-sections { margin-bottom:30px; }
.help-section-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; }
.help-section-card {
    position:relative; display:grid; grid-template-columns:44px minmax(0,1fr) auto; gap:12px; align-items:center;
    padding:16px; min-height:108px; text-align:left; border:1px solid #e0e6f0; border-radius:18px;
    background:#fff; color:#172033; cursor:pointer; transition:transform .18s ease,border-color .18s ease,box-shadow .18s ease,background .18s ease;
}
.help-section-card:hover { transform:translateY(-2px); border-color:#b9baf3; box-shadow:0 12px 24px rgba(15,23,42,.07); }
.help-section-card.active { border-color:#6968e5; background:#f6f6ff; box-shadow:0 0 0 3px rgba(105,104,229,.09); }
.help-section-icon { display:grid; place-items:center; width:44px; height:44px; border-radius:14px; background:#eff0ff; color:#5554c9; }
.help-section-icon svg { width:21px; height:21px; fill:currentColor; }
.help-section-card strong { display:block; font-size:.96rem; line-height:1.3; }
.help-section-card small { display:block; margin-top:5px; color:#64748b; line-height:1.35; font-size:.78rem; font-weight:500; }
.help-section-card em { align-self:start; min-width:24px; padding:4px 7px; border-radius:999px; background:#f1f5f9; color:#64748b; text-align:center; font-size:.72rem; font-style:normal; font-weight:800; }
.help-results { scroll-margin-top:24px; }
.help-filter-bar { display:flex; gap:8px; overflow-x:auto; padding:2px 0 14px; scrollbar-width:thin; }
.help-filter { flex:0 0 auto; border:1px solid #dce3ee; border-radius:999px; background:#fff; color:#526076; padding:9px 14px; font-weight:750; cursor:pointer; }
.help-filter:hover,.help-filter.active { border-color:#6665df; background:#efefff; color:#4b4ac1; }
.help-article-list { display:grid; gap:12px; }
.help-article { overflow:hidden; border:1px solid #dfe5ef; border-radius:18px; background:#fff; box-shadow:0 8px 22px rgba(15,23,42,.035); }
.help-article.open { border-color:#bfc1ee; box-shadow:0 11px 28px rgba(75,74,193,.075); }
.help-article-toggle { width:100%; display:grid; grid-template-columns:minmax(0,1fr) 38px; gap:16px; align-items:center; padding:18px 20px; border:0; background:transparent; text-align:left; cursor:pointer; color:inherit; }
.help-article-toggle:hover { background:#fafbff; }
.help-article-copy small { display:block; margin-bottom:5px; color:#6665d6; font-size:.72rem; font-weight:850; letter-spacing:.055em; text-transform:uppercase; }
.help-article-copy strong { display:block; color:#172033; font-size:1.03rem; line-height:1.45; }
.help-article-copy em { display:block; margin-top:5px; color:#64748b; font-size:.87rem; font-style:normal; line-height:1.45; }
.help-toggle-symbol { display:grid; place-items:center; width:34px; height:34px; border-radius:11px; background:#f0f1ff; color:#5554c9; font-size:1.35rem; font-weight:700; }
.help-article-body { border-top:1px solid #edf0f5; padding:0 20px 20px; }
.help-article-content { max-width:880px; padding-top:17px; color:#334155; line-height:1.72; }
.help-article-content p { margin:0 0 14px; }
.help-steps { counter-reset:help-step; display:grid; gap:12px; margin:18px 0; padding:0; list-style:none; }
.help-steps li { counter-increment:help-step; display:grid; grid-template-columns:34px minmax(0,1fr); gap:12px; align-items:start; }
.help-steps li::before { content:counter(help-step); display:grid; place-items:center; width:30px; height:30px; border-radius:50%; background:#5d5cda; color:#fff; font-size:.78rem; font-weight:900; box-shadow:0 6px 14px rgba(93,92,218,.18); }
.help-steps li span { padding-top:3px; }
.help-action-button { margin-top:4px; border:0; border-radius:11px; padding:10px 15px; background:#5b5ae0; color:#fff; font-weight:800; cursor:pointer; }
.help-action-button:hover { background:#4948c4; }
.help-empty { margin-top:14px; }
.help-knowledge-bridge { display:grid; grid-template-columns:48px minmax(0,1fr) auto; gap:15px; align-items:center; margin-top:28px; padding:20px; border:1px solid #d8e6ec; border-radius:20px; background:linear-gradient(135deg,#f4fbfc,#fff); }
.help-bridge-icon { display:grid; place-items:center; width:48px; height:48px; border-radius:15px; background:#dff4f2; color:#167f78; font-size:1.35rem; font-weight:900; }
.help-knowledge-bridge strong { color:#172033; }
.help-knowledge-bridge p { margin:4px 0 0; color:#64748b; line-height:1.45; }
@media (max-width:1150px) { .help-section-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.help-search-panel{grid-template-columns:1fr 1.4fr}.help-search-panel .knowledge-stats{grid-column:1/-1} }
@media (max-width:700px) {
    .help-search-panel { grid-template-columns:1fr; padding:17px; gap:15px; }
    .help-search-panel .knowledge-stats { grid-column:auto; white-space:normal; }
    .help-section-grid { grid-template-columns:1fr; }
    .help-section-card { min-height:auto; }
    .help-article-toggle { padding:16px; gap:10px; }
    .help-article-body { padding:0 16px 17px; }
    .help-article-copy strong { font-size:.98rem; }
    .help-knowledge-bridge { grid-template-columns:44px minmax(0,1fr); }
    .help-knowledge-bridge button { grid-column:1/-1; width:100%; }
}
.help-featured { margin-bottom:28px; }
.help-featured-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:13px; }
.help-featured-card { display:flex; flex-direction:column; align-items:flex-start; min-height:154px; padding:17px; border:1px solid #dcdef4; border-radius:18px; background:linear-gradient(145deg,#fff,#f7f7ff); text-align:left; cursor:pointer; color:#172033; transition:.18s ease; }
.help-featured-card:hover { transform:translateY(-2px); border-color:#aeb0e9; box-shadow:0 12px 25px rgba(75,74,193,.08); }
.help-featured-card>span { display:grid; place-items:center; width:38px; height:38px; border-radius:12px; background:#ececff; color:#5554ca; margin-bottom:12px; }
.help-featured-card svg { width:18px; height:18px; fill:currentColor; }
.help-featured-card small { color:#6665d6; font-weight:850; text-transform:uppercase; letter-spacing:.05em; font-size:.68rem; }
.help-featured-card strong { margin-top:5px; line-height:1.4; }
.help-featured-card em { margin-top:auto; padding-top:12px; color:#5554ca; font-size:.78rem; font-style:normal; font-weight:800; }
@media(max-width:900px){.help-featured-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:560px){.help-featured-grid{grid-template-columns:1fr}.help-featured-card{min-height:135px}}

/* ===== Versão 18.7 · Backup pessoal e instalação PWA ===== */
.backup-settings-icon,
.install-settings-icon {
    background: #eef0ff;
    color: #5148d8;
    font-weight: 900;
}

.personal-backup-status {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    margin: 18px 0;
    padding: 14px 16px;
    border: 1px solid #e1e5ef;
    border-radius: 14px;
    background: #f8f9fc;
}
.personal-backup-status strong { color: var(--text); }
.personal-backup-status span { color: var(--muted); font-size: .86rem; text-align: right; }
.personal-backup-actions,
.pwa-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.settings-footnote {
    margin: 14px 0 0;
    color: var(--muted);
    font-size: .82rem;
    line-height: 1.55;
}

.pwa-heading-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}
.pwa-heading-line h2 { margin: 0; }
.pwa-status-badge {
    display: inline-flex;
    align-items: center;
    min-height: 25px;
    padding: 4px 9px;
    border-radius: 999px;
    background: #edf0f6;
    color: #566176;
    font-size: .7rem;
    font-weight: 900;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.pwa-status-badge.available { background: #e8f7ef; color: #18794e; }
.pwa-status-badge.installed { background: #e8edff; color: #4338ca; }
.pwa-benefits {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 18px 0;
}
.pwa-benefits span {
    padding: 7px 10px;
    border: 1px solid #e0e5ef;
    border-radius: 999px;
    background: #fafbfe;
    color: #556176;
    font-size: .78rem;
    font-weight: 700;
}
.pwa-benefits span::before { content: "✓"; margin-right: 6px; color: #4f46e5; }
.pwa-benefits span.offline { background: #fff7e8; color: #8a4b07; }
.pwa-benefits span.offline::before { content: "○"; color: #c27400; }
.pwa-update-button { box-shadow: 0 0 0 4px rgba(79,70,229,.1); }

.import-backup-modal { width: min(720px, calc(100vw - 32px)); }
.import-backup-metadata { margin: 0 0 16px; color: var(--muted); }
.import-backup-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 22px;
}
.import-backup-summary > div {
    display: grid;
    gap: 3px;
    padding: 14px;
    border: 1px solid #e1e6f0;
    border-radius: 14px;
    background: #f8f9fc;
    text-align: center;
}
.import-backup-summary strong { font-size: 1.35rem; color: #3730a3; }
.import-backup-summary span { color: var(--muted); font-size: .76rem; }
.import-mode-options {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    border: 0;
}
.import-mode-options legend { margin-bottom: 10px; font-weight: 800; }
.import-mode-options label {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding: 14px;
    border: 1px solid #dde3ed;
    border-radius: 14px;
    cursor: pointer;
}
.import-mode-options label:has(input:checked) { border-color: #7c73ee; background: #f5f3ff; }
.import-mode-options input { margin-top: 3px; accent-color: #5b5ce2; }
.import-mode-options span { display: grid; gap: 3px; }
.import-mode-options small { color: var(--muted); line-height: 1.45; }
.import-replace-warning {
    margin-top: 14px;
    padding: 13px 15px;
    border: 1px solid #ffd5cc;
    border-radius: 12px;
    background: #fff4f1;
    color: #9e2f20;
    line-height: 1.5;
}
.pwa-instructions-body { color: var(--text); line-height: 1.6; }
.pwa-instruction-list { display: grid; gap: 11px; margin: 0; padding-left: 24px; }
.pwa-instructions-body p { margin: 16px 0 0; color: var(--muted); }

@media (max-width: 640px) {
    .personal-backup-status { align-items: flex-start; flex-direction: column; }
    .personal-backup-status span { text-align: left; }
    .personal-backup-actions > button,
    .pwa-actions > button { width: 100%; }
    .import-backup-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
