:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --panel-2: #eef3fb;
  --text: #151922;
  --muted: #667089;
  --line: #d7deea;
  --accent: #2962ff;
  --accent-soft: rgba(41, 98, 255, 0.12);
  --ok: #0f9d58;
  --warn: #e68900;
  --bad: #d93025;
  --shadow: 0 20px 50px rgba(17, 24, 39, 0.08);
}
* { box-sizing: border-box; }
body { margin-top: 70px; padding: 0; background: var(--bg); color: var(--text); font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Noto Sans KR",sans-serif; }
button, select, textarea { font: inherit; }
button { cursor: pointer; }
.tc-app { max-width: 100%; margin: 0; padding: 24px 0 60px; }
.panel, .primary-tabs { background: var(--panel); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); }
.status-strip { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 14px; }
.tc-header { display: flex; justify-content: space-between; gap: 20px; padding: 28px; align-items: flex-start; }
.tc-header-sub { margin: 6px 0 0; color: var(--muted); font-size: 15px; }
.eyebrow { margin: 0 0 10px; color: var(--accent); font-weight: 700; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; }
h1, h2, h3, h4, p { margin-top: 0; }
h1 { margin-bottom: 10px; font-size: 34px; }
.lead { margin-bottom: 0; max-width: 900px; line-height: 1.6; color: var(--muted); }
.header-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.tc-btn, .icon-btn { border: 1px solid transparent; background: var(--accent); color: #fff; border-radius: 14px; padding: 12px 16px; font-weight: 700; }
.tc-btn.ghost, .icon-btn { background: var(--panel-2); color: var(--text); border-color: var(--line); }
.status-strip { display: grid; grid-template-columns: repeat(8, minmax(0,1fr)); gap: 12px; padding: 16px; }
.metric-card { background: var(--panel-2); border-radius: 18px; padding: 14px; border: 1px solid var(--line); }
.metric-card span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.metric-card strong { font-size: 20px; }
.primary-tabs { display: flex; gap: 10px; flex-wrap: wrap; padding: 14px; margin-top: 0; overflow-x: auto; }
.primary-tab { border: 1px solid var(--line); background: var(--panel-2); color: var(--text); padding: 12px 16px; border-radius: 14px; font-weight: 700; }
.primary-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.tc-main { display: block; margin-top: 16px; }
.content-area { display: flex; flex-direction: column; gap: 16px; }
.panel { padding: 20px; }
.panel.compact { padding: 18px; }
.panel-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 18px; }
.panel-head.mini { margin-bottom: 14px; }
.hero-panel { min-height: 300px; }
.pill-group { display: flex; gap: 8px; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; gap: 8px; border-radius: 999px; padding: 8px 12px; font-size: 12px; font-weight: 700; }
.pill.done { background: rgba(15,157,88,.12); color: var(--ok); }
.pill.pending { background: rgba(230,137,0,.12); color: var(--warn); }
.typing-target-wrap { display: grid; gap: 12px; }
.target-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: 14px; }
.typing-target { min-height: 120px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 18px; padding: 18px; font-size: 24px; line-height: 1.8; word-break: break-word; }
.typing-target .char { border-radius: 8px; padding: 1px 0; }
.typing-target .char.done { color: var(--ok); }
.typing-target .char.current { background: var(--accent-soft); box-shadow: inset 0 -2px 0 var(--accent); }
.typing-target .char.error { color: var(--bad); background: rgba(217,48,37,.12); }
.typing-input-label { display: grid; gap: 8px; font-weight: 700; }
.typing-input { width: 100%; background: var(--panel-2); color: var(--text); border: 1px solid var(--line); border-radius: 16px; padding: 16px; resize: vertical; min-height: 120px; }
.subtabs { display: grid; gap: 8px; }
.subtabs.horizontal { display:flex; flex-wrap:wrap; gap:10px; }
.subtabs.horizontal .subtab-btn { width:auto; min-width:140px; }
.subtab-btn { width: 100%; text-align: left; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); border-radius: 14px; padding: 12px 14px; font-weight: 700; }
.subtab-btn.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.progress-checklist { margin: 0; padding-left: 18px; color: var(--muted); display: grid; gap: 10px; }
.control-grid { display: grid; gap: 12px; }
.control-grid label { display: grid; gap: 8px; font-weight: 700; }
.control-grid select { border: 1px solid var(--line); background: var(--panel-2); color: var(--text); border-radius: 12px; padding: 12px; }
.control-actions { display: flex; gap: 10px; margin-top: 14px; }
.legend { display: flex; gap: 8px; flex-wrap: wrap; }
.legend-item { padding: 6px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; border: 1px solid transparent; }
.left-pinky { background: rgba(255, 82, 82, 0.14); }
.left-ring { background: rgba(255, 145, 0, 0.14); }
.left-middle { background: rgba(255, 202, 40, 0.14); }
.left-index { background: rgba(38, 198, 218, 0.14); }
.thumbs { background: rgba(102, 187, 106, 0.14); }
.right-index { background: rgba(3, 169, 244, 0.14); }
.right-middle { background: rgba(126, 87, 194, 0.14); }
.right-ring { background: rgba(171, 71, 188, 0.14); }
.right-pinky { background: rgba(236, 64, 122, 0.14); }
.hand-wireframe { display:block; }
.hand { position: relative; height: 120px; border: 2px dashed var(--line); border-radius: 30px; background: linear-gradient(180deg, transparent, rgba(255,255,255,0.03)); }
.hand .finger { position: absolute; display: block; width: 16%; border: 2px solid var(--line); border-radius: 999px; height: 72px; top: -22px; }
.hand .thumb { width: 28%; height: 52px; bottom: -4px; top: auto; transform: rotate(25deg); }
.left-hand .f1 { left: 4%; }
.left-hand .f2 { left: 24%; height: 80px; }
.left-hand .f3 { left: 44%; height: 86px; }
.left-hand .f4 { left: 64%; height: 78px; }
.left-hand .thumb { left: 10%; }
.right-hand .f4 { left: 4%; height: 78px; }
.right-hand .f3 { left: 24%; height: 86px; }
.right-hand .f2 { left: 44%; height: 80px; }
.right-hand .f1 { left: 64%; }
.right-hand .thumb { right: 10%; transform: rotate(-25deg); left: auto; }
.hand.active-left .finger, .hand.active-right .finger { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.keyboard-shell { display: grid; gap: 8px; }
.keyboard-row { display: grid; gap: 8px; grid-template-columns: repeat(15, minmax(0,1fr)); }
.key { min-height: 56px; border: 1px solid var(--line); background: var(--panel-2); border-radius: 14px; padding: 8px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 2px; position: relative; }
.key small { color: var(--muted); font-size: 11px; }
.key.active { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.key.pressed { transform: translateY(1px); }
.key.finger-left-pinky { background-image: linear-gradient(180deg, rgba(255,82,82,.11), transparent); }
.key.finger-left-ring { background-image: linear-gradient(180deg, rgba(255,145,0,.11), transparent); }
.key.finger-left-middle { background-image: linear-gradient(180deg, rgba(255,202,40,.11), transparent); }
.key.finger-left-index { background-image: linear-gradient(180deg, rgba(38,198,218,.11), transparent); }
.key.finger-thumb { background-image: linear-gradient(180deg, rgba(102,187,106,.11), transparent); }
.key.finger-right-index { background-image: linear-gradient(180deg, rgba(3,169,244,.11), transparent); }
.key.finger-right-middle { background-image: linear-gradient(180deg, rgba(126,87,194,.11), transparent); }
.key.finger-right-ring { background-image: linear-gradient(180deg, rgba(171,71,188,.11), transparent); }
.key.finger-right-pinky { background-image: linear-gradient(180deg, rgba(236,64,122,.11), transparent); }
.analysis-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.analysis-card { background: var(--panel-2); border: 1px solid var(--line); border-radius: 18px; padding: 16px; }
.analysis-card ul { margin: 0; padding-left: 18px; line-height: 1.9; }
.modal.hidden { display: none; }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.52); display: flex; align-items: center; justify-content: center; padding: 24px; z-index: 1000; }
.modal-card { width: min(900px, 100%); max-height: 85vh; overflow: auto; background: var(--panel); color: var(--text); border-radius: 22px; border: 1px solid var(--line); box-shadow: var(--shadow); }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 22px 22px 0; }
.modal-body { padding: 22px; }
.modal-body section { margin-bottom: 22px; }
.code-inline { font-family: ui-monospace,SFMono-Regular,Menlo,monospace; background: var(--panel-2); border: 1px solid var(--line); padding: 2px 6px; border-radius: 8px; }
@media (max-width: 1280px) {
  .status-strip { grid-template-columns: repeat(3, minmax(0,1fr)); }
}
@media (max-width: 768px) {
  .tc-app { padding: 16px; }
  .tc-header { flex-direction: column; }
  .status-strip { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .analysis-grid { grid-template-columns: 1fr; }
  .hand-wireframe { grid-template-columns: 1fr; }
  .keyboard-row { grid-template-columns: repeat(10, minmax(0,1fr)); }
}

.control-actions.wrap{flex-wrap:wrap;}
.hidden-panel{display:none!important;}
.typing-target .char.typed{opacity:.7;}

.result-grid{display:grid;grid-template-columns:1.4fr 1fr 1fr;gap:14px;margin-top:14px;}
.result-card-wide p{margin:8px 0 12px;line-height:1.7;}
.chip-row{display:flex;flex-wrap:wrap;gap:8px;}
@media (max-width: 980px){.result-grid{grid-template-columns:1fr;}}


.keyboard-coach-grid{grid-template-columns:repeat(3,minmax(0,1fr));}
.coach-summary-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin-top:14px;}
.coach-tip{margin-top:12px;padding:12px 14px;border-radius:14px;background:rgba(99,102,241,.08);line-height:1.6;}
.key.focus-row{box-shadow:inset 0 0 0 2px rgba(59,130,246,.18);}
.key.focus-finger{box-shadow:inset 0 0 0 2px rgba(16,185,129,.22);}
.key.active{transform:translateY(-2px) scale(1.02);border-color:#6366f1;box-shadow:0 12px 30px rgba(99,102,241,.22);}
.hand .finger.active-finger{background:#6366f1;border-color:#6366f1;box-shadow:0 0 0 4px rgba(99,102,241,.18);}
@media (max-width: 1024px){.coach-summary-grid{grid-template-columns:repeat(2,minmax(0,1fr));}.keyboard-coach-grid{grid-template-columns:repeat(2,minmax(0,1fr));}.compact-inline-controls{grid-template-columns:repeat(2,minmax(0,1fr));}}
@media (max-width: 720px){.coach-summary-grid,.keyboard-coach-grid{grid-template-columns:1fr;}.compact-inline-controls{grid-template-columns:1fr;}}


.top-controls-panel { padding: 18px 20px; }
.top-controls-header { display:flex; justify-content:space-between; align-items:flex-start; gap:16px; margin-bottom:16px; }
.top-controls-grid { display:grid; grid-template-columns: 1.1fr 2.4fr; gap:16px; align-items:start; }
.top-control-block { background: var(--panel-2); border: 1px solid var(--line); border-radius: 18px; padding: 16px; }
.top-inline-controls { grid-template-columns: repeat(4, minmax(0,1fr)); }
.compact-checklist-trigger { white-space: nowrap; }
.segment-meta { margin-top: -2px; color: var(--muted); font-size: 13px; font-weight: 700; }
.keyboard-stage { position: relative; padding-top: 150px; }
.keyboard-hands { position: absolute; inset: 0 12px auto 12px; height: 150px; pointer-events: none; }
.keyboard-hand { position: absolute; top: 18px; width: 45%; height: 118px; }
.keyboard-hand.left-hand { left: 2%; }
.keyboard-hand.right-hand { right: 2%; }
.keyboard-hand .palm { position:absolute; left: 14%; right: 14%; bottom: 0; height: 60px; border: 2px solid var(--line); border-radius: 34px 34px 26px 26px; background: rgba(99,102,241,.06); }
.keyboard-hand .finger { position:absolute; bottom: 40px; width: 14%; border: 2px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.12); }
.keyboard-hand .thumb { width: 22%; height: 42px; bottom: 8px; }
.keyboard-hand.left-hand .f1 { left: 8%; height: 78px; }
.keyboard-hand.left-hand .f2 { left: 24%; height: 88px; }
.keyboard-hand.left-hand .f3 { left: 40%; height: 96px; }
.keyboard-hand.left-hand .f4 { left: 57%; height: 86px; }
.keyboard-hand.left-hand .thumb { left: 2%; transform: rotate(28deg); }
.keyboard-hand.right-hand .f4 { left: 8%; height: 86px; }
.keyboard-hand.right-hand .f3 { left: 25%; height: 96px; }
.keyboard-hand.right-hand .f2 { left: 41%; height: 88px; }
.keyboard-hand.right-hand .f1 { left: 58%; height: 78px; }
.keyboard-hand.right-hand .thumb { right: 2%; left:auto; transform: rotate(-28deg); }
.keyboard-hand.active-left .palm, .keyboard-hand.active-right .palm { border-color: var(--accent); box-shadow: 0 0 0 5px var(--accent-soft); }
.keyboard-hand .finger.active-finger { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 5px var(--accent-soft); }
.keyboard-shell { display: grid; gap: 8px; position: relative; z-index: 2; }
.keyboard-row { display: grid; gap: 8px; grid-template-columns: repeat(15, minmax(0,1fr)); }
.key strong { font-size: 15px; }
.key small { text-transform: capitalize; }
.hidden-panel { display:none !important; }
@media (max-width: 1280px) {
  .top-controls-grid { grid-template-columns: 1fr; }
  .top-inline-controls { grid-template-columns: repeat(3, minmax(0,1fr)); }
}
@media (max-width: 900px) {
  .top-inline-controls { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .keyboard-stage { padding-top: 120px; }
  .keyboard-hands { height: 120px; }
}
@media (max-width: 720px) {
  .top-controls-header { flex-direction: column; }
  .top-inline-controls { grid-template-columns: 1fr; }
  .subtabs.horizontal .subtab-btn { width: 100%; }
  .keyboard-stage { padding-top: 0; }
  .keyboard-hands { display:none; }
}


/* v8 keyboard layout fixes */
.top-controls-grid { grid-template-columns: 1fr !important; gap: 10px; }
.top-control-block { background: transparent; border: 0; border-radius: 0; padding: 0; }
.top-control-block h3 { margin: 0 0 10px; }
.top-inline-controls { grid-template-columns: repeat(4, minmax(0,1fr)); }
.top-controls-panel { padding: 18px 20px 14px; }
.keyboard-panel { overflow: hidden; }
.keyboard-stage { padding-top: 132px; }
.keyboard-hands { inset: 0 28px auto 28px; height: 132px; }
.keyboard-hand { top: 10px; width: 46%; height: 112px; }
.keyboard-hand.left-hand { left: 1.5%; }
.keyboard-hand.right-hand { right: 1.5%; }
.keyboard-hand .palm { left: 16%; right: 16%; height: 56px; }
.keyboard-hand .finger { bottom: 36px; width: 14%; }
.keyboard-hand.left-hand .thumb { left: 0; }
.keyboard-hand.right-hand .thumb { right: 0; }
.segment-meta { margin-top: 6px; }
@media (max-width: 1180px) { .top-inline-controls { grid-template-columns: repeat(3, minmax(0,1fr)); } }
@media (max-width: 860px) { .top-inline-controls { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 720px) {
  .top-inline-controls { grid-template-columns: 1fr; }
  .keyboard-stage { padding-top: 96px; }
  .keyboard-hands { height: 96px; inset-inline: 14px; }
}


/* v9 keyboard hand realism + top bar cleanup */
.top-controls-header{align-items:center;margin-bottom:12px;}
.top-controls-grid{display:flex!important;flex-direction:column;gap:14px;}
.top-control-block{display:block;}
.top-control-block h3{margin:0 0 8px;font-size:14px;}
.subtabs.horizontal{display:flex;flex-wrap:nowrap;gap:10px;overflow-x:auto;padding-bottom:4px;scrollbar-width:thin;}
.subtabs.horizontal .subtab-btn{flex:0 0 auto;white-space:nowrap;}
.top-inline-controls{display:flex!important;flex-wrap:nowrap;gap:10px;overflow-x:auto;padding-bottom:4px;}
.top-inline-controls label{flex:0 0 155px;min-width:155px;}
.control-actions.wrap{margin-top:10px;}
.keyboard-stage{padding-top:0;}
.keyboard-hands{position:absolute;inset:0;z-index:4;pointer-events:none;overflow:hidden;}
.keyboard-shell{position:relative;z-index:2;padding-top:142px;}
.keyboard-row:first-child{margin-top:0;}
.keyboard-hand{top:138px;width:46%;height:240px;opacity:.92;filter:drop-shadow(0 18px 24px rgba(0,0,0,.08));}
.keyboard-hand.left-hand{left:4.5%;}
.keyboard-hand.right-hand{right:4.5%;}
.keyboard-hand .palm{left:20%;right:20%;bottom:8px;height:116px;border:0;border-radius:46px 46px 40px 40px;background:linear-gradient(180deg, rgba(123,128,146,.26), rgba(77,83,106,.22));box-shadow:inset 0 0 0 1px rgba(255,255,255,.55);}
.keyboard-hand .finger{bottom:98px;width:15%;border:0;border-radius:999px;background:linear-gradient(180deg, rgba(123,128,146,.24), rgba(87,93,117,.18));box-shadow:inset 0 0 0 1px rgba(255,255,255,.5);transform:translate(var(--finger-dx,0px), var(--finger-dy,0px)) rotate(var(--finger-rot,0deg));transform-origin:50% 90%;transition:transform .18s ease, background .18s ease, box-shadow .18s ease, opacity .18s ease;opacity:.88;}
.keyboard-hand .thumb{width:26%;height:60px;bottom:38px;transform:translate(var(--finger-dx,0px), var(--finger-dy,0px)) rotate(var(--finger-rot,0deg));transform-origin:22% 62%;}
.keyboard-hand.left-hand .f1{left:12%;height:112px;}
.keyboard-hand.left-hand .f2{left:28%;height:132px;}
.keyboard-hand.left-hand .f3{left:44%;height:144px;}
.keyboard-hand.left-hand .f4{left:60%;height:132px;}
.keyboard-hand.left-hand .thumb{left:3%;transform:translate(var(--finger-dx,0px), var(--finger-dy,0px)) rotate(28deg) rotate(var(--finger-rot,0deg));}
.keyboard-hand.right-hand .f4{left:12%;height:132px;}
.keyboard-hand.right-hand .f3{left:28%;height:144px;}
.keyboard-hand.right-hand .f2{left:44%;height:132px;}
.keyboard-hand.right-hand .f1{left:60%;height:112px;}
.keyboard-hand.right-hand .thumb{right:3%;left:auto;transform:translate(var(--finger-dx,0px), var(--finger-dy,0px)) rotate(-28deg) rotate(var(--finger-rot,0deg));}
.keyboard-hand.active-left .palm,.keyboard-hand.active-right .palm{background:linear-gradient(180deg, rgba(123,128,146,.28), rgba(77,83,106,.25));}
.keyboard-hand .finger.active-finger,.keyboard-hand .thumb.active-finger{background:linear-gradient(180deg, rgba(99,102,241,.6), rgba(99,102,241,.38));box-shadow:0 0 0 4px rgba(99,102,241,.14), inset 0 0 0 1px rgba(255,255,255,.7);opacity:1;z-index:3;}
.key.active{z-index:5;}
.keyboard-panel{padding-bottom:18px;}
@media (max-width:1180px){.keyboard-shell{padding-top:128px;}.keyboard-hand{top:124px;height:216px;}}
@media (max-width:960px){.top-inline-controls label{flex-basis:140px;min-width:140px;}.keyboard-shell{padding-top:112px;}.keyboard-hand{top:112px;height:180px;}.keyboard-hand .palm{height:86px;}.keyboard-hand .finger{bottom:76px;}}
@media (max-width:720px){.keyboard-hands{display:none;}.keyboard-shell{padding-top:0;}}

/* v10 keyboard realism + hand visibility */
.keyboard-stage{padding-top:0;min-height:420px;}
.keyboard-shell{position:relative;z-index:2;padding-top:110px;gap:10px;}
.keyboard-row{display:grid;grid-template-columns:repeat(30,minmax(0,1fr));gap:8px;margin-left:var(--row-offset,0);align-items:stretch;}
.key{min-height:64px;border-radius:12px;background:linear-gradient(180deg,#f8fbff,#e8eef8);border:1px solid #cfd8e8;box-shadow:0 1px 0 rgba(255,255,255,.9) inset,0 2px 8px rgba(18,31,53,.05);}
.key strong{font-size:14px;line-height:1;}
.key small{font-size:10px;opacity:.9;}
.key[data-key="Enter"], .key[data-key="Back"]{font-size:1.02em;}
.key[data-key="Space"]{justify-content:center;align-items:flex-start;padding-top:14px;}
.keyboard-hands{position:absolute;left:0;right:0;top:0;height:330px;z-index:4;pointer-events:none;overflow:visible;}
.keyboard-hand{top:108px;width:47%;height:190px;opacity:1;filter:drop-shadow(0 18px 24px rgba(0,0,0,.18));}
.keyboard-hand.left-hand{left:5%;}
.keyboard-hand.right-hand{right:5%;}
.keyboard-hand .palm{left:21%;right:21%;bottom:12px;height:94px;border:1px solid rgba(90,95,110,.25);border-radius:42px 42px 32px 32px;background:linear-gradient(180deg, rgba(160,166,183,.68), rgba(115,121,139,.54));box-shadow:inset 0 0 0 1px rgba(255,255,255,.58);}
.keyboard-hand .finger,
.keyboard-hand .thumb{border:1px solid rgba(90,95,110,.22);background:linear-gradient(180deg, rgba(172,178,194,.78), rgba(124,130,148,.62));box-shadow:inset 0 0 0 1px rgba(255,255,255,.6), 0 4px 12px rgba(35,42,55,.08);opacity:.97;}
.keyboard-hand .finger{bottom:88px;width:15%;transform:translate(var(--finger-dx,0px), var(--finger-dy,0px)) rotate(var(--finger-rot,0deg));transform-origin:50% 88%;transition:transform .16s ease, background .16s ease, box-shadow .16s ease;}
.keyboard-hand .thumb{width:29%;height:54px;bottom:46px;}
.keyboard-hand.left-hand .f1{left:13%;height:102px;}
.keyboard-hand.left-hand .f2{left:28%;height:118px;}
.keyboard-hand.left-hand .f3{left:43%;height:128px;}
.keyboard-hand.left-hand .f4{left:58%;height:120px;}
.keyboard-hand.left-hand .thumb{left:0;transform:translate(var(--finger-dx,0px), var(--finger-dy,0px)) rotate(30deg) rotate(var(--finger-rot,0deg));transform-origin:25% 60%;}
.keyboard-hand.right-hand .f4{left:13%;height:120px;}
.keyboard-hand.right-hand .f3{left:28%;height:128px;}
.keyboard-hand.right-hand .f2{left:43%;height:118px;}
.keyboard-hand.right-hand .f1{left:58%;height:102px;}
.keyboard-hand.right-hand .thumb{right:0;left:auto;transform:translate(var(--finger-dx,0px), var(--finger-dy,0px)) rotate(-30deg) rotate(var(--finger-rot,0deg));transform-origin:75% 60%;}
.keyboard-hand .finger.active-finger,
.keyboard-hand .thumb.active-finger{background:linear-gradient(180deg, rgba(62,103,255,.95), rgba(62,103,255,.72));border-color:rgba(48,81,216,.7);box-shadow:0 0 0 4px rgba(62,103,255,.18), inset 0 0 0 1px rgba(255,255,255,.9), 0 8px 18px rgba(62,103,255,.24);}
.keyboard-hand.active-left .palm,
.keyboard-hand.active-right .palm{box-shadow:0 0 0 4px rgba(62,103,255,.09), inset 0 0 0 1px rgba(255,255,255,.66);}
.key.active{transform:translateY(-2px);box-shadow:0 10px 20px rgba(63,81,181,.22), inset 0 0 0 1px rgba(63,81,181,.55);}
.key.focus-row{box-shadow:inset 0 0 0 2px rgba(59,130,246,.16);}
.key.focus-finger{box-shadow:inset 0 0 0 2px rgba(16,185,129,.2);}

@media (max-width: 1100px){
  .keyboard-shell{padding-top:96px;}
  .keyboard-hands{height:290px;}
  .keyboard-hand{top:96px;height:170px;}
}
@media (max-width: 860px){
  .keyboard-shell{padding-top:82px;}
  .keyboard-row{gap:6px;}
  .key{min-height:54px;padding:6px;}
  .keyboard-hands{height:240px;}
  .keyboard-hand{top:84px;height:145px;}
  .keyboard-hand .palm{height:74px;}
  .keyboard-hand .finger{bottom:70px;}
}
@media (max-width: 720px){
  .keyboard-hands{display:none;}
  .keyboard-shell{padding-top:0;}
}


/* ─── v20 손 일러스트 + 완료 오버레이 + 전체 폴리시 ─── */

/* 손 스킨톤: 기존 gray fill → 피부색 그라디언트 */
.keyboard-hand .wrist { fill:url(#gSkinWrist); stroke:rgba(155,100,55,.38); stroke-width:1.4; }
.keyboard-hand .palm  { fill:url(#gSkinPalm);  stroke:rgba(155,100,55,.36); stroke-width:1.4; filter:drop-shadow(0 10px 20px rgba(18,26,46,.14)); }
.keyboard-hand .finger,
.keyboard-hand .thumb { fill:url(#gSkinFinger); stroke:rgba(150,96,48,.32); stroke-width:1.4; }

/* 손톱 */
.keyboard-hand .nail {
  fill: url(#gNail);
  stroke: rgba(185,145,95,.50);
  stroke-width: 0.9;
  opacity: 0.88;
  pointer-events: none;
}

/* 관절 하이라이트 */
.keyboard-hand .knuckle {
  fill: rgba(255,255,255,0.32);
  stroke: none;
  pointer-events: none;
}

/* 손금 라인 */
.keyboard-hand .crease { pointer-events: none; }

/* 활성 손가락: 더 선명한 블루 */
.keyboard-hand .finger.active-finger,
.keyboard-hand .thumb.active-finger {
  fill: rgba(37,99,235,.92) !important;
  stroke: rgba(29,78,216,.98) !important;
  filter: drop-shadow(0 0 14px rgba(37,99,235,.38)) !important;
  opacity: 1 !important;
}

/* 활성 손: 손바닥 미세 강조 */
.keyboard-hand.active-left .palm,
.keyboard-hand.active-right .palm {
  filter: drop-shadow(0 10px 20px rgba(18,26,46,.14)) brightness(1.06);
}

/* ── 완료 오버레이 ── */
.completion-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
}
.completion-overlay.show {
  animation: completionAnim .55s cubic-bezier(.34,1.56,.64,1) forwards;
}
.completion-overlay span {
  width: 120px; height: 120px;
  display: flex; align-items: center; justify-content: center;
  font-size: 58px; line-height: 1;
  border-radius: 50%;
  background: linear-gradient(145deg, #22c55e, #16a34a);
  color: #fff;
  box-shadow: 0 0 0 18px rgba(34,197,94,.12), 0 24px 56px rgba(22,163,74,.28);
}
@keyframes completionAnim {
  0%   { opacity:0; transform:scale(.4); }
  55%  { opacity:1; transform:scale(1.12); }
  80%  { transform:scale(.96); }
  100% { opacity:1; transform:scale(1); }
}

/* ── 타이핑 목표 영역 폴리시 ── */
.typing-target { border:1.5px solid var(--line); letter-spacing:.01em; }
.typing-target .char { transition: color .08s, background .08s; }
.typing-target .char.current { background:rgba(41,98,255,.12); box-shadow:inset 0 -2.5px 0 var(--accent); border-radius:4px; }
.typing-target .char.done    { color:#16a34a; }
.typing-target .char.error   { color:#dc2626; background:rgba(220,38,38,.10); border-radius:4px; }

/* ── 상태 스트립 폴리시 ── */
.metric-card { transition: background .18s; }
.metric-card strong { letter-spacing:-.01em; }

/* ── 키보드 키 폴리시 ── */
.key { transition: transform .08s, box-shadow .08s, background .12s; }
.key.active { background: linear-gradient(180deg,#eef3ff,#dde8ff) !important; border-color:#4f6ef7 !important; box-shadow: 0 6px 18px rgba(62,81,255,.18), inset 0 0 0 1px rgba(62,81,255,.45) !important; }
.key.pressed { transform: translateY(2px) scale(.97); box-shadow:none; }

/* ── 탭 버튼 폴리시 ── */
.primary-tab { transition: background .14s, border-color .14s, color .14s; }
.primary-tab:hover:not(.active) { background:var(--accent-soft); border-color:rgba(41,98,255,.22); }
.subtab-btn { transition: background .14s, border-color .14s, color .14s; }

/* ── 완료 힌트 강조 ── */
#analysisHint { font-weight:700; transition: color .2s; }



/* v11 keyboard realistic hand + compact inline practice */
.keyboard-practice-mount{margin:10px 0 14px;}
.keyboard-practice-mount .typing-target-wrap{background:var(--panel-2);border:1px solid var(--line);border-radius:18px;padding:12px 14px;}
.keyboard-practice-mount .target-meta{margin-bottom:6px;}
.keyboard-practice-mount .segment-meta{margin:0 0 8px;font-size:12px;}
.keyboard-practice-mount .typing-target{min-height:46px;padding:12px 14px;font-size:clamp(24px,3vw,34px);line-height:1.35;}
.keyboard-practice-mount .typing-input-label{display:block;margin-top:8px;font-size:12px;color:var(--muted);}
.keyboard-practice-mount .typing-input{min-height:60px;padding:10px 12px;font-size:18px;line-height:1.45;}
.keyboard-practice-mount .typing-target .char{padding:0 2px;}
.keyboard-hands{position:absolute;inset:0 0 auto 0;height:260px;z-index:4;pointer-events:none;overflow:visible;}
.keyboard-shell{position:relative;z-index:2;padding-top:136px;}
.keyboard-hand{opacity:.98;transform:translate(var(--hand-dx,0px), var(--hand-dy,0px));transition:transform .18s ease, opacity .18s ease;}
.keyboard-hand .palm,.keyboard-hand .finger,.keyboard-hand .thumb{fill:rgba(122,128,146,.33);stroke:rgba(93,100,122,.58);stroke-width:2.2;vector-effect:non-scaling-stroke;transition:transform .18s ease, fill .18s ease, filter .18s ease, opacity .18s ease;transform-box:fill-box;transform-origin:center 86%;}
.keyboard-hand .finger,.keyboard-hand .thumb{transform:translate(var(--finger-dx,0px), var(--finger-dy,0px)) rotate(var(--finger-rot,0deg));}
.keyboard-hand .palm{filter:drop-shadow(0 10px 16px rgba(15,23,42,.10));}
.keyboard-hand .finger.active-finger,.keyboard-hand .thumb.active-finger{fill:rgba(59,130,246,.72);stroke:rgba(37,99,235,.92);filter:drop-shadow(0 0 10px rgba(59,130,246,.32));}
.keyboard-hand.active-left .palm,.keyboard-hand.active-right .palm{fill:rgba(122,128,146,.40);}
.keyboard-row{grid-template-columns:repeat(30,minmax(0,1fr));margin-left:var(--row-offset,0);}
.key{grid-column:span 2;min-height:64px;}
.keyboard-row-4 .key[data-key='Space']{grid-column:3 / span 13;}
.keyboard-row-2 .key[data-key='Enter']{grid-column:span 4;}
.keyboard-row-0 .key[data-key='Back']{grid-column:span 4;}
.keyboard-row-3 .key[data-key='Shift']:last-child{grid-column:span 5;}
.key strong{font-size:17px;}
.key small{font-size:12px;}
.top-control-block h3{font-size:13px;}
@media (max-width:960px){.keyboard-shell{padding-top:112px;}.keyboard-hands{height:220px;}.key{min-height:58px;}.keyboard-practice-mount .typing-target{font-size:24px;}}
@media (max-width:720px){.keyboard-hands{display:none;}.keyboard-shell{padding-top:0;}.keyboard-practice-mount .typing-target{font-size:20px;}.keyboard-row{margin-left:0;grid-template-columns:repeat(20,minmax(0,1fr));}.key{grid-column:span 2;}}


/* v12 keyboard compact layout + inline meta + improved hand positioning */
.keyboard-practice-mount{margin:6px 0 10px;}
.keyboard-practice-mount .typing-target-wrap{padding:8px 10px;border-radius:16px;gap:8px;}
.compact-meta{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:0;}
.target-meta-right{display:flex;align-items:center;gap:10px;color:var(--muted);font-size:12px;font-weight:700;}
.keyboard-practice-mount .segment-meta{margin:0;font-size:12px;}
.keyboard-practice-mount #engineStateLabel{font-size:12px;}
.input-label-hidden{display:block;margin-top:4px;}
.input-label-hidden::before{display:none;}
.keyboard-practice-mount .typing-target{min-height:24px;padding:8px 10px;font-size:clamp(18px,2.2vw,26px);line-height:1.2;border-radius:14px;}
.keyboard-practice-mount .typing-input{min-height:42px;max-height:56px;padding:8px 10px;font-size:15px;line-height:1.3;border-radius:14px;}
.keyboard-practice-mount .typing-input::placeholder{font-size:15px;}
.keyboard-practice-mount .typing-input-label{font-size:0;margin:0;}
.keyboard-stage{min-height:360px;}
.keyboard-hands{height:225px;top:0;overflow:visible;}
.keyboard-shell{padding-top:92px;}
.keyboard-hand{opacity:.98;transition:transform .18s ease, opacity .18s ease;}
.keyboard-hand.left-hand{transform:translate(-54px,60px) scale(.82) translate(var(--hand-dx,0px), var(--hand-dy,0px));transform-origin:300px 300px;}
.keyboard-hand.right-hand{transform:translate(54px,60px) scale(.82) translate(var(--hand-dx,0px), var(--hand-dy,0px));transform-origin:900px 300px;}
.keyboard-hand .palm,.keyboard-hand .finger,.keyboard-hand .thumb{fill:rgba(138,145,160,.30);stroke:rgba(92,99,119,.62);stroke-width:1.8;filter:none;}
.keyboard-hand .palm{fill:rgba(132,139,154,.24);filter:drop-shadow(0 8px 12px rgba(15,23,42,.10));}
.keyboard-hand .finger,.keyboard-hand .thumb{fill:rgba(147,154,170,.34);}
.keyboard-hand .finger.active-finger,.keyboard-hand .thumb.active-finger{fill:rgba(59,130,246,.88);stroke:rgba(37,99,235,.95);filter:drop-shadow(0 0 10px rgba(59,130,246,.25));}
.keyboard-hand.active-left .palm,.keyboard-hand.active-right .palm{fill:rgba(132,139,154,.30);}
.keyboard-row{gap:6px;}
.key{min-height:60px;border-radius:12px;}
.key strong{font-size:15px;}
.key small{font-size:11px;}
@media (max-width:960px){.keyboard-hands{height:205px;}.keyboard-shell{padding-top:82px;}.keyboard-hand.left-hand{transform:translate(-44px,56px) scale(.76) translate(var(--hand-dx,0px), var(--hand-dy,0px));}.keyboard-hand.right-hand{transform:translate(44px,56px) scale(.76) translate(var(--hand-dx,0px), var(--hand-dy,0px));}.keyboard-practice-mount .typing-input{min-height:40px;}}
@media (max-width:720px){.keyboard-hands{display:none;}.keyboard-shell{padding-top:0;}}

/* v13 top section compact redesign */
.compact-top-header{align-items:center;gap:14px;margin-bottom:10px;}
.compact-top-header h2{font-size:22px;margin:0;}
.header-inline-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:flex-end;}
.tc-btn.mini{padding:8px 12px;border-radius:11px;font-size:13px;line-height:1.1;}
.compact-checklist-trigger{font-size:13px;padding:8px 12px;border-radius:11px;}
.compact-top-grid{display:grid!important;grid-template-columns:1fr;gap:10px;}
.compact-top-block h3{font-size:13px;margin:0 0 6px;color:var(--muted);}
.compact-subtabs{gap:8px;padding-bottom:0;overflow:visible;flex-wrap:wrap;}
.compact-subtabs .subtab-btn{min-width:110px;padding:9px 12px;border-radius:12px;font-size:13px;line-height:1.2;text-align:center;}
.compact-inline-controls{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px 12px;overflow:visible;padding-bottom:0;}
.compact-inline-controls label{display:flex;align-items:center;justify-content:space-between;gap:10px;background:var(--panel-2);border:1px solid var(--line);border-radius:12px;padding:7px 10px;min-width:0;font-size:13px;font-weight:600;}

.keyboard-only-control{display:flex;align-items:center;justify-content:space-between;gap:10px;}
.keyboard-only-control.hidden-panel{display:none!important;}
.compact-inline-controls label span{white-space:nowrap;color:var(--text);font-size:13px;line-height:1.2;}
.compact-inline-controls select{min-width:92px;max-width:144px;width:auto;padding:6px 30px 6px 10px;border-radius:10px;font-size:13px;line-height:1.2;background:var(--panel);}
.top-controls-panel{padding:14px 16px 12px;}
.top-control-block{padding:0!important;}
@media (max-width:1080px){
  .compact-inline-controls{grid-template-columns:1fr;}
}
@media (max-width:760px){
  .compact-top-header{align-items:flex-start;}
  .header-inline-actions{justify-content:flex-start;}
  .compact-subtabs .subtab-btn{min-width:94px;font-size:12px;padding:8px 10px;}
  .compact-inline-controls label{flex-wrap:wrap;}
  .compact-inline-controls select{max-width:100%;width:100%;}
}


/* v14 top density cleanup */
.status-strip{grid-template-columns:repeat(8,minmax(0,1fr));gap:10px;}
.metric-card{padding:10px 12px;border-radius:16px;min-height:auto;}
.metric-card span{font-size:11px;letter-spacing:.02em;}
.metric-card strong{font-size:13px;line-height:1.25;}
.primary-tabs{gap:8px;padding:8px 10px;flex-wrap:nowrap;overflow-x:auto;scrollbar-width:thin;}
.primary-tab{padding:10px 14px;font-size:14px;border-radius:14px;white-space:nowrap;}
.top-controls-panel{padding:12px 16px 10px;}
.no-title-header{justify-content:flex-end;margin-bottom:8px;}
.header-inline-actions{display:flex;justify-content:flex-end;align-items:center;gap:8px;flex-wrap:nowrap;}
.tc-btn.mini,.compact-checklist-trigger{font-size:12px!important;padding:8px 12px!important;border-radius:12px;}
.top-controls-grid{gap:10px!important;}
.top-mode-row{padding-bottom:0;gap:8px;}
.subtabs.horizontal .subtab-btn{padding:8px 14px;font-size:13px;border-radius:12px;min-width:0;}
.top-inline-controls{display:grid!important;grid-template-columns:repeat(4,minmax(180px,1fr));gap:8px 10px;overflow:visible;padding-bottom:0;}
.top-inline-controls label{min-width:0;flex:none;display:grid;grid-template-columns:auto minmax(88px,128px);align-items:center;gap:8px;padding:8px 12px;border:1px solid var(--line);border-radius:14px;background:var(--panel-2);}
.top-inline-controls label span{font-size:12px;font-weight:700;color:var(--muted);line-height:1.2;white-space:nowrap;}
.top-inline-controls select{width:100%;min-width:0;height:32px;padding:4px 10px;font-size:12px;border-radius:10px;}
.top-control-block h3,.eyebrow,#panelDescription,.input-label-hidden{display:none!important;}
.hero-panel .panel-head{display:none;}
.typing-target-wrap{padding-top:4px;}
.target-meta{margin-bottom:6px;}
#targetLabel{font-size:12px;font-weight:700;color:var(--muted);}
.target-meta-right{gap:10px;}
.segment-meta,#engineStateLabel{font-size:12px;}
.typing-target{min-height:54px;padding:12px 14px;font-size:30px;border-radius:16px;}
.typing-input{min-height:60px!important;padding:12px 14px;font-size:18px;border-radius:16px;}
@media (max-width: 1320px){.status-strip{grid-template-columns:repeat(4,minmax(0,1fr));}.top-inline-controls{grid-template-columns:repeat(3,minmax(180px,1fr));}}
@media (max-width: 980px){.top-inline-controls{grid-template-columns:repeat(2,minmax(180px,1fr));}.header-inline-actions{flex-wrap:wrap;}.primary-tabs{flex-wrap:wrap;overflow:visible;}}
@media (max-width: 640px){.status-strip{grid-template-columns:repeat(2,minmax(0,1fr));}.top-inline-controls{grid-template-columns:1fr;}.top-inline-controls label{grid-template-columns:1fr;}.typing-target{font-size:24px;}.typing-input{font-size:16px;}}


/* v15 compact global unify */
.tc-header{padding:12px 16px;display:flex;justify-content:space-between;align-items:center;gap:12px;}
.tc-header .eyebrow,.tc-header .lead{display:none;}
.tc-header h1,.app-title-compact{font-size:18px;line-height:1.2;margin:0;font-weight:800;}
.header-actions .tc-btn{padding:8px 12px;font-size:12px;border-radius:12px;}
.status-strip{grid-template-columns:repeat(8,minmax(0,1fr));gap:8px;padding:10px 12px;margin-top:10px;}
.metric-card{padding:8px 10px;border-radius:14px;}
.metric-card span{font-size:10px;margin-bottom:4px;}
.metric-card strong{font-size:12px;}
.primary-tabs{gap:6px;padding:8px 10px;margin-top:0;}
.primary-tab{padding:8px 12px;font-size:12px;border-radius:12px;}
.top-controls-panel{padding:10px 12px 8px;}
.no-title-header{margin-bottom:6px;}
.header-inline-actions{gap:6px;}
.tc-btn.mini,.compact-checklist-trigger{font-size:11px!important;padding:7px 10px!important;border-radius:10px;}
.top-controls-grid{gap:8px!important;}
.compact-subtabs{gap:6px;}
.subtabs.horizontal .subtab-btn,.compact-subtabs .subtab-btn{padding:7px 11px;font-size:12px;border-radius:10px;min-width:0;}
.top-inline-controls{display:flex!important;flex-wrap:wrap;gap:8px 10px;align-items:flex-start;}
.top-inline-controls label{flex:0 1 240px;display:grid;grid-template-columns:auto minmax(72px,112px);align-items:center;gap:6px;padding:7px 10px;border-radius:12px;background:var(--panel-2);border:1px solid var(--line);}
.top-inline-controls label span{font-size:11px;font-weight:700;color:var(--muted);white-space:nowrap;}
.top-inline-controls select{height:30px;padding:4px 8px;font-size:12px;border-radius:9px;min-width:0;max-width:112px;}
.hero-panel,.keyboard-panel,.coach-panel,.analysis-panel,.result-panel{padding:12px 14px;}
.typing-target-wrap{gap:8px;padding-top:2px;}
.target-meta{margin-bottom:4px;display:flex;justify-content:space-between;align-items:center;gap:8px;}
#targetLabel,.segment-meta,#engineStateLabel{font-size:11px;line-height:1.2;}
.typing-target{min-height:42px;padding:9px 10px;font-size:22px;line-height:1.25;border-radius:14px;}
.typing-input{min-height:44px!important;max-height:64px;padding:8px 10px;font-size:14px;line-height:1.3;border-radius:14px;}
.typing-input::placeholder{font-size:14px;}
.keyboard-practice-mount{margin:4px 0 8px;}
.keyboard-practice-mount .typing-target-wrap{padding:6px 8px;gap:6px;border-radius:14px;}
.keyboard-practice-mount .typing-target{min-height:22px;padding:7px 9px;font-size:clamp(16px,2vw,22px);line-height:1.15;}
.keyboard-practice-mount .typing-input{min-height:38px!important;max-height:48px;padding:7px 9px;font-size:14px;}
.panel-head h3{font-size:16px;}
.panel-head.mini{margin-bottom:8px;}
.analysis-grid,.result-grid,.coach-summary-grid{gap:10px;}
.analysis-card{padding:12px;border-radius:14px;}
.analysis-card h4{font-size:13px;margin-bottom:8px;}
.analysis-card ul li,.analysis-card p,.coach-tip{font-size:12px;line-height:1.45;}
.control-grid.keyboard-coach-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;}
.control-grid.keyboard-coach-grid label{gap:5px;font-size:12px;}
.control-grid.keyboard-coach-grid select{padding:8px 10px;font-size:12px;height:36px;}
@media (max-width:1320px){.status-strip{grid-template-columns:repeat(4,minmax(0,1fr));}.top-inline-controls label{flex-basis:220px;}}
@media (max-width:980px){.control-grid.keyboard-coach-grid{grid-template-columns:repeat(2,minmax(0,1fr));}.top-inline-controls label{flex-basis:calc(50% - 10px);}.status-strip{grid-template-columns:repeat(4,minmax(0,1fr));}}
@media (max-width:720px){.tc-header{flex-direction:column;align-items:flex-start;}.status-strip{grid-template-columns:repeat(2,minmax(0,1fr));}.top-inline-controls label{flex-basis:100%;}.control-grid.keyboard-coach-grid{grid-template-columns:1fr;}.typing-target{font-size:18px;}.typing-input{font-size:13px;}}


/* v17 input restore + root packaging fix */
.keyboard-practice-mount .typing-input-label{display:block !important;font-size:11px !important;color:var(--muted);margin:0;}
.keyboard-practice-mount .typing-input{display:block !important;width:100%;min-height:42px !important;max-height:58px !important;padding:8px 10px !important;font-size:14px !important;line-height:1.3 !important;border-radius:12px !important;border:2px solid var(--line-strong) !important;background:#fff !important;color:var(--text) !important;box-shadow:0 1px 0 rgba(0,0,0,.03) inset;}
.keyboard-practice-mount .typing-input:focus{outline:none;box-shadow:0 0 0 3px rgba(59,130,246,.14);border-color:var(--accent) !important;}
.keyboard-practice-mount .typing-target-wrap{display:grid !important;gap:6px !important;}
.keyboard-practice-mount .typing-target{margin-bottom:0 !important;}

/* v19 realistic hand overlay final pass */
.keyboard-stage{
  min-height: 400px;
}
.keyboard-practice-mount{
  margin: 6px 0 8px;
}
.keyboard-practice-mount .typing-target-wrap{
  padding: 8px 10px;
}
.keyboard-practice-mount .typing-target{
  min-height: 22px;
  padding: 8px 10px;
  font-size: clamp(16px,2vw,24px);
  line-height: 1.18;
}
.keyboard-practice-mount .typing-input{
  min-height: 38px;
  max-height: 48px;
  padding: 7px 10px;
  font-size: 14px;
  line-height: 1.22;
}
.keyboard-shell{
  padding-top: 104px;
}
.keyboard-hands{
  position:absolute;
  inset:0 0 auto 0;
  height:250px;
  z-index:4;
  pointer-events:none;
  overflow:visible;
}
.keyboard-hand{
  opacity:.96;
  transition:transform .18s ease, opacity .18s ease;
}
.keyboard-hand.left-hand{
  transform:translate(-28px,52px) scale(.77) translate(var(--hand-dx,0px), var(--hand-dy,0px));
  transform-origin:290px 320px;
}
.keyboard-hand.right-hand{
  transform:translate(28px,52px) scale(.77) translate(var(--hand-dx,0px), var(--hand-dy,0px));
  transform-origin:910px 320px;
}
.keyboard-hand .wrist,
.keyboard-hand .palm,
.keyboard-hand .finger,
.keyboard-hand .thumb{
  fill:rgba(123,128,140,.24);
  stroke:rgba(90,96,110,.55);
  stroke-width:1.7;
  vector-effect:non-scaling-stroke;
  transition:transform .18s ease, fill .18s ease, stroke .18s ease, filter .18s ease, opacity .18s ease;
  transform-box:fill-box;
}
.keyboard-hand .wrist{
  fill:rgba(118,123,136,.16);
  stroke:rgba(92,98,110,.28);
}
.keyboard-hand .palm{
  fill:rgba(128,133,146,.19);
  filter:drop-shadow(0 8px 12px rgba(15,23,42,.08));
}
.keyboard-hand .finger,
.keyboard-hand .thumb{
  fill:rgba(132,138,151,.28);
}
.keyboard-hand .finger{
  transform:translate(var(--finger-dx,0px), var(--finger-dy,0px)) rotate(var(--finger-rot,0deg));
  transform-origin:center 88%;
}
.keyboard-hand .thumb{
  transform:translate(var(--finger-dx,0px), var(--finger-dy,0px)) rotate(var(--finger-rot,0deg));
  transform-origin:center 72%;
}
.keyboard-hand .finger.active-finger,
.keyboard-hand .thumb.active-finger{
  fill:rgba(62,103,255,.58);
  stroke:rgba(40,77,208,.88);
  filter:drop-shadow(0 0 10px rgba(62,103,255,.24));
}
.keyboard-hand.active-left .palm,
.keyboard-hand.active-right .palm{
  fill:rgba(128,133,146,.25);
}
.keyboard-row{gap:6px;}
.key{min-height:58px;border-radius:12px;}
.key strong{font-size:15px;line-height:1.05;}
.key small{font-size:10px;line-height:1.05;}
.key.active{transform:translateY(-1px);box-shadow:0 6px 16px rgba(63,81,181,.18), inset 0 0 0 1px rgba(63,81,181,.48);}

@media (max-width:960px){
  .keyboard-shell{padding-top:90px;}
  .keyboard-hands{height:220px;}
  .keyboard-hand.left-hand{transform:translate(-18px,44px) scale(.70) translate(var(--hand-dx,0px), var(--hand-dy,0px));}
  .keyboard-hand.right-hand{transform:translate(18px,44px) scale(.70) translate(var(--hand-dx,0px), var(--hand-dy,0px));}
}
@media (max-width:720px){
  .keyboard-hands{display:none;}
  .keyboard-shell{padding-top:0;}
}


/* ─── v21 UX 고급화: 커서 깜빡임 · 진행바 · 모노스페이스 · 장문 스크롤 ─── */

/* 타이핑 영역 폰트: eng/code는 JetBrains Mono, 한글은 자동 fallback */
.typing-target {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, 'Noto Sans KR', sans-serif;
}

/* 커서 깜빡임: 현재 문자 오른쪽에 블링크 커서 */
.typing-target .char.current {
  border-right: 2.5px solid var(--accent);
  animation: cursorBlink .85s ease-in-out infinite;
}
@keyframes cursorBlink {
  0%, 40%  { border-right-color: var(--accent); }
  60%, 100% { border-right-color: transparent; }
}

/* 진행 표시바 */
.typing-progress-bar {
  height: 4px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  margin: -4px 0 0;
}
.typing-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--ok), var(--accent));
  border-radius: 4px;
  transition: width .25s ease;
}

/* 장문 탭: 타이핑 타겟 스크롤 허용 (현재 위치 기준 자동 스크롤) */
[data-tab="longform"] .typing-target {
  max-height: 220px;
  overflow-y: auto;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
[data-tab="longform"] .typing-target::-webkit-scrollbar { width: 5px; }
[data-tab="longform"] .typing-target::-webkit-scrollbar-track { background: transparent; }
[data-tab="longform"] .typing-target::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }

/* keyboard-practice-mount 안의 진행바 압축 */
.keyboard-practice-mount .typing-progress-bar { margin-top: -2px; height: 3px; }
@media (max-width:720px) {
  [data-tab="longform"] .typing-target { max-height: 160px; }
}


/* ─── v22 기록 탭 ─── */
.record-panel { display: block; }
.record-empty { color: var(--muted); font-size: 14px; text-align: center; padding: 40px 20px; }

/* 최고 기록 그리드 */
.record-bests-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; margin-bottom: 18px; }
.record-best-card { padding: 14px !important; }
.record-best-card h4 { font-size: 13px; margin-bottom: 10px; color: var(--accent); }
.record-best-stats { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
.record-best-stats div { text-align: center; background: var(--bg); border-radius: 10px; padding: 7px 4px; }
.record-best-stats span { display: block; font-size: 10px; color: var(--muted); margin-bottom: 3px; letter-spacing: .04em; }
.record-best-stats strong { font-size: 15px; font-weight: 800; color: var(--text); }

/* 세션 기록 테이블 */
.record-table-section-title { font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; margin: 0 0 8px; }
.record-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; }
.record-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.record-table th { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .04em; background: var(--panel-2); }
.record-table th:first-child { border-radius: 13px 0 0 0; }
.record-table th:last-child { border-radius: 0 13px 0 0; }
.record-table td { padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.record-table tbody tr:last-child td { border-bottom: none; }
.record-table tbody tr:hover { background: var(--panel-2); }
.record-cpm { font-weight: 800; color: var(--accent); }
.record-ok { color: var(--ok); font-weight: 700; }
.record-warn { color: var(--warn); font-weight: 700; }
.record-set-name { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.record-actions { display: flex; justify-content: flex-end; margin-top: 12px; }

@media (max-width: 720px) {
  .record-bests-grid { grid-template-columns: repeat(2, 1fr); }
  .record-table { font-size: 12px; }
  .record-table td, .record-table th { padding: 7px 8px; }
}


/* ─── v23 가이드 탭 + CPM 차트 ─── */

/* 가이드 그리드 */
.guide-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.guide-list { list-style: none; padding: 0; margin: 0; }
.guide-list li { padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13px; line-height: 1.6; color: var(--text); }
.guide-list li:last-child { border-bottom: none; }
.guide-list li strong { color: var(--accent); }
.guide-kbd { display: inline-block; background: var(--panel-2); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 1px 7px; font-size: 11px; font-family: 'JetBrains Mono', monospace; color: var(--text); margin: 0 2px; }

/* CPM 추이 차트 */
.cpm-chart-wrap { margin: 0 0 16px; }
.cpm-chart-wrap svg { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); }
.cpm-chart-wrap text { font-family: 'JetBrains Mono', ui-monospace, monospace; }

@media (max-width: 720px) {
  .guide-grid { grid-template-columns: 1fr; }
}


/* ════════════════════════════════════════
   손 모양 완전 제거 + 클린 키보드 디자인
   ════════════════════════════════════════ */

/* 손 관련 요소 모두 숨김 */
.keyboard-hands, .keyboard-hand,
.keyboard-stage { display: none !important; }

/* keyboard-shell: 손 공간 없이 바로 표시 */
.keyboard-shell {
  position: static !important;
  padding-top: 0 !important;
  display: grid !important;
  gap: 6px !important;
}

/* 키보드 행 */
.keyboard-row {
  display: grid !important;
  grid-template-columns: repeat(30, minmax(0,1fr)) !important;
  gap: 5px !important;
  margin-left: var(--row-offset, 0) !important;
}

/* ── 키 클린 화이트 디자인 ── */
.key {
  background: #ffffff !important;
  border: 1px solid #d4d8e1 !important;
  border-bottom: 2px solid #c2c7d3 !important;
  border-radius: 8px !important;
  box-shadow: 0 1px 2px rgba(0,0,0,.05) !important;
  min-height: 52px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 3px !important;
  padding: 5px 3px !important;
  transition: background .07s, box-shadow .07s, transform .07s !important;
  cursor: default;
}
.key:hover {
  background: #f4f6fb !important;
  border-color: #b8bfcc !important;
}
.key strong {
  font-size: 14px !important;
  font-weight: 600 !important;
  color: #1e2330 !important;
  line-height: 1 !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
}
.key small {
  font-size: 9px !important;
  color: #9ba3b4 !important;
  line-height: 1 !important;
  letter-spacing: .01em !important;
}

/* 손가락별 키 글자 색상 (배경 제거, 텍스트만) */
.key.finger-left-pinky  { background: #fff !important; }
.key.finger-left-ring   { background: #fff !important; }
.key.finger-left-middle { background: #fff !important; }
.key.finger-left-index  { background: #fff !important; }
.key.finger-thumb       { background: #fff !important; }
.key.finger-right-index  { background: #fff !important; }
.key.finger-right-middle { background: #fff !important; }
.key.finger-right-ring   { background: #fff !important; }
.key.finger-right-pinky  { background: #fff !important; }

.key.finger-left-pinky  strong { color: #e53e3e !important; }
.key.finger-left-ring   strong { color: #dd6b20 !important; }
.key.finger-left-middle strong { color: #d69e2e !important; }
.key.finger-left-index  strong { color: #38a169 !important; }
.key.finger-thumb       strong { color: #4299e1 !important; }
.key.finger-right-index  strong { color: #0bc5ea !important; }
.key.finger-right-middle strong { color: #805ad5 !important; }
.key.finger-right-ring   strong { color: #d53f8c !important; }
.key.finger-right-pinky  strong { color: #e53e3e !important; }

/* 활성 키 (현재 입력 목표) */
.key.active {
  background: #ebf4ff !important;
  border-color: #4299e1 !important;
  border-bottom-color: #2b6cb0 !important;
  box-shadow: 0 0 0 2px rgba(66,153,225,.2) !important;
  transform: none !important;
}
.key.active strong { color: #2b6cb0 !important; }

/* 눌린 키 */
.key.pressed {
  background: #f0fff4 !important;
  border-color: #38a169 !important;
  border-bottom-width: 1px !important;
  transform: translateY(1px) !important;
  box-shadow: none !important;
}

/* 줄/손가락 포커스 */
.key.focus-row    { box-shadow: inset 0 0 0 2px rgba(66,153,225,.25) !important; }
.key.focus-finger { box-shadow: inset 0 0 0 2px rgba(56,161,105,.28) !important; }

/* 반응형 */
@media (max-width: 860px) {
  .keyboard-row { gap: 4px !important; }
  .key { min-height: 44px !important; }
  .key strong { font-size: 12px !important; }
}
@media (max-width: 640px) {
  .key { min-height: 38px !important; border-radius: 6px !important; }
  .key strong { font-size: 11px !important; }
  .key small { display: none !important; }
}


/* ─── 통합 분석 패널 내 상태 스트립 ─── */
.analysis-panel .status-strip {
  display: grid !important;
  grid-template-columns: repeat(8, minmax(0,1fr)) !important;
  gap: 8px !important;
  padding: 14px 0 0 !important;
  margin-top: 14px !important;
  border-top: 1px solid var(--line) !important;
  background: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  border-left: none !important;
  border-right: none !important;
  border-bottom: none !important;
}
@media (max-width: 1100px) {
  .analysis-panel .status-strip { grid-template-columns: repeat(4, minmax(0,1fr)) !important; }
}
@media (max-width: 640px) {
  .analysis-panel .status-strip { grid-template-columns: repeat(2, minmax(0,1fr)) !important; }
}


/* ─── 탭바 + 액션 버튼 한 줄 ─── */
.tc-tab-bar {
  display: flex; align-items: center; gap: 10px;
}
.primary-tabs {
  flex: 1; min-width: 0; margin-top: 0 !important;
}
.tc-tab-bar-actions {
  display: flex; gap: 8px; flex-shrink: 0;
}

/* ─── 키보드 패널 헤더 (legend + 서브탭 + 버튼 한 줄) ─── */
.kp-head {
  display: flex; align-items: center; gap: 14px;
  flex-wrap: wrap; margin-bottom: 14px;
}
.kp-head-left { flex: 1; min-width: 0; }
.kp-head-right {
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0; flex-wrap: wrap;
}

/* ─── 컨트롤 액션 버튼 그룹 ─── */
.tc-ctrl-actions { display: flex; gap: 8px; flex-shrink: 0; flex-wrap: wrap; }

.tc-settings-section { padding: 0; overflow: hidden; }
.tc-settings-toggle {
  width: 100%; display: flex; justify-content: space-between; align-items: center;
  padding: 13px 18px; background: none; border: none;
  font-weight: 700; font-size: 14px; cursor: pointer; color: var(--muted);
}
.tc-settings-toggle:hover { color: var(--text); }
.tc-settings-body { padding: 0 14px 14px; display: none; }
.tc-settings-arrow { display: inline-block; transition: transform .2s; }
.tc-settings-arrow.open { transform: rotate(180deg); }

/* 히어로 패널 오른쪽 액션 영역 */
.tc-hero-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.tc-state-badge {
  font-size: 12px; font-weight: 700; color: var(--muted);
  background: var(--panel-2); border: 1px solid var(--line);
  padding: 5px 11px; border-radius: 999px; white-space: nowrap;
}

@media (max-width: 640px) {
  .tc-ctrl-row { flex-direction: column; align-items: flex-start; }
  .tc-ctrl-actions { flex-wrap: wrap; }
  .tc-hero-actions { flex-wrap: wrap; }
}
