/* ===== Sinutervisepartner Premium kiht ===== */
:root {
    --gold: #C9A227;
    --gold-soft: #F6EBC8;
    --pm-grad: linear-gradient(135deg, #5B8A72 0%, #3D6B54 60%, #2E5442 100%);
}
body.dark-mode { --gold: #E0BE52; --gold-soft: #3A3420; }

/* Hub avalehel */
.pm-hub {
    background: var(--card);
    border-radius: 20px;
    padding: 18px;
    margin: 0 0 18px;
    box-shadow: 0 4px 15px var(--shadow);
    border: 1px solid var(--gold-soft);
}
/* Uue programmi esiletõste hubi ülaosas */
.pm-feat {
    width: 100%; display: flex; align-items: center; gap: 12px; text-align: left;
    border: none; cursor: pointer; font-family: inherit; color: #fff;
    background: var(--pm-grad); border-radius: 16px; padding: 14px 16px; margin: 0 0 16px;
    box-shadow: 0 6px 18px rgba(46, 84, 66, .28); transition: transform .15s;
}
.pm-feat:active { transform: scale(.98); }
.pm-feat-ic { font-size: 1.9rem; flex: none; }
.pm-feat-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pm-feat-tag { font-size: .62rem; font-weight: 700; letter-spacing: .08em; background: rgba(255,255,255,.22); align-self: flex-start; padding: 2px 8px; border-radius: 99px; }
.pm-feat-t { font-weight: 600; font-size: 1rem; line-height: 1.25; }
.pm-feat-s { font-size: .78rem; opacity: .85; }
.pm-feat-go { flex: none; font-weight: 600; font-size: .85rem; background: rgba(255,255,255,.18); padding: 7px 11px; border-radius: 10px; white-space: nowrap; }
.pm-hub-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; gap: 10px; }
.pm-hub-head h3 { color: var(--primary); font-weight: 500; font-size: 1.05rem; }
.pm-badge {
    font-size: .7rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
    background: var(--gold-soft); color: #8A6B10; padding: 4px 10px; border-radius: 999px; white-space: nowrap;
}
body.dark-mode .pm-badge { color: var(--gold); }
.pm-badge.on { background: var(--primary); color: #fff; }
.pm-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pm-tile {
    position: relative; text-align: left; border: none; cursor: pointer; font-family: inherit;
    background: var(--bg); color: var(--text); border-radius: 14px; padding: 14px 12px; min-height: 92px;
    transition: transform .2s ease, box-shadow .2s ease;
}
.pm-tile:hover { transform: translateY(-2px); box-shadow: 0 4px 12px var(--shadow-strong); }
.pm-tile .ic { font-size: 1.4rem; display: block; margin-bottom: 6px; }
.pm-tile .t { font-weight: 600; font-size: .9rem; display: block; }
.pm-tile .s { font-size: .75rem; color: var(--text-light); display: block; margin-top: 2px; line-height: 1.3; }
.pm-tile .lock { position: absolute; top: 10px; right: 10px; font-size: .8rem; opacity: .75; }
.pm-hub-cta {
    margin-top: 12px; width: 100%; border: none; cursor: pointer; font-family: inherit; font-weight: 600;
    padding: 12px; border-radius: 12px; background: var(--pm-grad); color: #fff; font-size: .95rem;
}

/* Lehed */
.pm-page { display: none; animation: fadeIn .35s ease; }
.pm-page.active { display: block; }
.pm-page .stats-header h2 { color: var(--primary); font-weight: 400; font-size: 1.35rem; }
.pm-sub { color: var(--text-light); font-size: .9rem; margin: -8px 0 18px; line-height: 1.5; }
.pm-card { background: var(--card); border-radius: 18px; padding: 18px; margin-bottom: 14px; box-shadow: 0 4px 15px var(--shadow); }
.pm-card h4 { color: var(--primary); font-weight: 600; margin-bottom: 8px; font-size: 1rem; }
.pm-card p { color: var(--text); line-height: 1.6; font-size: .93rem; }
.pm-muted { color: var(--text-muted) !important; font-size: .8rem !important; }
.pm-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); font-weight: 600; margin: 14px 0 4px; display: block; }
.pm-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pm-btn {
    border: none; cursor: pointer; font-family: inherit; font-weight: 500; font-size: .9rem;
    padding: 10px 16px; border-radius: 10px; background: var(--primary); color: #fff;
}
.pm-btn.ghost { background: var(--bg); color: var(--primary); }
.pm-btn.small { padding: 6px 10px; font-size: .8rem; }
.pm-btn.danger { background: transparent; color: var(--heart); }
.pm-btn:disabled { opacity: .5; cursor: default; }
.pm-input, .pm-textarea {
    width: 100%; font-family: inherit; font-size: .95rem; color: var(--text); background: var(--bg);
    border: 1.5px solid transparent; border-radius: 10px; padding: 10px 12px; outline: none;
}
.pm-input:focus, .pm-textarea:focus { border-color: var(--primary-light); }
.pm-textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
.pm-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pm-chip {
    border: 1px solid var(--shadow-strong); background: transparent; color: var(--text); font-family: inherit;
    font-size: .8rem; padding: 6px 10px; border-radius: 999px; cursor: pointer;
}
.pm-chip.on { background: var(--primary); color: #fff; border-color: var(--primary); }
.pm-tabs { display: flex; gap: 6px; background: var(--card); padding: 5px; border-radius: 12px; margin-bottom: 14px; box-shadow: 0 2px 8px var(--shadow); }
.pm-tabs button { flex: 1; border: none; background: transparent; padding: 10px; border-radius: 9px; font-family: inherit; color: var(--text-light); cursor: pointer; font-size: .9rem; }
.pm-tabs button.on { background: var(--primary); color: #fff; }
.pm-progress { height: 8px; background: var(--bg); border-radius: 999px; overflow: hidden; }
.pm-progress > div { height: 100%; background: var(--primary); border-radius: 999px; transition: width .4s ease; }
.pm-empty { text-align: center; color: var(--text-muted); padding: 24px 10px; font-size: .9rem; }

/* Akadeemia */
.pm-prog { display: flex; gap: 14px; align-items: flex-start; cursor: pointer; }
.pm-prog .ic { font-size: 2rem; line-height: 1; }
.pm-prog .body { flex: 1; min-width: 0; }
.pm-prog .meta { font-size: .78rem; color: var(--text-muted); margin: 2px 0 8px; }
.pm-prog.soon { opacity: .55; cursor: default; }
.pm-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin: 12px 0; }
.pm-day {
    aspect-ratio: 1; border: none; border-radius: 10px; background: var(--bg); color: var(--text);
    font-family: inherit; font-weight: 600; cursor: pointer; font-size: .9rem;
}
.pm-day.done { background: var(--primary); color: #fff; }
.pm-day.current { outline: 2px solid var(--primary); }
.pm-day.locked { opacity: .4; cursor: default; }
.pm-step { border-left: 3px solid var(--primary-light); padding-left: 12px; margin: 14px 0; }
.pm-step b { display: block; color: var(--primary); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px; }

/* Päevik */
.pm-entry { border-top: 1px solid var(--bg); padding: 12px 0; }
.pm-entry:first-child { border-top: none; }
.pm-entry .d { font-size: .75rem; color: var(--text-muted); display: flex; justify-content: space-between; gap: 8px; }
.pm-entry .q { font-size: .82rem; color: var(--primary); margin: 4px 0; font-style: italic; }
.pm-entry .x { white-space: pre-wrap; line-height: 1.55; font-size: .92rem; color: var(--text); }
.pm-icon-btn { border: none; background: none; cursor: pointer; font-size: .95rem; padding: 2px 4px; color: var(--text-light); }

/* Harjumused */
.pm-habit { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--bg); }
.pm-habit:first-child { border-top: none; }
.pm-habit .n { flex: 1; font-size: .93rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.pm-week { display: flex; gap: 4px; }
.pm-dot { width: 22px; height: 22px; border-radius: 50%; background: var(--bg); border: none; font-size: .6rem; color: var(--text-muted); cursor: pointer; font-family: inherit; padding: 0; }
.pm-dot.on { background: var(--primary); color: #fff; }
.pm-dot.today { outline: 2px solid var(--primary-light); }
.pm-goal-step { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: .9rem; }
.pm-goal-step.done span { text-decoration: line-through; color: var(--text-muted); }

/* Statistika */
.pm-stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pm-stat { background: var(--bg); border-radius: 12px; padding: 12px 8px; text-align: center; }
.pm-stat .v { font-size: 1.35rem; font-weight: 600; color: var(--primary); }
.pm-stat .l { font-size: .7rem; color: var(--text-light); margin-top: 2px; line-height: 1.25; }
.pm-chart svg { width: 100%; height: auto; display: block; }
.pm-wd { display: flex; align-items: flex-end; gap: 6px; height: 110px; }
.pm-wd > div { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.pm-wd .b { width: 100%; max-width: 28px; background: var(--primary-light); border-radius: 5px 5px 0 0; min-height: 2px; }
.pm-wd .k { font-size: .7rem; color: var(--text-muted); }

/* Paywall */
.pm-overlay {
    position: fixed; inset: 0; background: rgba(20, 30, 26, .55); z-index: 60000;
    display: none; align-items: flex-end; justify-content: center; padding: 0;
}
.pm-overlay.show { display: flex; animation: fadeIn .25s ease; }
.pm-sheet {
    background: var(--card); color: var(--text); width: 100%; max-width: 480px; max-height: 92vh; overflow-y: auto;
    border-radius: 24px 24px 0 0; padding: 26px 22px calc(22px + env(safe-area-inset-bottom));
    position: relative; animation: pmUp .3s ease;
}
@media (min-width: 600px) { .pm-overlay { align-items: center; padding: 20px; } .pm-sheet { border-radius: 24px; } }
@keyframes pmUp { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.pm-x { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border-radius: 50%; border: none; background: var(--bg); color: var(--text); font-size: 1.2rem; cursor: pointer; }
.pm-sheet h2 { font-weight: 500; font-size: 1.4rem; color: var(--primary-dark); margin: 4px 30px 6px 0; line-height: 1.3; }
body.dark-mode .pm-sheet h2 { color: var(--primary); }
.pm-sheet .lead { color: var(--text-light); font-size: .92rem; line-height: 1.5; margin-bottom: 16px; }
.pm-benefits { list-style: none; margin: 0 0 18px; padding: 0; }
.pm-benefits li { display: flex; gap: 10px; padding: 6px 0; font-size: .92rem; line-height: 1.4; }
.pm-benefits li::before { content: "✓"; color: var(--primary); font-weight: 700; }
.pm-plans { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.pm-plan {
    position: relative; border: 2px solid var(--bg); background: var(--bg); border-radius: 14px; padding: 14px 12px;
    text-align: left; cursor: pointer; font-family: inherit; color: var(--text);
}
.pm-plan.on { border-color: var(--primary); background: var(--card); }
.pm-plan .pl { font-size: .8rem; color: var(--text-light); }
.pm-plan .pp { font-size: 1.3rem; font-weight: 600; margin: 2px 0; }
.pm-plan .pn { font-size: .72rem; color: var(--primary); }
.pm-plan .tag { position: absolute; top: -10px; right: 10px; background: var(--gold); color: #fff; font-size: .65rem; font-weight: 700; padding: 3px 8px; border-radius: 999px; }
.pm-cta { width: 100%; border: none; cursor: pointer; font-family: inherit; font-weight: 600; font-size: 1rem; padding: 15px; border-radius: 14px; background: var(--pm-grad); color: #fff; }
.pm-fine { font-size: .75rem; color: var(--text-muted); text-align: center; margin-top: 10px; line-height: 1.5; }
.pm-demo-note { background: var(--gold-soft); color: #6E560E; font-size: .8rem; border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; line-height: 1.45; }
body.dark-mode .pm-demo-note { color: var(--gold); }

/* Seaded */
.pm-plan-box { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: var(--bg); padding: 12px 14px; border-radius: 12px; }
.pm-plan-box .n { font-weight: 600; }
.pm-plan-box .m { font-size: .78rem; color: var(--text-light); }

@media print {
    body * { visibility: hidden; }
    #pmPage, #pmPage * { visibility: visible; }
    #pmPage { position: absolute; left: 0; top: 0; width: 100%; }
    .back-btn, .pm-noprint, #emergencyFloatBtn { display: none !important; }
}
