/* ==========================================================================
   VOEALTUM — Missão (ciclo / checklist)
   Tokens: funciona em light-mode e dark-mode
   ========================================================================== */

#missionCycleModal.overlay.show {
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
}

.me-modal {
    width: min(560px, 100%);
    max-height: min(88vh, 820px);
    overflow-x: hidden;
    overflow-y: auto;
    padding: 28px 28px 24px !important;
    color: var(--text-main);
}

.me-close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 5;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0 !important;
    border: 1px solid var(--border-card);
    border-radius: 50%;
    background: var(--bg-elevated);
    color: var(--text-muted);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    letter-spacing: 0;
    text-transform: none;
}

.me-close:hover {
    color: var(--ouro);
    border-color: color-mix(in srgb, var(--ouro) 45%, transparent);
}

.me-modal-head {
    padding-right: 40px;
    margin-bottom: 20px;
}

.me-phase {
    margin: 0 0 8px;
    font-family: var(--font-ui, "Oswald", sans-serif);
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ouro);
}

.me-modal-head h2 {
    margin: 0 0 8px;
    font-family: var(--font-display, "Cinzel", serif);
    font-size: clamp(1.15rem, 2.4vw, 1.4rem);
    line-height: 1.3;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0.02em;
    color: var(--text-main);
}

.me-modal-sub {
    margin: 0;
    font-size: 13px;
    line-height: 1.45;
    color: var(--text-muted);
}

.me-progress {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0 0 22px;
    padding: 14px 16px;
    border-radius: var(--radius-lg, 12px);
    background: var(--bg-elevated);
    border: 1px solid var(--border-card);
}

.me-progress-label {
    font-family: var(--font-ui, "Oswald", sans-serif);
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.me-progress-label strong {
    color: var(--ouro);
    font-weight: 500;
}

.me-steps {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.me-step {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--text-muted) 35%, transparent);
    border: none;
    font-size: 0;
    line-height: 0;
    overflow: hidden;
    color: transparent;
    padding: 0;
}

.me-step.done {
    background: color-mix(in srgb, var(--accent) 70%, transparent);
}

.me-step.active {
    width: 22px;
    border-radius: 999px;
    background: var(--ouro) !important;
    color: transparent !important;
    border: none !important;
}

.me-steps--fases .me-step {
    width: auto;
    height: auto;
    min-height: 28px;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 11px;
    line-height: 1.2;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-family: Oswald, sans-serif;
    color: var(--text-muted);
    overflow: visible;
    background: transparent;
    border: 1px solid rgba(138, 109, 47, 0.35);
}

.me-steps--fases .me-step.done {
    color: #7dcea0;
    border-color: rgba(125, 206, 160, 0.4);
}

.me-steps--fases .me-step.active {
    width: auto;
    color: #f4e3a8 !important;
    background: rgba(60, 44, 8, 0.55) !important;
    border-color: #d4ae57 !important;
}

.me-habito-label {
    display: block;
    margin: 12px 0 8px;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.me-habito-label textarea {
    display: block;
    width: 100%;
    margin-top: 6px;
    padding: 10px 12px;
    font-family: Merriweather, serif;
    font-size: 14px;
    text-transform: none;
    letter-spacing: 0;
    border-radius: 4px;
    border: 1px solid var(--border-card);
    background: var(--bg-base);
    color: var(--text-main);
}

.me-check-lead {
    margin: 0 0 16px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-muted);
}

.me-check-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0 0 22px;
}

.me-check-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin: 0;
    padding: 14px 16px;
    border-radius: var(--radius-lg, 12px);
    border: 1px solid var(--border-card) !important;
    background: var(--bg-elevated) !important;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.me-check-item:hover {
    border-color: color-mix(in srgb, var(--ouro) 40%, var(--border-card)) !important;
    background: color-mix(in srgb, var(--ouro) 8%, var(--bg-elevated)) !important;
}

.me-check-item:has(.me-check:checked) {
    border-color: color-mix(in srgb, var(--ouro) 50%, var(--border-card)) !important;
    background: color-mix(in srgb, var(--ouro) 10%, var(--bg-elevated)) !important;
}

.me-check-item .me-check {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: var(--ouro);
    cursor: pointer;
}

.me-check-item span {
    flex: 1;
    font-family: var(--font-body, "Merriweather", Georgia, serif);
    font-size: 14px;
    line-height: 1.45;
    color: var(--text-main) !important;
    text-transform: none;
    letter-spacing: 0;
}

.me-cta {
    display: block;
    width: 100%;
    margin-top: 4px;
    padding: 14px 18px;
    border: none;
    border-radius: 10px;
    background: var(--ouro);
    color: #14110a;
    font-family: var(--font-ui, "Oswald", sans-serif);
    font-size: 13px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    cursor: pointer;
    transition: filter 0.2s ease;
}

.me-cta:hover:not(:disabled):not(.is-disabled) {
    filter: brightness(1.06);
}

.me-cta:disabled,
.me-cta.is-disabled {
    opacity: 0.45;
    cursor: not-allowed;
    filter: none;
}

/* —— Flow (compartilhado) —— */
body.flow-active .me-modal.flow-modal > .me-modal-head,
body.flow-active .me-modal.flow-modal > .me-progress {
    display: none;
}

body.flow-active .me-modal.flow-modal {
    padding-top: 24px !important;
}

body.flow-active .flow-modal .me-close {
    top: 14px;
    right: 14px;
}

.flow-focus-header {
    margin-bottom: 18px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-card);
}

.flow-focus-eyebrow {
    margin: 0 0 6px;
    font-size: 11px;
    letter-spacing: 0.12em;
    color: var(--accent);
}

.flow-focus-objective {
    margin: 0 0 10px;
    font-size: clamp(1.05rem, 2.2vw, 1.3rem);
    line-height: 1.35;
    text-transform: none;
    letter-spacing: 0.01em;
    color: var(--text-main);
}

.flow-focus-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 11px;
    text-transform: none;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.flow-progress {
    height: 4px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--accent) 14%, transparent);
    overflow: hidden;
}

.flow-progress-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--accent), var(--ouro));
}

.flow-chrome-bar {
    gap: 12px;
    padding: 12px 18px;
    background: var(--glass-bg);
    border-bottom: 1px solid var(--border-card);
    color: var(--text-main);
}

.flow-chrome-eyebrow {
    color: var(--accent);
}

.flow-chrome-mission {
    font-size: 13px;
    line-height: 1.3;
    text-transform: none;
    max-width: 42vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-main);
}

.flow-chrome-center {
    color: var(--text-muted);
}

.flow-chrome-etapa {
    color: var(--ouro);
}

.flow-chrome-pause {
    border: 1px solid var(--border-card);
    color: var(--text-muted);
    background: transparent;
}

.flow-chrome-pause:hover {
    border-color: color-mix(in srgb, var(--accent) 45%, var(--border-card));
    color: var(--text-main);
}

.flow-secondary-wrap {
    border-color: var(--border-card);
}

.flow-secondary-summary {
    color: var(--text-muted);
}

/* —— Light mode —— */
body.light-mode .me-close:hover {
    color: var(--ouro);
    background: color-mix(in srgb, var(--ouro) 10%, #fff);
}

body.light-mode .me-progress {
    background: #f7f8fa;
    border-color: rgba(12, 43, 91, 0.1);
}

body.light-mode .me-check-item {
    background: #f7f8fa !important;
    border-color: rgba(12, 43, 91, 0.1) !important;
}

body.light-mode .me-check-item:hover,
body.light-mode .me-check-item:has(.me-check:checked) {
    background: color-mix(in srgb, var(--ouro) 12%, #fff) !important;
    border-color: color-mix(in srgb, var(--ouro) 40%, rgba(12, 43, 91, 0.12)) !important;
}

body.light-mode .me-step {
    background: rgba(12, 43, 91, 0.18);
}

body.light-mode .me-cta {
    color: #1a150c;
}

body.light-mode .flow-chrome-bar {
    background: rgba(255, 255, 255, 0.96);
    border-bottom-color: rgba(12, 43, 91, 0.1);
}

body.light-mode.flow-active #missionCycleModal {
    background: rgba(244, 246, 248, 0.88);
}

body.light-mode .flow-focus-header {
    border-bottom-color: rgba(12, 43, 91, 0.1);
}

/* —— Dark mode —— */
body.dark-mode .me-progress {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.07);
}

body.dark-mode .me-check-item {
    background: rgba(255, 255, 255, 0.03) !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

body.dark-mode .me-check-item:hover,
body.dark-mode .me-check-item:has(.me-check:checked) {
    background: rgba(212, 174, 87, 0.08) !important;
    border-color: rgba(212, 174, 87, 0.4) !important;
}

body.dark-mode .flow-chrome-bar {
    background: rgba(8, 12, 20, 0.96);
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

body.dark-mode.flow-active #missionCycleModal {
    background: rgba(4, 8, 18, 0.88);
}

@media (max-width: 640px) {
    .me-modal {
        padding: 22px 18px 20px !important;
    }

    .flow-chrome-mission {
        max-width: 58vw;
    }
}

body.co-calm .me-modal--calm .co-focus-cta {
    width: 100%;
    margin-top: 16px;
}

body.co-calm .me-modal--calm .me-more {
    margin-top: 16px;
}

body.co-calm .me-modal--calm .me-hint {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0 0 8px;
}

.me-runway {
    height: 3px;
    margin: 12px 0 14px;
    background: rgba(212, 174, 87, 0.18);
}
.me-runway i {
    display: block;
    height: 100%;
    width: var(--me-p, 0%);
    background: #d4ae57;
}
.me-steps--fases .me-step b {
    margin-right: 6px;
    color: #d4ae57;
    font-weight: 500;
}
body.co-calm .me-modal--calm .me-objetivo {
    margin: 0 0 16px;
    padding-left: 12px;
    border-left: 2px solid #d4ae57;
    font-family: Merriweather, Georgia, serif;
    line-height: 1.5;
}
body.co-calm .me-modal--calm .me-deck-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 8px;
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #d4ae57;
}
body.co-calm .me-modal--calm .me-deck-top b {
    font-family: Cinzel, serif;
    font-weight: 400;
    letter-spacing: 0.04em;
    color: #f6f3ec;
}
body.co-calm .me-modal--calm .me-deck-track {
    height: 3px;
    margin-bottom: 14px;
    background: rgba(212, 174, 87, 0.16);
}
body.co-calm .me-modal--calm .me-deck-track i {
    display: block;
    height: 100%;
    background: #d4ae57;
}
body.co-calm .me-modal--calm .me-check-item span b {
    display: block;
    margin-bottom: 2px;
    font-family: Cinzel, serif;
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.14em;
    color: #d4ae57;
}
body.co-calm .me-modal--calm .me-check-item .me-check {
    appearance: none;
    width: 22px;
    height: 22px;
    margin-top: 4px;
    border: 1.5px solid #d4ae57;
    border-radius: 50%;
    background: transparent;
}
body.co-calm .me-modal--calm .me-check-item.is-on {
    border-color: #d4ae57 !important;
    background: rgba(212, 174, 87, 0.1) !important;
}
body.co-calm .me-modal--calm .me-check-item.is-on .me-check {
    background: #d4ae57;
    box-shadow: inset 0 0 0 5px #12160f;
}
body.co-calm .me-modal--calm .me-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 12px;
}
body.co-calm .me-modal--calm .me-chip {
    padding: 8px 12px;
    border: 1px solid rgba(212, 174, 87, 0.4);
    background: transparent;
    color: #f6f3ec;
    font-family: Cinzel, serif;
    font-size: 13px;
    letter-spacing: 0.06em;
    cursor: pointer;
}
body.co-calm .me-modal--calm .me-chip.is-on {
    background: #d4ae57;
    color: #14120c;
    border-color: #d4ae57;
}
.me-formato-native {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}
body.co-calm .me-modal--calm .me-log {
    width: 100%;
    box-sizing: border-box;
    padding: 12px;
    border: 1px solid rgba(212, 174, 87, 0.35);
    border-left-width: 3px;
    background: rgba(0, 0, 0, 0.28);
    color: #f6f3ec;
    font-family: Merriweather, Georgia, serif;
    font-size: 14px;
}
body.co-calm .me-modal--calm #meDeckSend.is-ready {
    box-shadow: 0 0 0 1px #d4ae57, 0 8px 24px rgba(212, 174, 87, 0.25);
}
.me-file-name {
    margin: 8px 0 12px;
    font-family: Merriweather, Georgia, serif;
    font-size: 13px;
    color: #c5ced8;
}
body.co-calm .me-modal--calm .me-fase {
    padding-top: 4px;
}
body.co-calm .me-modal--calm .me-fase .co-focus-text {
    margin: 0 0 14px;
    padding-left: 12px;
    border-left: 2px solid #d4ae57;
    font-family: Merriweather, Georgia, serif;
    line-height: 1.5;
}
body.co-calm .me-modal--calm .me-fase .me-cons-kicker,
body.co-calm .me-modal--calm .me-fase .me-carousel-when {
    color: #d4ae57;
    letter-spacing: 0.12em;
}

.me-modal-sub {
    font-size: 15px !important;
    line-height: 1.5;
}

.me-progress-label {
    font-size: 13px !important;
}

.me-field .me-label,
.me-label {
    display: block;
    font-size: 13px;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.me-field p,
.me-modal .co-focus-text {
    font-size: 16px;
    line-height: 1.55;
    color: var(--text-main);
}

.me-cons-kicker {
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ouro);
    margin: 0 0 12px;
}

.me-carousel {
    text-align: left;
}

.me-carousel-when {
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin: 0 0 8px;
}

.me-carousel-dots {
    display: flex;
    gap: 8px;
    margin: 12px 0 16px;
}

.me-carousel-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--text-muted) 40%, transparent);
}

.me-carousel-dot.is-on {
    background: var(--ouro);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--ouro) 25%, transparent);
}

.me-carousel-dot.is-done {
    background: var(--success, #3dcc7a);
}

.me-cons-when {
    font-size: 12px;
    color: var(--text-muted);
}

.me-cons-item p {
    font-size: 14px;
    margin: 4px 0;
}

.me-cons-ok { color: var(--success); font-size: 12px; }
.me-cons-wait { color: var(--text-muted); font-size: 12px; }
