/* KarmaPen: white theme, Settings window, comment box after the rating */

/* ---- white theme: the page is drawn dark, so the whole page is flipped to light (pictures, video and the logo are flipped back) ---- */
html[data-theme="light"]{filter:invert(1) hue-rotate(180deg);color-scheme:dark}
html[data-theme="light"] img,html[data-theme="light"] video,html[data-theme="light"] canvas,html[data-theme="light"] iframe,
html[data-theme="light"] .kpmark,html[data-theme="light"] .kps-prev{filter:invert(1) hue-rotate(180deg)}

/* ---- Settings menu entries ---- */
.kpside .kpset{margin-top:auto;border-top:1px solid var(--line);border-radius:0 0 12px 12px;padding-top:14px}

/* ---- Settings window ---- */
.kps{position:fixed;inset:0;z-index:110;display:flex;align-items:center;justify-content:center;padding:16px;font-family:inherit}
.kps-back{position:absolute;inset:0;background:rgba(0,0,0,.62)}
html[data-theme="light"] .kps-back{background:rgba(255,255,255,.4)}
.kps-card{position:relative;width:100%;max-width:560px;max-height:calc(100vh - 32px);max-height:calc(100dvh - 32px);display:flex;flex-direction:column;background:var(--card);color:var(--ink);border:1px solid var(--line);border-radius:20px;box-shadow:0 24px 70px rgba(0,0,0,.6);overflow:hidden}
.kps-head{display:flex;align-items:center;justify-content:space-between;padding:18px 20px 6px}
.kps-head h2{margin:0;font-size:24px;font-weight:800}
.kps-x{border:0;background:var(--soft);color:var(--ink);width:36px;height:36px;border-radius:50%;font-size:22px;line-height:1;cursor:pointer}
.kps-tabs{display:flex;gap:6px;padding:8px 16px 0;border-bottom:1px solid var(--line);overflow-x:auto}
.kps-tab{border:0;background:transparent;color:var(--mute);font:inherit;font-size:15px;font-weight:700;padding:10px 14px;border-bottom:3px solid transparent;cursor:pointer;white-space:nowrap}
.kps-tab:hover{color:var(--ink)}
.kps-tab.on{color:var(--ink);border-bottom-color:var(--brand)}
.kps-body{padding:18px 20px 8px;overflow-y:auto;flex:1;min-height:260px}
.kps-body h3{margin:0 0 4px;font-size:19px}
.kps-body .kps-h2{margin-top:26px}
.kps-sub{margin:0 0 14px;color:var(--mute);font-size:14.5px;line-height:1.5}
.kps-foot{padding:10px 20px 16px;border-top:1px solid var(--line)}
.kps-link{border:0;background:transparent;color:var(--brand);font:inherit;font-size:15px;font-weight:700;cursor:pointer;padding:6px 0}
.kps-link:hover{text-decoration:underline}

.kps-themes{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.kps-theme{display:flex;flex-direction:column;gap:10px;align-items:stretch;border:2px solid var(--line);background:var(--soft);color:var(--ink);border-radius:16px;padding:10px;font:inherit;cursor:pointer;text-align:center}
.kps-theme b{font-size:16px}
.kps-theme.on{border-color:var(--brand);box-shadow:0 0 0 3px rgba(56,189,248,.22)}
.kps-prev{display:flex;flex-direction:column;gap:6px;border-radius:10px;padding:12px;height:84px;border:1px solid #3a3a46}
.kps-prev i{display:block;height:9px;border-radius:5px}
.kps-prev i:nth-child(1){width:55%}.kps-prev i:nth-child(2){width:80%}.kps-prev i:nth-child(3){width:38%;background:#38bdf8!important}
.kps-prev.dark{background:#09090b}.kps-prev.dark i{background:#3a3a46}
.kps-prev.light{background:#f6f6f4;border-color:#cfcfca}.kps-prev.light i{background:#cfcfca}

.kps-who{display:flex;align-items:center;gap:14px;margin-bottom:16px}
.kps-who b{display:block;font-size:18px}.kps-who small{color:var(--mute);font-size:14px;word-break:break-all}
.kps-av{width:52px;height:52px;border-radius:50%;background:var(--brand);color:var(--on-brand);display:grid;place-items:center;font-size:22px;font-weight:800;flex:none}
.kps-f{display:block;margin:0 0 12px}
.kps-f span{display:block;font-size:13.5px;font-weight:700;color:var(--mute);margin-bottom:5px}
.kps-f input{width:100%;background:var(--bg,#0f0f13);color:var(--ink);border:1.5px solid var(--line);border-radius:12px;padding:11px 13px;font:inherit;font-size:16px}
.kps-f input:focus{outline:none;border-color:var(--brand);box-shadow:0 0 0 3px rgba(56,189,248,.2)}
.kps-show{display:block;margin:2px 0 14px;font-size:14px;color:var(--mute);cursor:pointer}
.kps-msg{min-height:20px;margin-top:10px;font-size:14.5px;color:var(--mute)}
.kps-msg.ok{color:var(--good,#34d399)}.kps-msg.bad{color:var(--bad,#fb7185)}
.kps-info{display:grid;grid-template-columns:auto 1fr;gap:8px 16px;margin:20px 0 18px;padding:14px 16px;background:var(--soft);border-radius:14px;font-size:15px}
.kps-info dt{color:var(--mute)}.kps-info dd{margin:0;word-break:break-word}
.kps-need{padding:18px;background:var(--soft);border-radius:14px}.kps-need p{margin:0 0 12px;color:var(--mute)}
.kps-body .btn.small,.kpcmt .btn.small{padding:10px 18px;font-size:15px}
@media(max-width:560px){
  .kps{padding:0;align-items:flex-end}
  .kps-card{max-width:none;border-radius:20px 20px 0 0;max-height:92vh;max-height:92dvh}
}

/* ---- comment box after the lesson rating ---- */
.kpcmt{margin-top:14px;text-align:left}
.kpcmt p{margin:0 0 8px;color:var(--mute);font-size:15px;text-align:center}
.kpcmt textarea{display:block;min-height:0;height:84px;width:100%;max-width:520px;margin:0 auto;resize:vertical;border-radius:14px;padding:11px 14px;font:inherit;font-size:16px;color:var(--ink);background:var(--bg,#0f0f13);border:1.5px solid var(--line)}
.kpcmt-row{display:flex;justify-content:center;align-items:center;gap:12px;margin-top:10px}
.kpcmt-msg{color:var(--mute);font-size:14px}
.endcard:has(.rate) .fb-rate{display:none}
