/* Topic check. Theme through --tc-* (defaults pick up the host page's own variables). */
.tc, .tc-results {
  --tc-text: var(--text, #111827); --tc-muted: var(--muted, #4B5563); --tc-line: var(--line, #E5E7EB);
  --tc-card: var(--glass, #fff); --tc-accent: var(--sf-accent, #0F766E); --tc-accent-ink: var(--sf-accent-ink, #fff);
  --tc-c: #22C55E; --tc-o: #F5B33B; --tc-s: #F2557A; --tc-n: #94A3B8; --tc-r: 18px;
  color: var(--tc-text);
}
.tc-h { display: flex; align-items: center; gap: 12px; font-size: clamp(1.4rem, 3vw, 1.9rem); margin: 0 0 14px; }
.tc-num { display: grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 50%; border: 1.5px solid var(--tc-accent); color: var(--tc-accent); font-size: 1rem; }
.tc-note { color: var(--tc-muted); font-size: .93rem; margin: 6px 0 14px; }
.tc-step { background: var(--tc-card); border: 1px solid var(--tc-line); border-radius: 26px; padding: 30px; margin-bottom: 22px; }
.tc-step1 { display: grid; gap: 18px; }
.tc-step1 .tc-note { margin: 0; }

.tc-pills { border: 0; margin: 0; padding: 0; min-width: 0; }
.tc-pills legend { font-weight: 600; margin-bottom: 8px; padding: 0; }
.tc-pills > div { display: flex; flex-wrap: wrap; gap: 8px; }
.tc-pills label { position: relative; }
.tc-pills input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.tc-pills span { display: inline-flex; align-items: center; min-height: 46px; padding: 0 18px; border-radius: 999px; border: 1.5px solid var(--tc-line); cursor: pointer; transition: background .15s, border-color .15s; }
.tc-pills input:checked + span { background: var(--tc-accent); border-color: var(--tc-accent); color: var(--tc-accent-ink); font-weight: 700; }
.tc-pills input:focus-visible + span { outline: 3px solid var(--tc-accent); outline-offset: 2px; }
.tc-field { display: grid; gap: 6px; font-weight: 600; max-width: 320px; }
.tc-field input, .tc-field select { font: inherit; font-weight: 400; color: var(--tc-text); background: var(--sf-bg, transparent); border: 1.5px solid var(--tc-line); border-radius: 12px; min-height: 48px; padding: 10px 14px; width: 100%; }
.tc-btn { font: inherit; font-weight: 700; min-height: 52px; padding: 0 26px; border-radius: 999px; border: 0; cursor: pointer; color: var(--tc-accent-ink); background: var(--tc-accent); justify-self: start; transition: transform .15s, filter .15s; }
.tc-btn:hover { transform: translateY(-2px); filter: brightness(1.07); }
.tc-link { font: inherit; background: none; border: 0; padding: 0; color: var(--tc-accent); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* legend + progress */
.tc-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: .88rem; color: var(--tc-muted); margin-bottom: 14px; }
.tc-legend i, .tc-counts i, .tc-prio i { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 7px; vertical-align: -1px; background: var(--dot); }
.tc-r-c { --dot: var(--tc-c); } .tc-r-o { --dot: var(--tc-o); } .tc-r-s { --dot: var(--tc-s); } .tc-r-n { --dot: var(--tc-n); }
.tc-progress { position: sticky; top: 76px; z-index: 5; display: flex; align-items: center; gap: 14px; padding: 12px 16px; margin: 0 -8px 10px; border-radius: 14px; background: var(--bg, #fff); border: 1px solid var(--tc-line); box-shadow: 0 8px 24px rgba(0,0,0,.12); font-size: .9rem; }
.tc-progress[hidden] { display: none; }
.tc-bar { flex: 1; height: 8px; border-radius: 99px; background: var(--tc-line); overflow: hidden; }
.tc-bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--cyan, var(--tc-accent)), var(--violet, var(--tc-accent))); transition: width .3s; }

/* topics */
.tc-subject-h { font-size: 1.5rem; margin: 26px 0 6px; }
.tc-area { position: relative; border: 0; margin: 0; padding: 18px 0 6px; border-top: 1px solid var(--tc-line); min-width: 0; }
.tc-area legend { float: left; width: 100%; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: .78rem; color: var(--tc-accent); padding: 0; margin-bottom: 6px; }
.tc-area legend ~ .tc-topic { clear: both; }
.tc-skip { position: absolute; top: 14px; right: 0; font: inherit; font-size: .82rem; background: none; border: 0; color: var(--tc-muted); text-decoration: underline; cursor: pointer; padding: 4px; }
.tc-topic { display: grid; grid-template-columns: 1fr auto; gap: 8px 20px; align-items: center; padding: 12px 0; border-bottom: 1px dashed var(--tc-line); }
.tc-topic:last-child { border-bottom: 0; }
.tc-topic[hidden], .tc-subject[hidden] { display: none; }
.tc-topic-t b { display: block; font-weight: 600; }
.tc-topic-t span { display: block; font-size: .86rem; color: var(--tc-muted); line-height: 1.4; }
.tc-y2 { font-size: .68rem; font-weight: 700; padding: 1px 7px; border-radius: 99px; border: 1px solid var(--tc-line); color: var(--tc-muted); margin-left: 6px; vertical-align: 2px; }
.tc-rate { display: grid; grid-template-columns: repeat(4, 92px); gap: 6px; }
.tc-rate label { position: relative; }
.tc-rate input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.tc-rate span { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 52px; padding: 6px 4px; border-radius: 12px; border: 1.5px solid var(--tc-line); cursor: pointer; text-align: center; transition: background .15s, border-color .15s, transform .1s; }
.tc-rate span:hover { border-color: var(--dot); }
.tc-rate i { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--dot); }
.tc-rate em { font-style: normal; font-size: .74rem; line-height: 1.15; color: var(--tc-muted); }
.tc-rate input:checked + span { background: color-mix(in srgb, var(--dot) 22%, transparent); border-color: var(--dot); }
.tc-rate input:checked + span i { background: var(--dot); }
.tc-rate input:checked + span em { color: var(--tc-text); font-weight: 700; }
.tc-rate input:focus-visible + span { outline: 3px solid var(--tc-accent); outline-offset: 2px; }
.tc-submit { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; padding-top: 22px; border-top: 1px solid var(--tc-line); margin-top: 10px; }
.tc-submit .tc-note { margin: 0; }

/* results */
.tc-res-head h2 { margin: 0 0 22px; }
.tc-kicker { font-size: .8rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--tc-accent); margin: 0 0 10px; }
.tc-overview { display: flex; align-items: center; gap: 32px; background: var(--tc-card); border: 1px solid var(--tc-line); border-radius: 26px; padding: 28px; margin-bottom: 20px; }
.tc-ring { --p: 0; flex: none; display: grid; place-items: center; width: 150px; height: 150px; border-radius: 50%;
  background: radial-gradient(closest-side, var(--bg, #fff) 78%, transparent 79%), conic-gradient(var(--cyan, var(--tc-accent)), var(--violet, var(--tc-accent)) calc(var(--p) * 1%), var(--tc-line) 0); }
.tc-ring span { text-align: center; font-size: .82rem; color: var(--tc-muted); line-height: 1.2; }
.tc-ring b { display: block; font-size: 2.2rem; font-weight: 400; color: var(--tc-text); font-family: Jost, inherit; }
.tc-mood { font-size: 1.15rem; margin: 0 0 14px; }
.tc-counts { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 20px; color: var(--tc-muted); font-size: .92rem; }
.tc-counts b { color: var(--tc-text); }
.tc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.tc-card { background: var(--tc-card); border: 1px solid var(--tc-line); border-radius: 26px; padding: 26px 28px; }
.tc-card h3 { font-size: 1.25rem; margin: 0 0 16px; }
.tc-areabar { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; margin-bottom: 14px; font-size: .95rem; }
.tc-areabar small { color: var(--tc-muted); }
.tc-areabar .tc-bar { grid-column: 1 / -1; flex: none; }
.tc-prio { list-style: none; padding: 0; margin: 0; counter-reset: p; }
.tc-prio li { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px dashed var(--tc-line); }
.tc-prio li:last-child { border-bottom: 0; }
.tc-prio i { margin: 6px 0 0; flex: none; }
.tc-prio b { display: block; font-weight: 600; }
.tc-prio span { font-size: .85rem; color: var(--tc-muted); }
.tc-strong { margin-bottom: 20px; }
.tc-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.tc-chips span { font-size: .88rem; padding: 6px 12px; border-radius: 99px; background: color-mix(in srgb, var(--tc-c) 16%, transparent); border: 1px solid color-mix(in srgb, var(--tc-c) 45%, transparent); }
.tc-send { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-bottom: 20px; }
.tc-send-form { display: grid; gap: 14px; }
.tc-send .tc-field { max-width: none; }
.tc-check { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; }
.tc-check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--tc-accent); flex: none; }
.tc-preview summary { cursor: pointer; color: var(--tc-accent); font-weight: 600; }
.tc-preview pre { white-space: pre-wrap; font-size: .8rem; line-height: 1.5; background: rgba(127,127,127,.1); border-radius: 12px; padding: 14px; max-height: 260px; overflow: auto; }
.tc-actions { display: flex; gap: 24px; flex-wrap: wrap; }
.tc-empty { background: var(--tc-card); border: 1px solid var(--tc-line); border-radius: 20px; padding: 24px; }

@media (max-width: 760px) {
  .tc-step { padding: 22px 18px; border-radius: 22px; }
  .tc-topic { grid-template-columns: 1fr; }
  .tc-rate { grid-template-columns: repeat(4, 1fr); }
  .tc-skip { position: static; display: block; margin: -2px 0 4px; padding: 4px 0; }
  .tc-progress { top: 70px; margin: 0 -6px 10px; }
  .tc-overview { flex-direction: column; text-align: center; padding: 24px 18px; }
  .tc-counts { justify-content: center; }
  .tc-grid, .tc-send { grid-template-columns: 1fr; }
  .tc-card { padding: 22px 18px; }
}
@media print {
  .tcw-demo-bar, .hdr, .ftr, .tcw-demo-foot, .tc-send, .tc-actions, .glow, .tc-hero { display: none !important; }
  .tc-card, .tc-overview { break-inside: avoid; }
}
