/* Lernreich — component & view styles */

/* ===== Slider ===== */
.sl-wrap { display: flex; align-items: center; gap: 14px; }
.sl-input {
  -webkit-appearance: none; appearance: none; height: 6px; border-radius: 6px;
  flex: 1 1 auto; cursor: pointer; outline: none;
}
.sl-input::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--accent);
  box-shadow: var(--shadow-sm); cursor: grab; margin-top: 0;
  transition: transform .1s;
}
.sl-input::-webkit-slider-thumb:active { transform: scale(1.12); cursor: grabbing; }
.sl-input::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--accent); box-shadow: var(--shadow-sm);
}
.sl-val { font-size: 13.5px; font-weight: 700; color: var(--accent); min-width: 62px; text-align: right; }
.app-root[data-theme="dark"] .sl-val { color: color-mix(in oklab, var(--accent) 72%, #fff); }

/* ===== Stat tiles ===== */
.stat-tile { padding: 15px 16px; }
.st-head { display: flex; align-items: center; gap: 9px; }
.st-ico {
  width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center;
  color: var(--accent); background: var(--accent-soft);
}
.st-label { font-size: 11px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; color: var(--muted); }
.st-value { font-size: 26px; font-weight: 700; letter-spacing: -.5px; margin-top: 11px; }
.st-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ===== Heatmap ===== */
.heatmap { --cell: 15px; --cg: 4px; }
.hm-months { display: flex; padding-left: 0; margin-bottom: 5px; }
.hm-daycol { width: 26px; flex: 0 0 26px; display: flex; flex-direction: column; gap: var(--cg); }
.hm-month { width: calc(var(--cell) + var(--cg)); font-size: 10.5px; color: var(--faint); font-weight: 600; }
.hm-grid { display: flex; gap: var(--cg); }
.hm-dlabel { height: var(--cell); font-size: 10px; color: var(--faint); line-height: var(--cell); }
.hm-col { display: flex; flex-direction: column; gap: var(--cg); }
.hm-cell { width: var(--cell); height: var(--cell); border-radius: 4px; }
.hm-legend { display: flex; align-items: center; gap: 5px; justify-content: flex-end; margin-top: 12px; font-size: 11px; color: var(--faint); }
.hm-legend .hm-cell { width: 12px; height: 12px; }
.hm-legend span:first-child { margin-right: 3px; }
.hm-legend span:last-child { margin-left: 3px; }

/* ===== Week bars ===== */
.weekbars { display: flex; gap: 12px; align-items: flex-end; height: 120px; }
.wb-col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; }
.wb-track { position: relative; width: 100%; flex: 1; display: flex; align-items: flex-end;
  background: var(--surface-2); border-radius: 7px; overflow: hidden; }
.wb-fill { width: 100%; border-radius: 7px 7px 0 0; transition: height .5s cubic-bezier(.2,.7,.2,1); }
.wb-goal { position: absolute; left: 0; right: 0; height: 0; border-top: 1.5px dashed var(--border-strong); }
.wb-lbl { font-size: 11.5px; color: var(--muted); margin-top: 7px; font-weight: 600; }
.wb-lbl.today { color: var(--accent); font-weight: 800; }
.app-root[data-theme="dark"] .wb-lbl.today { color: color-mix(in oklab, var(--accent) 72%, #fff); }

/* ===== Timer view ===== */
.timer-wrap { max-width: 680px; margin: 0 auto; }
.today-strip {
  display: flex; align-items: center; gap: 18px; padding: 15px 18px; margin-bottom: 18px;
}
.today-strip .ts-info { flex: 1 1 auto; }
.today-strip .ts-k { font-size: 11px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; color: var(--muted); }
.today-strip .ts-v { font-size: 19px; font-weight: 800; letter-spacing: -.3px; margin-top: 3px; }
.today-strip .ts-v small { font-size: 13px; color: var(--muted); font-weight: 600; }
.today-strip .ts-bar { height: 8px; border-radius: 5px; background: var(--heat-track); margin-top: 10px; overflow: hidden; }
.today-strip .ts-bar > div { height: 100%; border-radius: 5px; background: var(--accent); }

.setup-card { padding: 22px 24px; }
.setup-sec { padding: 16px 0; border-top: 1px solid var(--border); }
.setup-sec:first-child { border-top: none; padding-top: 4px; }
.sec-title { font-size: 12px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; color: var(--faint); margin-bottom: 13px; }
.slider-row { display: grid; grid-template-columns: 150px 1fr; align-items: center; gap: 16px; padding: 7px 0; }
.slider-row .srl { font-size: 13.5px; font-weight: 600; color: var(--ink-2); }

.checklist { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.chk {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r-sm);
  border: 1px solid var(--border); background: var(--surface-2); cursor: pointer; font-size: 13.5px;
  color: var(--ink-2); font-weight: 600; transition: border-color .14s, background .14s, color .14s; user-select: none;
}
.chk:hover { border-color: var(--border-strong); }
.chk.on { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); }
.chk .box {
  width: 19px; height: 19px; border-radius: 6px; border: 2px solid var(--border-strong);
  display: grid; place-items: center; flex: 0 0 19px; color: transparent; transition: all .14s;
}
.chk.on .box { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chk.on .box svg { width: 13px; height: 13px; }

.setup-actions { display: flex; gap: 12px; margin-top: 18px; }
.setup-actions .btn { flex: 1; }

/* Active timer */
.active-wrap { max-width: 560px; margin: 0 auto; text-align: center; display: flex; flex-direction: column; align-items: center; }
.active-phase { font-size: 11px; font-weight: 800; letter-spacing: 1.4px; text-transform: uppercase; color: var(--accent); }
.app-root[data-theme="dark"] .active-phase { color: color-mix(in oklab, var(--accent) 72%, #fff); }
.active-phase.break { color: var(--muted); }
.active-subject { font-size: 23px; font-weight: 800; letter-spacing: -.5px; margin: 7px 0 3px; white-space: nowrap; }
.active-goal { color: var(--muted); font-size: 13.5px; margin-bottom: 22px; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.ring-time { font-size: 42px; font-weight: 700; letter-spacing: -1px; line-height: 1; }
.ring-cap { font-size: 12px; color: var(--muted); margin-top: 8px; font-weight: 600; }
.active-meta { display: flex; gap: 26px; justify-content: center; margin: 22px 0 4px; }
.am-item { text-align: center; }
.am-v { font-size: 17px; font-weight: 800; }
.am-k { font-size: 11px; color: var(--muted); margin-top: 2px; }
.active-actions { display: flex; gap: 11px; margin-top: 24px; width: 100%; }
.active-actions .btn { flex: 1; }
.active-note { margin-top: 16px; font-size: 12.5px; color: var(--muted); }

/* ===== Stats view ===== */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stats-2col { display: grid; grid-template-columns: 1.55fr 1fr; gap: 18px; align-items: start; }
.panel { padding: 20px 22px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.panel-title { font-size: 15px; font-weight: 800; letter-spacing: -.2px; }
.panel-meta { font-size: 12px; color: var(--muted); font-weight: 600; }

.level-hero { padding: 22px; display: flex; align-items: center; gap: 22px; }
.level-hero .lh-r { flex: 1 1 auto; }
.lh-lvl { font-size: 13px; font-weight: 800; color: var(--accent); letter-spacing: .4px; }
.app-root[data-theme="dark"] .lh-lvl { color: color-mix(in oklab, var(--accent) 72%, #fff); }
.lh-title { font-size: 22px; font-weight: 800; letter-spacing: -.4px; margin: 3px 0 8px; }
.lh-track { height: 9px; border-radius: 6px; background: var(--heat-track); overflow: hidden; }
.lh-track > div { height: 100%; border-radius: 6px; background: var(--accent); }
.lh-sub { font-size: 12.5px; color: var(--muted); margin-top: 9px; }

/* milestones */
.miles { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.mile { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--r-md);
  border: 1px solid var(--border); background: var(--surface-2); }
.mile.done { background: var(--accent-softer); border-color: color-mix(in oklab, var(--accent) 22%, var(--border)); }
.mile .m-ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: 0 0 36px;
  background: var(--heat-track); color: var(--faint); }
.mile.done .m-ico { background: var(--accent); color: var(--accent-ink); }
.mile .m-l { font-size: 13px; font-weight: 700; }
.mile .m-s { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.mile.locked { opacity: .72; }

/* ===== Sessions / journal lists ===== */
.row-item { display: flex; align-items: center; gap: 14px; padding: 13px 4px; border-top: 1px solid var(--border); }
.row-item:first-child { border-top: none; }
.ri-day { width: 46px; flex: 0 0 46px; text-align: center; }
.ri-day .d { font-size: 18px; font-weight: 800; line-height: 1; }
.ri-day .m { font-size: 10.5px; color: var(--muted); text-transform: uppercase; font-weight: 700; margin-top: 2px; }
.ri-main { flex: 1 1 auto; min-width: 0; }
.ri-subject { font-size: 14px; font-weight: 700; }
.ri-goal { font-size: 12.5px; color: var(--muted); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ri-meta { text-align: right; flex: 0 0 auto; }
.ri-time { font-size: 13.5px; font-weight: 700; font-family: var(--font-mono); }
.ri-xp { font-size: 11.5px; color: var(--accent); font-weight: 700; margin-top: 2px; }

.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; padding: 3px 9px;
  border-radius: 20px; background: var(--accent-soft); color: var(--accent); }
.app-root[data-theme="dark"] .tag { color: color-mix(in oklab, var(--accent) 75%, #fff); }
.tag.muted { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }

/* journal entry cards */
.jr-list { display: flex; flex-direction: column; gap: 14px; }
.jr-card { padding: 17px 19px; }
.jr-top { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.jr-date { font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; flex: 0 0 auto; }
.jr-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--faint); flex: 0 0 auto; }
.jr-subject { font-size: 14px; font-weight: 700; white-space: nowrap; }
.jr-min { margin-left: auto; font-size: 12px; color: var(--muted); font-family: var(--font-mono); flex: 0 0 auto; padding-left: 10px; }
.jr-text { font-size: 13.5px; line-height: 1.55; color: var(--ink-2); }
.jr-tags { display: flex; gap: 7px; margin-top: 11px; }

.jr-compose { padding: 17px 19px; }
.jr-compose textarea {
  width: 100%; border: none; background: transparent; resize: none; font: inherit; font-size: 14px;
  color: var(--ink); outline: none; min-height: 58px; line-height: 1.5;
}
.jr-compose textarea::placeholder { color: var(--faint); }
.jr-compose-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--border); }

/* reviews */
.rev-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); }
.rev-item:first-child { border-top: none; }
.rev-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 9px; background: var(--accent); }
.rev-dot.over { background: #e0894a; }
.rev-main { flex: 1; min-width: 0; }
.rev-topic { font-size: 13.5px; font-weight: 700; }
.rev-sub { font-size: 12px; color: var(--muted); margin-top: 1px; }
.rev-due { font-size: 12px; font-weight: 700; color: var(--muted); }
.rev-due.over { color: #c9742f; }

/* ===== Calendar ===== */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.cal-nav { display: flex; align-items: center; gap: 6px; }
.cal-month { font-size: 18px; font-weight: 800; letter-spacing: -.3px; min-width: 168px; text-align: center; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.cal-dow { font-size: 11px; font-weight: 800; color: var(--faint); text-transform: uppercase; text-align: center; padding-bottom: 4px; letter-spacing: .5px; }
.cal-cell { aspect-ratio: 1 / .82; border-radius: var(--r-sm); border: 1px solid var(--border); background: var(--surface-2);
  padding: 8px 9px; position: relative; display: flex; flex-direction: column; }
.cal-cell.empty { border: none; background: transparent; }
.cal-cell.today { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.cal-cell .cn { font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.cal-cell.today .cn { color: var(--accent); }
.cal-cell .cm { margin-top: auto; font-size: 11px; font-weight: 700; font-family: var(--font-mono); color: var(--accent); }
.cal-cell .cbar { height: 5px; border-radius: 3px; margin-top: 5px; background: var(--accent); }
.cal-legend { display: flex; align-items: center; gap: 14px; margin-top: 16px; font-size: 12px; color: var(--muted); }
.cal-side { display: flex; flex-direction: column; gap: 14px; }
.ov-list { display: flex; flex-direction: column; }
.ov-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.ov-row:first-child { border-top: none; padding-top: 0; }
.ov-k { font-size: 13px; color: var(--muted); font-weight: 600; }
.ov-v { font-size: 15px; font-weight: 700; white-space: nowrap; }

.divider { height: 1px; background: var(--border); margin: 16px 0; }
