/* Ham study tools: exam practice, Morse trainer, prefix map, Q-codes. */
.he-top { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1.25rem; align-items: center; margin-bottom: 1rem; }
@media (max-width: 760px) { .he-top { grid-template-columns: 1fr; } }
.he-rings { display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; }
.he-ring-big { font: 800 24px system-ui, sans-serif; fill: var(--text-primary); }
.he-ring-sub { font: 12px system-ui, sans-serif; fill: var(--text-secondary); }
.he-actions { display: grid; gap: .6rem; }
.he-big, .he-sub, .he-ans, .mo-key, .qc-alpha button { font-family: inherit; }
.he-big { display: grid; grid-template-columns: 2.4rem 1fr; grid-template-rows: auto auto; column-gap: .6rem; text-align: left; background: var(--bg-secondary, rgba(127,127,127,.06)); border: 1px solid var(--border-color); border-radius: 12px; padding: .8rem 1rem; cursor: pointer; color: var(--text-primary); transition: border-color .15s, transform .15s; }
.he-big:hover:not([disabled]) { border-color: var(--accent-color); transform: translateY(-1px); }
.he-big[disabled] { opacity: .5; cursor: default; }
.he-big span { grid-row: 1 / 3; font-size: 1.8rem; line-height: 1; align-self: center; }
.he-big b { font-size: 1.05rem; }
.he-big small { color: var(--text-secondary); }
.he-subs { display: grid; gap: .45rem; }
.he-sub { display: grid; grid-template-columns: 3.2rem minmax(0, 1fr) minmax(80px, 180px) 3rem; gap: .6rem; align-items: center; text-align: left; background: none; border: 1px solid var(--border-color); border-radius: 10px; padding: .55rem .75rem; color: var(--text-primary); cursor: pointer; }
.he-sub:hover:not(.static) { border-color: var(--accent-color); }
.he-sub.static { cursor: default; }
.he-sub-id { font: 700 1rem ui-monospace, Menlo, Consolas, monospace; color: var(--accent-color); }
.he-sub-t small { display: block; color: var(--text-secondary); font-size: .8rem; }
.he-bar { height: 10px; border-radius: 6px; background: rgba(127,127,127,.18); overflow: hidden; }
.he-bar i { display: block; height: 100%; border-radius: 6px; transition: width .5s; }
.he-pct { font: 600 .9rem ui-monospace, Menlo, Consolas, monospace; text-align: right; }
@media (max-width: 600px) { .he-sub { grid-template-columns: 2.6rem minmax(0, 1fr) 3rem; } .he-sub .he-bar { grid-column: 1 / -1; grid-row: 2; } }
.he-link { background: none; border: none; color: var(--accent-color); cursor: pointer; padding: 0; font-size: inherit; text-decoration: underline; }
.he-qhead { display: flex; justify-content: space-between; gap: .75rem; align-items: center; flex-wrap: wrap; font-size: .9rem; color: var(--text-secondary); }
.he-progress { height: 6px; background: rgba(127,127,127,.18); border-radius: 4px; margin: .5rem 0 1rem; overflow: hidden; }
.he-progress i { display: block; height: 100%; background: var(--accent-color); transition: width .3s; }
.he-qid { font: 600 .85rem ui-monospace, Menlo, Consolas, monospace; color: var(--text-secondary); }
.he-qid a { color: var(--accent-color); }
.he-qt { font-size: 1.2rem; font-weight: 600; margin: .4rem 0 .9rem; line-height: 1.45; }
.he-fig { margin: 0 0 1rem; text-align: center; }
.he-fig img { max-width: 100%; max-height: 360px; background: #fff; border-radius: 8px; padding: 6px; border: 1px solid var(--border-color); }
.he-fig figcaption { font-size: .8rem; color: var(--text-secondary); }
.he-answers { display: grid; gap: .5rem; }
.he-ans { display: grid; grid-template-columns: 2rem 1fr; gap: .6rem; align-items: center; text-align: left; padding: .75rem .9rem; border-radius: 10px; border: 2px solid var(--border-color); background: none; color: var(--text-primary); cursor: pointer; font-size: 1rem; transition: border-color .12s, background .12s; }
.he-ans b { display: inline-flex; width: 2rem; height: 2rem; border-radius: 50%; align-items: center; justify-content: center; background: rgba(127,127,127,.15); }
.he-ans:hover:not([disabled]) { border-color: var(--accent-color); }
.he-ans.picked { border-color: var(--accent-color); background: rgba(76,175,80,.12); }
.he-ans.right { border-color: #43a047; background: rgba(67,160,71,.18); }
.he-ans.right b { background: #43a047; color: #fff; }
.he-ans.wrong { border-color: #e53935; background: rgba(229,57,53,.15); animation: he-shake .3s; }
.he-ans.wrong b { background: #e53935; color: #fff; }
.he-ans.dim { opacity: .55; }
.he-ans[disabled] { cursor: default; }
@keyframes he-shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
@media (prefers-reduced-motion: reduce) { .he-ans.wrong { animation: none; } }
.he-feedback { font-weight: 700; margin: .75rem 0 0; }
.he-feedback.ok, .he-review .ok { color: #43a047; }
.he-feedback.bad, .he-review .bad { color: #e57373; }
.he-nav { display: flex; gap: .5rem; justify-content: flex-end; margin-top: 1rem; }
.btn.he-ghost { background: none; border: 1px solid var(--border-color); color: var(--text-primary); }
.he-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(2.2rem, 1fr)); gap: .3rem; margin-top: .75rem; }
.he-grid button { border: 1px solid var(--border-color); background: none; color: var(--text-secondary); border-radius: 6px; padding: .3rem 0; cursor: pointer; font: 600 .8rem ui-monospace, Menlo, monospace; }
.he-grid button.ans { background: rgba(76,175,80,.2); color: var(--text-primary); }
.he-grid button.cur { border-color: var(--accent-color); box-shadow: 0 0 0 1px var(--accent-color) inset; }
.he-result { display: grid; grid-template-columns: auto 1fr; gap: 1.25rem; align-items: center; }
@media (max-width: 600px) { .he-result { grid-template-columns: 1fr; justify-items: center; text-align: center; } }
.he-review { border-left: 3px solid #e57373; padding: .25rem 0 .25rem .75rem; margin: .75rem 0; }
.he-review p { margin: .2rem 0; }
.he-meta { color: var(--text-secondary); font-size: .9rem; margin: -.25rem 0 .75rem; }
/* Morse */
.mo-io { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
@media (max-width: 700px) { .mo-io { grid-template-columns: 1fr; } }
.mo-io textarea { width: 100%; min-height: 110px; font: 1.05rem ui-monospace, Menlo, Consolas, monospace; padding: .6rem; border-radius: 8px; border: 1px solid var(--border-color); background: var(--bg-primary); color: var(--text-primary); resize: vertical; }
.mo-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin: .75rem 0; }
.mo-lamp { width: 34px; height: 34px; border-radius: 50%; background: #3a2a00; border: 2px solid #5a4500; transition: background .03s, box-shadow .03s; flex: 0 0 auto; }
.mo-lamp.on { background: #ffd54f; box-shadow: 0 0 18px 6px rgba(255, 213, 79, .8); }
.mo-sliders { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .5rem 1rem; }
.mo-sliders label { font-size: .85rem; color: var(--text-secondary); display: flex; justify-content: space-between; }
.mo-sliders input { width: 100%; accent-color: var(--accent-color); }
.mo-tape { display: flex; gap: .35rem; overflow-x: auto; padding: .6rem; border-radius: 10px; background: #0d1b12; min-height: 70px; align-items: center; scroll-behavior: smooth; }
.mo-tape .ch { display: flex; flex-direction: column; align-items: center; padding: .3rem .4rem; border-radius: 6px; transition: background .1s; }
.mo-tape .ch b { color: #c8e6c9; font: 700 1rem ui-monospace, Menlo, monospace; }
.mo-tape .ch i { display: flex; gap: 3px; align-items: center; height: 12px; font-style: normal; }
.mo-tape .gap { width: 14px; flex: 0 0 auto; }
.mo-tape .dit, .mo-tape .dah { display: inline-block; height: 6px; border-radius: 3px; background: #66bb6a; }
.mo-tape .dit { width: 6px; } .mo-tape .dah { width: 18px; }
.mo-tape .ch.on { background: rgba(255, 213, 79, .2); }
.mo-tape .ch.on .dit, .mo-tape .ch.on .dah { background: #ffd54f; box-shadow: 0 0 6px #ffd54f; }
.mo-tree { width: 100%; height: auto; display: block; min-width: 900px; }
.mo-tree .edge { stroke-width: 2.5; opacity: .55; }
.mo-tree .edge.dot { stroke: #42a5f5; } .mo-tree .edge.dash { stroke: #ef5350; }
.mo-tree .edge.hot { opacity: 1; stroke-width: 5; stroke: #ffd54f; }
.mo-tree .node circle { fill: var(--bg-primary, #222); stroke: var(--text-secondary); stroke-width: 1.5; transition: fill .15s; }
.mo-tree .node.empty circle { fill: var(--text-secondary); stroke: none; opacity: .4; }
.mo-tree .node[data-ch] { cursor: pointer; }
.mo-tree .node[data-ch]:hover circle, .mo-tree .node[data-ch]:focus circle { stroke: var(--accent-color); stroke-width: 3; }
.mo-tree .node.hot circle { fill: #ffd54f; stroke: #ffb300; }
.mo-tree .node.hot text { fill: #222; }
.mo-tree .node.root circle { fill: var(--accent-color); stroke: none; }
.mo-tree text { font: 700 13px ui-monospace, Menlo, monospace; fill: var(--text-primary); text-anchor: middle; pointer-events: none; }
.mo-tree .root text { fill: #fff; }
.mo-tree .leg { font: 600 14px system-ui; fill: var(--text-secondary); text-anchor: start; }
.mo-tree .leg[text-anchor="end"] { text-anchor: end; }
.mo-chart { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: .35rem; }
.mo-key { display: flex; flex-direction: column; align-items: center; gap: .1rem; padding: .45rem .2rem; border-radius: 8px; border: 1px solid var(--border-color); background: none; color: var(--text-primary); cursor: pointer; }
.mo-key:hover { border-color: var(--accent-color); }
.mo-key b { font: 700 1.1rem ui-monospace, Menlo, monospace; }
.mo-key span { font: 700 1rem ui-monospace, Menlo, monospace; letter-spacing: 2px; color: var(--accent-color); }
.mo-key.pro b { font-size: .95rem; text-decoration: overline; }
.ko-chars { display: flex; flex-wrap: wrap; gap: 3px; margin: .5rem 0; }
.ko-chars span { font: 700 .9rem ui-monospace, Menlo, monospace; width: 1.7rem; text-align: center; padding: .2rem 0; border-radius: 4px; background: rgba(127,127,127,.12); color: var(--text-secondary); }
.ko-chars span.on { background: rgba(76,175,80,.25); color: var(--text-primary); }
.ko-chars span.new { background: #ffd54f; color: #222; }
#ko-input { width: 100%; font: 1.2rem ui-monospace, Menlo, monospace; text-transform: uppercase; letter-spacing: 2px; padding: .6rem; border-radius: 8px; border: 1px solid var(--border-color); background: var(--bg-primary); color: var(--text-primary); }
#ko-result { display: grid; grid-template-columns: auto 1fr; gap: 1rem; align-items: center; margin-top: .75rem; }
#ko-result:empty { display: none; }
.ko-score { font: 800 2.4rem system-ui; }
.ko-score.ok { color: #43a047; } .ko-score.bad { color: #e57373; }
/* DXCC map */
.dx-card { display: grid; grid-template-columns: auto 1fr; gap: 1rem; align-items: start; }
.dx-flag { min-width: 4.2rem; padding: .7rem .5rem; border-radius: 12px; color: #111; font: 800 1.3rem ui-monospace, Menlo, monospace; text-align: center; box-shadow: 0 4px 14px rgba(0,0,0,.25); }
.dx-card h3 { margin: 0 0 .25rem; }
.dx-card h3 small { font-weight: 400; color: var(--text-secondary); font-size: .8rem; }
.dx-card p { margin: .25rem 0; }
.dx-beam { font-size: 1.05rem; }
.dx-check { display: inline-flex; gap: .4rem; align-items: center; cursor: pointer; margin-top: .25rem; }
.dx-progress { height: 10px; border-radius: 6px; background: rgba(127,127,127,.2); overflow: hidden; margin-top: .35rem; }
.dx-progress i { display: block; height: 100%; background: linear-gradient(90deg, #43a047, #ffd54f); transition: width .5s; }
.ek-legend button { border: 1px solid var(--border-color); background: none; color: var(--text-primary); border-radius: 999px; padding: .2rem .65rem; cursor: pointer; font-size: .82rem; display: inline-flex; align-items: center; gap: .35rem; }
.ek-legend button i { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.ek-legend button.active { border-color: var(--accent-color); box-shadow: 0 0 0 1px var(--accent-color) inset; }
/* Q-codes & phonetics */
.qc-spell { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .75rem; min-height: 3rem; }
.qc-spell span { display: flex; flex-direction: column; align-items: center; padding: .4rem .6rem; border-radius: 10px; background: rgba(76,175,80,.12); border: 1px solid rgba(76,175,80,.35); }
.qc-spell span b { font: 800 1.3rem ui-monospace, Menlo, monospace; color: var(--accent-color); }
.qc-spell span small { font-size: .85rem; }
.qc-spell span.now { background: #ffd54f; border-color: #ffb300; } .qc-spell span.now b, .qc-spell span.now small { color: #222; }
.qc-alpha { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: .35rem; }
.qc-alpha button { display: grid; grid-template-columns: 1.6rem 1fr; align-items: center; gap: .3rem; text-align: left; border: 1px solid var(--border-color); background: none; color: var(--text-primary); border-radius: 8px; padding: .45rem .5rem; cursor: pointer; }
.qc-alpha button:hover { border-color: var(--accent-color); }
.qc-alpha b { font: 800 1.1rem ui-monospace, Menlo, monospace; color: var(--accent-color); }
.qc-alpha small { display: block; color: var(--text-secondary); font-size: .72rem; }
.qc-rst { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .75rem; }
.qc-rst ol { margin: 0; padding-left: 1.4rem; }
.qc-rst li { margin: .15rem 0; font-size: .92rem; }
.qc-rst select { width: 100%; }
.qc-report { font: 800 2.6rem ui-monospace, Menlo, monospace; color: var(--accent-color); text-align: center; letter-spacing: .3rem; }
