/* Home | Learn tabs and the Learn tab. Colors come from the theme variables. */

html[data-sd-tab="learn"] center > table, html[data-sd-tab="notes"] center > table, html[data-sd-tab="settings"] center > table,
html[data-sd-tab="pass"] center > table, html[data-sd-tab="cards"] center > table,
html[data-sd-tab="learn"] .sd-home-only, html[data-sd-tab="notes"] .sd-home-only, html[data-sd-tab="settings"] .sd-home-only,
html[data-sd-tab="pass"] .sd-home-only, html[data-sd-tab="cards"] .sd-home-only,
html[data-sd-tab="notes"] .sd-hero, html[data-sd-tab="settings"] .sd-hero, html[data-sd-tab="pass"] .sd-hero,
html[data-sd-tab="cards"] .sd-hero { display: none !important; }
html:not([data-sd-tab="learn"]) .sd-learn { display: none; }
html:not([data-sd-tab="notes"]) .sd-notes { display: none; }
html:not([data-sd-tab="settings"]) .sd-settings { display: none; }
html:not([data-sd-tab="cards"]) .sd-cards { display: none; }

/* Segmented controls (top tabs and Learn sub-nav share the look) */
.sd-tabs, .sd-subnav {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--sd-border);
  border-radius: 99px;
  background: var(--sd-surface);
  box-shadow: var(--sd-shadow);
}
.sd-tabs { margin-bottom: 14px; }
.sd-subnav { margin-bottom: 16px; }
.sd-tabs button, .sd-subnav button {
  padding: 6px 16px;
  border: 0;
  border-radius: 99px;
  background: transparent;
  color: var(--sd-muted);
  font: 500 13px var(--sd-font);
  cursor: pointer;
  transition: color 0.15s, background 0.15s, box-shadow 0.15s;
}
.sd-tabs button:hover, .sd-subnav button:hover { color: var(--sd-text); }
.sd-tabs button[aria-selected="true"], .sd-subnav button[aria-selected="true"] {
  background: var(--sd-hover);
  color: var(--sd-text);
  box-shadow: inset 0 1px 0 rgb(var(--sd-light) / var(--sd-edge-max)), 0 0 14px -6px var(--sd-accent);
}
.sd-tabs button:focus-visible, .sd-subnav button:focus-visible, .sd-btn:focus-visible,
.sd-choice:focus-visible, .sd-cardrow:focus-visible { outline: 2px solid var(--sd-accent); outline-offset: 2px; }

.sd-learn { padding-bottom: 40px; }
.sd-learn h3 { margin: 0 0 12px; font-size: 15px; font-weight: 600; }
.sd-learn p { margin: 0 0 10px; line-height: 1.5; }
.sd-muted { color: var(--sd-muted); }
.sd-learn code { font: 12px var(--sd-mono); padding: 1px 5px; border-radius: 5px; background: var(--sd-hover); }

.sd-panel {
  margin-bottom: 16px;
  padding: 18px 20px;
  border: 1px solid var(--sd-border);
  border-radius: var(--sd-radius);
  background-color: var(--sd-surface);
  background-image: radial-gradient(130% 80% at 50% -10%, rgb(var(--sd-light) / var(--sd-lit-max)), transparent 62%);
  box-shadow: inset 0 1px 0 rgb(var(--sd-light) / var(--sd-edge-max)), var(--sd-shadow);
  animation: sd-rise 0.35s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.sd-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

.sd-btn {
  padding: 8px 16px;
  border: 1px solid var(--sd-border);
  border-radius: 99px;
  background: var(--sd-surface);
  color: var(--sd-text);
  font: 500 13px var(--sd-font);
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, opacity 0.15s;
}
.sd-btn:hover { border-color: var(--sd-accent); box-shadow: 0 0 16px -4px var(--sd-accent); }
.sd-btn.primary { border-color: transparent; background: var(--sd-accent); color: #fff; }
.sd-btn:disabled { opacity: 0.5; cursor: default; box-shadow: none; }

.sd-input, .sd-learn select {
  flex: 1;
  min-width: 0;
  box-sizing: border-box;
  padding: 10px 14px;
  border: 1px solid var(--sd-border);
  border-radius: 12px;
  background: var(--sd-bg);
  color: var(--sd-text);
  font: 14px var(--sd-font);
  resize: vertical;
}
.sd-learn select { flex: 0 1 260px; border-radius: 99px; padding: 8px 12px; font-size: 13px; }
.sd-input:focus, .sd-learn select:focus { outline: none; border-color: var(--sd-accent); box-shadow: 0 0 0 3px rgb(41 151 255 / 0.2); }
textarea.sd-input { width: 100%; margin-bottom: 10px; }

.sd-alert {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  margin-bottom: 14px; padding: 10px 14px;
  border-radius: 12px; font-size: 13px;
}
.sd-alert.error { background: rgb(255 105 97 / 0.12); color: var(--sd-learn); }
.sd-alert.notice { background: rgb(48 209 88 / 0.12); color: var(--sd-review); }
.sd-alert button { border: 0; background: none; color: inherit; cursor: pointer; font-size: 12px; }

.sd-loading { display: flex; align-items: center; gap: 10px; color: var(--sd-muted); font-size: 13px; }
.sd-dots { display: inline-flex; gap: 4px; }
.sd-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--sd-accent); animation: sd-bounce 1s infinite ease-in-out; }
.sd-dots i:nth-child(2) { animation-delay: 0.15s; }
.sd-dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes sd-bounce { 0%, 80%, 100% { opacity: 0.25; transform: scale(0.8); } 40% { opacity: 1; transform: none; } }

/* Insights */
.sd-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.sd-tile {
  display: flex; flex-direction: column; gap: 2px;
  padding: 16px 18px;
  border: 1px solid var(--sd-border);
  border-radius: var(--sd-radius);
  background: var(--sd-surface);
  box-shadow: inset 0 1px 0 rgb(var(--sd-light) / var(--sd-edge-max)), var(--sd-shadow);
}
.sd-tile b {
  font-size: 28px; font-weight: 300; letter-spacing: -0.03em; font-variant-numeric: tabular-nums;
  background-image: var(--sd-titanium); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.sd-tile span { font-size: 13px; font-weight: 600; }
.sd-tile small { color: var(--sd-muted); font-size: 11px; }

.sd-topic { display: flex; align-items: center; gap: 16px; padding: 12px 0; border-top: 1px solid var(--sd-border); }
.sd-topic:first-of-type { border-top: 0; padding-top: 2px; }
.sd-topic-main { flex: 1; min-width: 0; }
.sd-topic-name { font-size: 14px; font-weight: 500; margin-bottom: 7px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sd-kind {
  display: inline-block; margin-right: 8px; padding: 1px 6px;
  border-radius: 5px; background: var(--sd-hover); color: var(--sd-muted);
  font: 600 10px var(--sd-mono); text-transform: uppercase; letter-spacing: 0.06em; vertical-align: 1px;
}
.sd-bar { height: 5px; border-radius: 99px; background: var(--sd-heat-0); overflow: hidden; }
.sd-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--sd-learn), var(--sd-heat-4), var(--sd-review)); background-size: 712px 100%; }
.sd-topic-meta { margin-top: 6px; color: var(--sd-muted); font-size: 12px; }

.sd-cardrow {
  display: flex; flex-direction: column; gap: 3px; width: 100%;
  padding: 10px 12px; margin: 0 -12px; box-sizing: content-box;
  border: 0; border-radius: 10px; background: transparent;
  color: var(--sd-text); text-align: left; font: 14px var(--sd-font); cursor: pointer;
}
.sd-cardrow:hover { background: var(--sd-hover); }
/* a long card question is cut with "…" instead of widening the row (and the page) sideways */
.sd-cardrow { min-width: 0; max-width: 100%; overflow: hidden; }
.sd-cardrow-q { display: block; min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sd-cardrow-meta { color: var(--sd-muted); font-size: 12px; }
.sd-strong { display: flex; justify-content: space-between; padding: 7px 0; font-size: 14px; }
.sd-strong b { color: var(--sd-review); font: 600 13px var(--sd-mono); }
.sd-empty { text-align: center; }

/* Quiz */
.sd-quiz-top { display: flex; justify-content: space-between; gap: 12px; color: var(--sd-muted); font-size: 12px; }
.sd-progress { height: 4px; margin: 10px 0 18px; border-radius: 99px; background: var(--sd-heat-0); overflow: hidden; }
.sd-progress i { display: block; height: 100%; background: var(--sd-accent); box-shadow: 0 0 10px var(--sd-accent); transition: width 0.3s; }
.sd-question { font-size: 18px; font-weight: 500; letter-spacing: -0.01em; line-height: 1.45 !important; margin-bottom: 16px !important; }
.sd-choices { display: grid; gap: 8px; margin-bottom: 14px; }
.sd-choice {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--sd-border); border-radius: 12px;
  background: var(--sd-bg); color: var(--sd-text);
  font: 14px var(--sd-font); text-align: left; cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.sd-choice span {
  flex: none; display: grid; place-items: center; width: 24px; height: 24px;
  border-radius: 7px; background: var(--sd-hover); color: var(--sd-muted); font: 600 12px var(--sd-mono);
}
.sd-choice:not(:disabled):hover { border-color: var(--sd-accent); box-shadow: 0 0 16px -6px var(--sd-accent); }
.sd-choice:disabled { cursor: default; }
.sd-choice.right { border-color: var(--sd-review); box-shadow: 0 0 16px -6px var(--sd-review); }
.sd-choice.right span { background: var(--sd-review); color: #fff; }
.sd-choice.wrong { border-color: var(--sd-learn); }
.sd-choice.wrong span { background: var(--sd-learn); color: #fff; }
.sd-choice.dim { opacity: 0.5; }
.sd-given { margin-bottom: 14px; padding: 12px 14px; border-radius: 12px; background: var(--sd-hover); font-size: 14px; }
.sd-verdict { margin-bottom: 14px; padding: 12px 14px; border-left: 3px solid; border-radius: 4px 12px 12px 4px; background: var(--sd-hover); font-size: 14px; }
.sd-verdict.right { border-color: var(--sd-review); }
.sd-verdict.wrong { border-color: var(--sd-learn); }
.sd-verdict b { display: block; margin-bottom: 4px; }
.sd-verdict.right b { color: var(--sd-review); }
.sd-verdict.wrong b { color: var(--sd-learn); }
.sd-verdict p:last-child { margin: 0; }
.sd-quiz-done { text-align: center; padding: 30px 20px; }
.sd-score {
  font-size: 64px; font-weight: 200; letter-spacing: -0.04em; line-height: 1; margin-bottom: 10px;
  background-image: var(--sd-titanium); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.sd-score small { font-size: 22px; margin-left: 4px; }

/* Chat */
.sd-chat { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.sd-chat-log { display: flex; flex-direction: column; gap: 12px; max-height: 480px; min-height: 220px; overflow-y: auto; padding: 18px 20px; }
.sd-msg { max-width: 85%; padding: 10px 14px; border-radius: 16px; font-size: 14px; line-height: 1.5; }
.sd-msg.user { align-self: flex-end; background: var(--sd-accent); color: #fff; border-bottom-right-radius: 5px; white-space: pre-wrap; }
.sd-msg.ai { align-self: flex-start; background: var(--sd-hover); border-bottom-left-radius: 5px; }
.sd-msg.ai p { margin: 0 0 8px; }
.sd-msg.ai p:last-child, .sd-msg.ai ul:last-child { margin-bottom: 0; }
.sd-msg.ai ul { margin: 0 0 8px; padding-left: 18px; }
.sd-cite {
  padding: 0 6px; border: 1px solid var(--sd-border); border-radius: 6px;
  background: var(--sd-surface); color: var(--sd-accent); font: 600 11px var(--sd-mono); cursor: pointer;
}
.sd-sources { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--sd-border); }
.sd-sources span { width: 100%; color: var(--sd-muted); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
.sd-sources button {
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding: 4px 10px; border: 1px solid var(--sd-border); border-radius: 99px;
  background: var(--sd-surface); color: var(--sd-text); font: 12px var(--sd-font); cursor: pointer;
}
.sd-sources button:hover { border-color: var(--sd-accent); }
.sd-chat-empty { margin: auto; text-align: center; color: var(--sd-muted); font-size: 14px; }
.sd-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 12px; }
.sd-chip-btn {
  padding: 7px 14px; border: 1px solid var(--sd-border); border-radius: 99px;
  background: var(--sd-surface); color: var(--sd-text); font: 13px var(--sd-font); cursor: pointer;
}
.sd-chip-btn:hover { border-color: var(--sd-accent); box-shadow: 0 0 16px -6px var(--sd-accent); }
.sd-chat-bar { display: flex; align-items: flex-end; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--sd-border); }
.sd-chat-bar textarea.sd-input { margin: 0; resize: none; max-height: 140px; }
.sd-dot-ok { display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--sd-review); box-shadow: 0 0 8px var(--sd-review); }

html.reduce-motion .sd-panel, html.reduce-motion .sd-dots i { animation: none !important; }
@media (prefers-reduced-motion: reduce) { html:not([data-sd-motion="full"]) .sd-panel, html:not([data-sd-motion="full"]) .sd-dots i { animation: none !important; } }

/* --- Insights v2 --------------------------------------------------------------------------- */
.sd-cap { margin: -6px 0 14px !important; color: var(--sd-muted); font-size: 12px; }
.sd-cap b { color: var(--sd-text); font-weight: 600; }
.sd-mt { margin-top: 14px; }
.sd-grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 0 16px; align-items: start; }
.sd-stackcol { display: flex; flex-direction: column; }

/* Column chart */
.sd-bars { display: flex; align-items: flex-end; gap: 2px; height: 110px; border-bottom: 1px solid var(--sd-border); }
.sd-barcol { flex: 1; height: 100%; display: flex; align-items: flex-end; cursor: default; }
.sd-barcol i { display: block; width: 100%; border-radius: 4px 4px 0 0; background: var(--sd-accent); opacity: 0.55; transition: opacity 0.12s; }
.sd-barcol i.best { opacity: 1; box-shadow: 0 0 12px -2px var(--sd-accent); }
.sd-barcol:hover i { opacity: 1; }
.sd-axis { display: flex; gap: 2px; margin-top: 6px; color: var(--sd-muted); font-size: 10px; }
.sd-axis span { flex: 1; white-space: nowrap; overflow: visible; }
.sd-axis.spread { justify-content: space-between; }
.sd-axis.spread span { flex: none; }

/* Line chart */
.sd-trend { position: relative; height: 130px; margin-right: 34px; }
.sd-trend svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.sd-trend path { fill: none; stroke: var(--sd-accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; filter: drop-shadow(0 0 6px var(--sd-accent)); }
.sd-gridline { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--sd-border); }
.sd-gridline span { position: absolute; right: -34px; top: -7px; color: var(--sd-muted); font: 10px var(--sd-mono); }
.sd-pt {
  position: absolute; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%;
  background: var(--sd-accent); box-shadow: 0 0 0 2px var(--sd-surface);
}
.sd-pt::after { content: ""; position: absolute; inset: -8px; } /* bigger hit target */
.sd-pt:hover { transform: scale(1.4); }

/* Stacked bar (card maturity) */
.sd-stack { display: flex; gap: 2px; height: 14px; border-radius: 4px; overflow: hidden; }
.sd-stack i { min-width: 3px; }
.c1 { background: var(--sd-cat-1); }
.c2 { background: var(--sd-cat-2); }
.c3 { background: var(--sd-cat-3); }
.c4 { background: var(--sd-cat-4); }
.sd-legend2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 16px; margin-top: 14px; font-size: 13px; }
.sd-legend2 span { display: flex; align-items: center; gap: 8px; }
.sd-legend2 i { width: 10px; height: 10px; border-radius: 3px; }
.sd-legend2 b { margin-left: auto; font: 600 12px var(--sd-mono); }

.sd-more-link {
  margin-top: 8px; padding: 4px 0; border: 0; background: none;
  color: var(--sd-accent); font: 500 13px var(--sd-font); cursor: pointer;
}
.sd-more-link:hover { text-decoration: underline; }
.sd-strong-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.sd-strong-chips > span {
  display: inline-flex; align-items: center; gap: 4px; padding: 6px 12px;
  border: 1px solid var(--sd-border); border-radius: 99px; font-size: 13px;
}
.sd-strong-chips b { margin-left: 6px; color: var(--sd-review); font: 600 12px var(--sd-mono); }

/* Quiz controls */
.sd-quiz-top { align-items: center; }
.sd-quiz-actions { display: flex; gap: 14px; }
.sd-quiz-actions .sd-more-link { margin: 0; font-size: 12px; }

/* Plain chart tooltip (reuses the heatmap tooltip's glass card) */
.sd-tip-plain .sd-tip-main { font-size: 13px; }
.sd-warn { margin: 0 0 12px; color: var(--sd-learn); font-size: 13px; }
.sd-quiz-start + .sd-quiz-start { margin-top: 14px; }
.sd-quiz-start #sd-lecture { flex: 1 1 auto; max-width: 520px; }
.sd-quiz-count { margin-bottom: 14px; gap: 10px; flex-wrap: wrap; }
.sd-quiz-start #sd-topic-q { flex: 1 1 auto; max-width: 420px; }

/* Insights: section headings, habit cards with a finding, dot charts, study calendar */
.sd-h2 { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; margin: 26px 2px 12px; font-size: 17px; font-weight: 650; letter-spacing: -0.01em; }
.sd-h2 span { color: var(--sd-muted); font-size: 12px; font-weight: 400; letter-spacing: 0; }
/* habit cards flow into columns like a masonry wall, so a short card never leaves a hole beside a tall one */
.sd-habits { columns: 3 320px; column-gap: 16px; }
.sd-habits > .sd-panel { display: inline-block; width: 100%; box-sizing: border-box; break-inside: avoid; }
.sd-habit h3 { font-size: 16px !important; letter-spacing: -0.01em; }
.sd-habit.found h3::before {
  content: ""; display: inline-block; width: 7px; height: 7px; margin: 0 8px 2px 0; border-radius: 50%;
  background: var(--sd-accent); box-shadow: 0 0 10px var(--sd-accent); vertical-align: middle;
}
.sd-habit-text { margin: -4px 0 14px !important; color: var(--sd-muted); font-size: 13px; line-height: 1.55; }
.sd-habit-text b { color: var(--sd-text); font-weight: 600; }
.sd-try { margin: 14px 0 0 !important; padding: 9px 12px; border-radius: 10px; background: rgb(41 151 255 / 0.1); color: var(--sd-text); font-size: 12.5px; line-height: 1.5; }
.sd-try::before { content: "Try: "; font-weight: 600; color: var(--sd-accent); }
.sd-fragile { margin-top: 16px; }

.sd-dotchart { display: flex; flex-direction: column; gap: 2px; }
.sd-dotaxis, .sd-dotrow { display: grid; grid-template-columns: 118px 1fr 40px; align-items: center; gap: 10px; }
.sd-dotticks { position: relative; height: 14px; }
.sd-dotticks em { position: absolute; transform: translateX(-50%); color: var(--sd-muted); font: 10px var(--sd-mono); font-style: normal; }
.sd-dotticks em:first-child { transform: none; }
.sd-dotticks em:last-child { transform: translateX(-100%); }
.sd-dotrow { min-height: 28px; border-radius: 8px; cursor: default; }
.sd-dotrow:hover { background: var(--sd-hover); }
.sd-dotlabel { padding-left: 6px; color: var(--sd-muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sd-dotrow.key .sd-dotlabel { color: var(--sd-text); font-weight: 600; }
.sd-dottrack { position: relative; height: 2px; border-radius: 2px; background: var(--sd-border); }
.sd-dottrack i {
  position: absolute; top: 50%; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%;
  background: var(--sd-accent); box-shadow: 0 0 0 2px var(--sd-surface), 0 0 10px rgb(41 151 255 / 0.6);
}
.sd-dotrow.few .sd-dottrack i { background: var(--sd-surface); box-shadow: 0 0 0 2px var(--sd-surface), inset 0 0 0 1.5px var(--sd-muted); }
.sd-dotrow b { font: 600 12px var(--sd-mono); text-align: right; padding-right: 6px; }
.sd-dotrow.few b { color: var(--sd-muted); font-weight: 400; }

.sd-cal { display: grid; grid-template-rows: repeat(7, 12px); grid-auto-flow: column; grid-auto-columns: 12px; gap: 3px; margin-bottom: 16px; }
.sd-cal i { border-radius: 3px; background: var(--sd-border); }
.sd-cal i.on { background: var(--sd-accent); box-shadow: 0 0 6px rgb(41 151 255 / 0.5); }
.sd-h3-gap { margin-top: 30px !important; }
.sd-fragile .sd-cardrow { box-sizing: border-box; width: 100%; }

/* Summary header: recall ring + tiles with small pictures */
.sd-hero2 { display: grid; grid-template-columns: 200px 1fr; gap: 22px; align-items: center; }
@media (max-width: 720px) { .sd-hero2 { grid-template-columns: 1fr; } }
.sd-hero2-ring { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.sd-ring { position: relative; width: 156px; height: 156px; }
.sd-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.sd-ring circle { fill: none; stroke-width: 9; }
.sd-ring .track { stroke: var(--sd-border); }
.sd-ring .fill { stroke: var(--sd-accent); stroke-linecap: round; animation: sd-ring 1s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
@keyframes sd-ring { from { stroke-dasharray: 0 400; } }
.sd-ring-mid { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.sd-ring-mid b {
  font-size: 38px; font-weight: 300; letter-spacing: -0.04em; font-variant-numeric: tabular-nums;
  background-image: var(--sd-titanium); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.sd-ring-mid span { color: var(--sd-muted); font-size: 12px; margin-top: -2px; }
.sd-ring-cap { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 12px; }
.sd-ring-cap b { font-weight: 600; }
.sd-ring-cap em { font-style: normal; font-size: 11px; color: var(--sd-muted); }
.sd-ring-cap em.up { color: var(--sd-review); }
.sd-ring-cap em.down { color: var(--sd-learn); }

.sd-hero2-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 900px) { .sd-hero2-tiles { grid-template-columns: 1fr; } }
.sd-tile2 {
  display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 14px 16px 16px;
  border: 1px solid var(--sd-border); border-radius: 16px; background: rgb(var(--sd-light) / 0.02);
}
.sd-tile2-label { color: var(--sd-muted); font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.sd-tile2-value { font-size: 28px; font-weight: 300; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.sd-tile2-value small { color: var(--sd-muted); font-size: 15px; }
.sd-tile2-sub { color: var(--sd-muted); font-size: 11px; margin-bottom: 12px; }

.sd-spark { display: flex; align-items: flex-end; gap: 2px; height: 44px; margin-top: auto; }
.sd-spark i { flex: 1; height: 100%; display: flex; align-items: flex-end; cursor: default; }
.sd-spark span { width: 100%; border-radius: 2px 2px 0 0; background: var(--sd-accent); opacity: 0.85; }
.sd-spark i:hover span { opacity: 1; box-shadow: 0 0 8px var(--sd-accent); }
.sd-spark i span[style="height:0%"] { height: 2px !important; background: var(--sd-border); opacity: 1; }

.sd-daydots { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px 6px; max-width: 150px; margin-top: auto; }
.sd-daydots i { aspect-ratio: 1; border-radius: 50%; background: var(--sd-border); }
.sd-daydots i.on { background: var(--sd-accent); box-shadow: 0 0 6px rgb(41 151 255 / 0.5); }

.sd-prog { display: flex; gap: 2px; height: 12px; margin-top: auto; border-radius: 99px; overflow: hidden; }
.sd-prog i { height: 100%; cursor: default; }
.sd-prog .c1 { background: var(--sd-border); }
.sd-prog .c2 { background: var(--sd-learn); }
.sd-prog .c3 { background: var(--sd-heat-3); }
.sd-prog .c4 { background: var(--sd-review); }
.sd-ring::before { content: ""; position: absolute; inset: 14px; border-radius: 50%; box-shadow: 0 0 34px -6px rgb(41 151 255 / 0.45); }
