/* Extension modules: speak, novel, writing, dictation, timed-read (P4 #21) */
/* ================================================================
   SPEAKING PAGE — Unified with VERDANT Design System
   ================================================================ */

#page-speak, .sp-page {
  background: var(--bg);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Ambient background glows — separate class, position:fixed */
.sp-ambient {
  position: fixed;
  border-radius: 50%;
  filter: blur(100px);
  pointer-events: none;
  z-index: 0;
}
.sp-orb-1 {
  width: 520px; height: 520px;
  background: radial-gradient(circle, rgba(124,58,237,0.13) 0%, transparent 70%);
  top: -160px; left: -160px;
}
.sp-orb-2 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(40,120,106,0.09) 0%, transparent 70%);
  bottom: -180px; right: -160px;
}

/* ---- Header ---- */
.sp-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  height: 56px;
  background: var(--bg);
  border-bottom: 1px solid var(--bd);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: background var(--t), border-color var(--t);
}
.sp-back-btn {
  display: flex; align-items: center; gap: 6px;
  background: none;
  border: 1px solid var(--bd);
  border-radius: var(--r-sm);
  padding: 6px 12px;
  font-size: 0.8rem; font-weight: 600;
  color: var(--tx-2);
  cursor: pointer; transition: all var(--t);
  white-space: nowrap; font-family: var(--f-body);
}
.sp-back-btn:hover { background: var(--surface); color: var(--tx); border-color: var(--tx-3); }
.sp-back-btn svg { flex-shrink: 0; }
.sp-header-center {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px;
}
.sp-header-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--c-speak);
  box-shadow: 0 0 8px rgba(124,58,237,0.8);
  animation: sp-dot 2s ease-in-out infinite;
}
@keyframes sp-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.7); }
}
.sp-header-title {
  font-family: var(--f-body);
  font-size: 0.88rem; font-weight: 600;
  color: var(--tx); letter-spacing: 0.04em;
}
.sp-header-right { display: flex; align-items: center; gap: 10px; }
.sp-timer {
  display: flex; align-items: center; justify-content: center;
  background: var(--card); border: 1px solid var(--bd);
  border-radius: 20px; padding: 4px 12px;
}
.sp-timer-val {
  font-family: var(--f-mono); font-size: 0.82rem; font-weight: 600;
  color: var(--c-speak); letter-spacing: 0.06em;
}
.sp-theme-btn {
  background: none; border: 1px solid var(--bd);
  border-radius: var(--r-sm); padding: 6px 8px;
  cursor: pointer; transition: background var(--t); font-size: 0.85rem;
  color: var(--tx-2);
}
.sp-theme-btn:hover { background: var(--surface); }

/* ---- Setup Screen ---- */
.sp-setup {
  position: relative; z-index: 1;
  min-height: calc(100vh - 56px);
  display: flex; align-items: center; justify-content: center;
  padding: 40px 24px 60px;
}
.sp-setup-inner {
  width: 100%; max-width: 560px;
  animation: sp-up 0.38s cubic-bezier(0.22,1,0.36,1) both;
}
@keyframes sp-up { from { opacity:0; transform:translateY(18px); } to { opacity:1; transform:none; } }

.sp-badge {
  display: inline-block;
  background: var(--accent-purple-light);
  color: var(--c-speak);
  border: 1px solid rgba(124,58,237,0.2);
  border-radius: 20px; padding: 4px 14px;
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  margin-bottom: 20px;
}
.sp-setup-heading {
  font-family: var(--f-display);
  font-size: 2.6rem; font-weight: 700; font-style: italic;
  color: var(--tx); line-height: 1.18; margin: 0 0 10px;
}
.sp-setup-sub {
  font-size: 0.88rem; color: var(--tx-3); line-height: 1.65; margin: 0 0 32px;
}
.sp-section { margin-bottom: 24px; }
.sp-label {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--tx-3); margin-bottom: 10px;
}
.sp-mode-row { display: flex; gap: 8px; flex-wrap: wrap; }
.sa-mode-btn {
  flex: 1; min-width: 90px;
  background: var(--card); border: 1.5px solid var(--bd);
  border-radius: var(--r); padding: 12px 10px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  cursor: pointer; transition: all var(--t); font-family: var(--f-body);
}
.sa-mode-btn:hover { border-color: var(--c-speak); background: var(--accent-purple-light); }
.sa-mode-btn.active { border-color: var(--c-speak); background: var(--accent-purple-light); box-shadow: 0 0 0 3px rgba(124,58,237,0.1); }
.sp-mode-num { font-size: 0.88rem; font-weight: 700; color: var(--tx); }
.sp-mode-sub { font-size: 0.67rem; color: var(--tx-3); }
.sa-mode-btn.active .sp-mode-num { color: var(--c-speak); }
.sa-mode-btn.active .sp-mode-sub { color: var(--c-speak); opacity: 0.8; }

.sp-topic-wrap { display: flex; flex-wrap: wrap; gap: 7px; }
.sa-topic-btn {
  background: var(--card); border: 1px solid var(--bd);
  border-radius: 20px; padding: 6px 14px;
  font-size: 0.78rem; font-weight: 500; color: var(--tx-2);
  cursor: pointer; transition: all var(--t); font-family: var(--f-body);
}
.sa-topic-btn:hover { border-color: var(--c-speak); color: var(--c-speak); }
.sa-topic-btn.selected, .sa-topic-btn.active { background: var(--accent-purple-light); border-color: var(--c-speak); color: var(--c-speak); font-weight: 600; }

.sa-browser-warn {
  background: var(--accent-orange-light); border: 1px solid var(--c-write);
  border-radius: var(--r-sm); padding: 10px 14px;
  font-size: 0.8rem; color: var(--c-write); margin-bottom: 20px;
}

.sp-start-btn {
  width: 100%; padding: 14px;
  background: linear-gradient(135deg, var(--c-speak), #5b21b6);
  color: #fff; border: none; border-radius: var(--r);
  font-family: var(--f-body); font-size: 0.95rem; font-weight: 700;
  cursor: pointer; transition: all 0.2s;
  box-shadow: 0 4px 16px rgba(124,58,237,0.3);
  letter-spacing: 0.03em;
}
.sp-start-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(124,58,237,0.45); }
.sp-start-btn:disabled { opacity: 0.35; cursor: not-allowed; box-shadow: none; transform: none; }

/* ---- Session Screen ---- */
.sp-session {
  display: flex;
  height: calc(100vh - 56px);
  position: relative; z-index: 1;
}
.sp-main { flex: 1; display: flex; flex-direction: column; min-width: 0; overflow: hidden; }

/* Orb Zone — compact, aligned to top */
.sp-orb-zone {
  display: flex; flex-direction: column; align-items: center;
  flex-shrink: 0; padding: 24px 20px 20px;
  background: linear-gradient(180deg, var(--bg) 0%, #0d1117 100%);
}
.sp-sess-tag {
  font-size: 0.7rem; color: var(--c-speak);
  background: var(--accent-purple-light);
  border: 1px solid rgba(124,58,237,0.2);
  border-radius: 20px; padding: 3px 12px; margin-bottom: 20px;
  font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 300px;
  font-family: var(--f-body);
}
.sp-orb-wrap { position: relative; width: 160px; height: 160px; display: flex; align-items: center; justify-content: center; }
.sp-orb-ring { position: absolute; border-radius: 50%; border: 1px solid rgba(124,58,237,0.18); pointer-events: none; }
.sp-ring-1 { width: 190px; height: 190px; animation: sp-ring 4s ease-out infinite; }
.sp-ring-2 { width: 220px; height: 220px; animation: sp-ring 4s ease-out 1.8s infinite; }
@keyframes sp-ring { 0% { transform: scale(0.92); opacity: 0.5; } 100% { transform: scale(1.08); opacity: 0; } }

/* Interactive orb */
.sp-orb {
  width: 140px; height: 140px; border-radius: 50%;
  position: relative; overflow: hidden; cursor: pointer;
  animation: sp-orb-idle 5s ease-in-out infinite;
  box-shadow: 0 0 40px rgba(124,58,237,0.45), 0 0 80px rgba(124,58,237,0.18), inset 0 0 30px rgba(0,0,0,0.4);
  transition: box-shadow 0.5s ease;
}
.sp-orb-bg { position: absolute; inset: 0; background: linear-gradient(145deg, #1e1b4b 0%, #312e81 50%, #4c1d95 100%); }
.sp-blob { position: absolute; border-radius: 50%; filter: blur(18px); mix-blend-mode: screen; opacity: 0.9; }
.sp-b1 { width: 90px; height: 90px; background: radial-gradient(circle, #6366f1 0%, transparent 70%); animation: sp-blob1 7s ease-in-out infinite; }
.sp-b2 { width: 75px; height: 75px; background: radial-gradient(circle, #8b5cf6 0%, transparent 70%); animation: sp-blob2 9s ease-in-out infinite; }
.sp-b3 { width: 65px; height: 65px; background: radial-gradient(circle, #c4b5fd 0%, transparent 70%); animation: sp-blob3 6s ease-in-out infinite; }
.sp-orb-shine { position: absolute; top: 12%; left: 14%; width: 38%; height: 32%; background: radial-gradient(circle, rgba(255,255,255,0.22) 0%, transparent 100%); border-radius: 50%; pointer-events: none; }

@keyframes sp-blob1 { 0% { top:5%;left:5%; } 25% { top:45%;left:55%; } 50% { top:65%;left:15%; } 75% { top:20%;left:65%; } 100% { top:5%;left:5%; } }
@keyframes sp-blob2 { 0% { top:55%;left:45%; } 33% { top:10%;left:65%; } 66% { top:35%;left:5%; } 100% { top:55%;left:45%; } }
@keyframes sp-blob3 { 0% { top:25%;left:35%; } 50% { top:65%;left:55%; } 100% { top:25%;left:35%; } }
@keyframes sp-orb-idle { 0%,100% { transform: scale(1); } 50% { transform: scale(1.035); } }

.sp-page.sp-speaking .sp-orb { animation: sp-orb-speak 0.9s ease-in-out infinite; box-shadow: 0 0 60px rgba(99,102,241,0.7), 0 0 120px rgba(99,102,241,0.35), inset 0 0 30px rgba(0,0,0,0.3); }
.sp-page.sp-speaking .sp-b1 { animation-duration: 2.5s; }
.sp-page.sp-speaking .sp-b2 { animation-duration: 1.8s; }
.sp-page.sp-speaking .sp-b3 { animation-duration: 1.2s; width: 85px; height: 85px; }
.sp-page.sp-speaking .sp-ring-1 { border-color: rgba(99,102,241,0.4); animation-duration: 2s; }
.sp-page.sp-speaking .sp-ring-2 { border-color: rgba(99,102,241,0.25); animation-duration: 2.5s; }
@keyframes sp-orb-speak { 0% { transform:scale(1); } 20% { transform:scale(1.08); } 40% { transform:scale(1.04); } 60% { transform:scale(1.09); } 80% { transform:scale(1.05); } 100% { transform:scale(1); } }

.sp-page.sp-listening .sp-orb { animation: sp-orb-listen 0.6s ease-in-out infinite; box-shadow: 0 0 60px rgba(52,211,153,0.6), 0 0 120px rgba(52,211,153,0.25), inset 0 0 30px rgba(0,0,0,0.3); }
.sp-page.sp-listening .sp-orb-bg { background: linear-gradient(145deg, #064e3b 0%, #065f46 50%, #047857 100%); }
.sp-page.sp-listening .sp-b1 { background: radial-gradient(circle, #10b981 0%, transparent 70%); animation-duration: 1.5s; }
.sp-page.sp-listening .sp-b2 { background: radial-gradient(circle, #34d399 0%, transparent 70%); animation-duration: 1s; }
.sp-page.sp-listening .sp-b3 { background: radial-gradient(circle, #6ee7b7 0%, transparent 70%); animation-duration: 0.7s; }
.sp-page.sp-listening .sp-ring-1 { border-color: rgba(52,211,153,0.35); }
.sp-page.sp-listening .sp-ring-2 { border-color: rgba(52,211,153,0.2); }
@keyframes sp-orb-listen { 0%,100% { transform: scale(1.04); } 50% { transform: scale(1.09); } }

.sp-page.sp-thinking .sp-orb { animation: sp-orb-idle 2s ease-in-out infinite; opacity: 0.7; }
.sp-orb-status { margin-top: 14px; font-size: 0.82rem; color: rgba(255,255,255,0.4); text-align: center; transition: color 0.3s; letter-spacing: 0.02em; font-family: var(--f-body); }
.sp-page.sp-speaking .sp-orb-status { color: #a5b4fc; }
.sp-page.sp-listening .sp-orb-status { color: #6ee7b7; }
.sp-page.sp-thinking .sp-orb-status { color: rgba(255,255,255,0.6); }

/* ---- Transcript ---- */
.sp-transcript { flex: 1; overflow-y: auto; padding: 12px 20px 8px; display: flex; flex-direction: column; gap: 10px; background: #0d1117; min-height: 0; }
.sp-transcript::-webkit-scrollbar { width: 3px; }
.sp-transcript::-webkit-scrollbar-thumb { background: var(--bd); border-radius: 2px; }
.sa-bubble { max-width: 78%; padding: 10px 14px; border-radius: var(--r); font-size: 0.85rem; line-height: 1.6; word-wrap: break-word; animation: sp-up 0.22s ease both; font-family: var(--f-body); }
.sa-bubble-ai { align-self: flex-start; background: var(--card); border: 1px solid var(--bd); border-bottom-left-radius: 4px; color: var(--tx); }
.sa-bubble-user { align-self: flex-end; background: var(--accent-purple-light); border: 1px solid rgba(124,58,237,0.25); border-bottom-right-radius: 4px; color: var(--tx); }
.sa-cue-card { align-self: flex-start; max-width: 88%; background: var(--card); border: 1px solid var(--bd); border-left: 3px solid var(--c-speak); border-radius: var(--r); padding: 14px 16px; animation: sp-up 0.22s ease both; }
.sa-cue-task { font-family: var(--f-display); font-size: 1rem; font-weight: 700; color: var(--c-speak); margin-bottom: 8px; }
.sa-cue-prompts { margin: 0; padding-left: 16px; font-size: 0.8rem; color: var(--tx-2); line-height: 1.85; }
.sa-cue-hint { margin-top: 8px; font-size: 0.75rem; color: var(--tx-3); font-style: italic; }

/* ---- Controls ---- */
.sp-ctrl-bar { border-top: 1px solid rgba(255,255,255,0.06); background: #0d1117; padding: 12px 20px 16px; display: flex; flex-direction: column; align-items: center; gap: 10px; flex-shrink: 0; }
.sp-text-wrap { display: flex; gap: 8px; width: 100%; max-width: 480px; }
.sp-text-input { flex: 1; padding: 10px 15px; background: var(--surface); border: 1px solid var(--bd); border-radius: var(--r-sm); color: var(--tx); font-family: var(--f-body); font-size: 0.87rem; }
.sp-text-input:focus { outline: none; border-color: var(--c-speak); }
.sp-text-input::placeholder { color: var(--tx-3); }
.sp-send-btn { padding: 10px 18px; background: var(--c-speak); color: #fff; border: none; border-radius: var(--r-sm); font-family: var(--f-body); font-size: 0.84rem; font-weight: 600; cursor: pointer; transition: opacity 0.18s; }
.sp-send-btn:hover { opacity: 0.85; }

.sp-mic-row { display: flex; align-items: center; gap: 16px; }
.sp-end-link { background: none; border: 1px solid var(--bd); border-radius: 20px; padding: 7px 16px; font-size: 0.78rem; font-weight: 600; color: var(--tx-3); cursor: pointer; transition: all var(--t); font-family: var(--f-body); }
.sp-end-link:hover { border-color: var(--v-error); color: var(--v-error); }

.sp-mic-btn {
  width: 60px; height: 60px; border-radius: 50%;
  background: linear-gradient(135deg, var(--c-speak), #5b21b6);
  border: none; cursor: pointer; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 20px rgba(124,58,237,0.4); transition: all 0.2s;
  position: relative;
}
.sp-mic-btn:hover { transform: scale(1.07); box-shadow: 0 6px 28px rgba(124,58,237,0.55); }
.sp-mic-btn:disabled { opacity: 0.3; cursor: not-allowed; transform: none; box-shadow: none; }
.sa-mic-active { background: linear-gradient(135deg, #059669, #047857) !important; box-shadow: 0 4px 20px rgba(5,150,105,0.5) !important; animation: sp-mic-pulse 1s ease-in-out infinite; }
@keyframes sp-mic-pulse { 0%,100% { box-shadow: 0 4px 20px rgba(5,150,105,0.5); } 50% { box-shadow: 0 4px 32px rgba(5,150,105,0.8); } }
.sp-mic-icon { color: #fff; }
.sp-mic-status { font-size: 0.7rem; color: var(--tx-3); font-family: var(--f-body); }

/* ---- Sidebar ---- */
.sp-sidebar { width: 240px; border-left: 1px solid var(--bd); background: var(--bg); padding: 16px; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; }
.sp-tips-hd { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--tx-3); font-family: var(--f-body); }
.sp-tips-list { display: flex; flex-direction: column; gap: 6px; }
.sa-tips-empty { font-size: 0.78rem; color: var(--tx-3); font-style: italic; font-family: var(--f-body); }
.sa-tip-item { font-size: 0.78rem; color: var(--tx-2); padding: 8px 10px; background: var(--card); border: 1px solid var(--bd); border-left: 3px solid var(--c-speak); border-radius: var(--r-sm); line-height: 1.5; font-family: var(--f-body); }

/* ---- Score Overlay ---- */
.sp-score-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center; z-index: 50; backdrop-filter: blur(8px); }
.sp-score-card { background: var(--card); border: 1px solid var(--bd); border-radius: var(--r-xl); padding: 32px; width: 90%; max-width: 520px; max-height: 85vh; overflow-y: auto; box-shadow: 0 24px 80px rgba(0,0,0,0.35); }
.sp-sc-loading { font-size: 0.9rem; color: var(--tx-3); font-family: var(--f-body); text-align: center; padding: 20px; }
.sp-sc-band { font-family: var(--f-display); font-size: 5rem; font-weight: 700; text-align: center; color: var(--c-speak); line-height: 1; margin-bottom: 6px; }
.sp-sc-band-label { text-align: center; font-size: 0.75rem; color: var(--tx-3); margin-bottom: 24px; font-family: var(--f-body); letter-spacing: 0.1em; text-transform: uppercase; }
.sp-sc-criteria { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 20px; }
.sp-sc-crit { background: var(--surface); border: 1px solid var(--bd); border-radius: var(--r); padding: 12px 10px; text-align: center; }
.sp-sc-crit-label { font-size: 0.65rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--tx-3); margin-bottom: 4px; font-family: var(--f-body); }
.sp-sc-crit-score { font-family: var(--f-display); font-size: 1.9rem; font-weight: 700; color: var(--c-speak); line-height: 1.1; }
.sp-sc-crit-comment { font-size: 0.7rem; color: var(--tx-2); margin-top: 5px; line-height: 1.45; font-family: var(--f-body); }
.sp-sc-summary { font-size: 0.85rem; color: var(--tx-2); line-height: 1.7; margin-bottom: 16px; padding: 14px; background: var(--surface); border-radius: var(--r-sm); border: 1px solid var(--bd); font-family: var(--f-body); }
.sp-sc-lists { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 20px; }
.sp-sc-list-title { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--tx-3); margin-bottom: 8px; font-family: var(--f-body); }
.sp-sc-list-item { font-size: 0.77rem; color: var(--tx-2); line-height: 1.5; padding: 4px 0; border-bottom: 1px solid var(--bd); font-family: var(--f-body); }
.sp-sc-btn { width: 100%; padding: 13px; background: linear-gradient(135deg, var(--c-speak), #5b21b6); color: #fff; border: none; border-radius: var(--r); font-family: var(--f-body); font-size: 0.95rem; font-weight: 600; cursor: pointer; transition: all 0.2s; box-shadow: 0 4px 16px rgba(124,58,237,0.3); }
.sp-sc-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 24px rgba(124,58,237,0.45); }

/* ---- Responsive ---- */
@media (max-width: 860px) {
  .sp-session { flex-direction: column; }
  .sp-sidebar { width: 100%; max-height: 160px; flex-direction: row; flex-wrap: wrap; border-left: none; border-top: 1px solid var(--bd); }
  .sp-tips-list { flex: 1; overflow-y: auto; }
}
@media (max-width: 640px) {
  .sp-setup-heading { font-size: 2rem; }
  .sp-orb { width: 120px; height: 120px; }
  .sp-orb-wrap { width: 140px; height: 140px; }
  .sp-ring-1 { width: 165px; height: 165px; }
  .sp-ring-2 { width: 190px; height: 190px; }
  .sa-bubble { max-width: 92%; }
  .sp-sc-criteria { grid-template-columns: 1fr; }
  .sp-sc-lists { grid-template-columns: 1fr; }
}
/* Header */
.nv-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--bd);
}
.nv-header-inner {
  max-width: 900px; margin: 0 auto;
  padding: 12px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.nv-back-btn {
  display: flex; align-items: center; gap: 5px;
  background: none; border: none; color: var(--v-teal);
  font: 500 0.88rem var(--f-body); cursor: pointer;
}
.nv-back-btn:hover { text-decoration: underline; }
.nv-header-title {
  font: 600 1.05rem var(--f-display); color: var(--tx);
  flex: 1; text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nv-header-right { display: flex; align-items: center; gap: 8px; }
.nv-tts-btn {
  background: var(--v-teal-lt); color: var(--v-teal);
  border: none; border-radius: 8px; padding: 6px 14px;
  font: 500 0.82rem var(--f-body); cursor: pointer;
  transition: background 0.15s;
}
.nv-tts-btn:hover { background: var(--v-teal-glow); }
.nv-tts-playing { background: var(--v-teal); color: #fff; }
.nv-tts-playing:hover { background: var(--v-teal); opacity: 0.9; }

/* Chapter nav bar */
.nv-ch-nav {
  max-width: 900px; margin: 0 auto;
  padding: 8px 20px;
  display: flex; align-items: center; justify-content: center; gap: 20px;
  border-top: 1px solid var(--bd);
}
.nv-nav-btn {
  background: none; border: 1px solid var(--bd);
  border-radius: 6px; padding: 4px 14px;
  font: 500 0.82rem var(--f-body); color: var(--tx);
  cursor: pointer; transition: all 0.15s;
}
.nv-nav-btn:hover:not(:disabled) { border-color: var(--v-teal); color: var(--v-teal); }
.nv-nav-btn:disabled { opacity: 0.3; cursor: default; }
.nv-ch-info { font: 500 0.85rem var(--f-mono); color: var(--v-muted); }

/* Library */
.nv-library-wrap { padding: 0 20px 40px; max-width: 900px; margin: 0 auto; }
.nv-library-hero {
  text-align: center; padding: 48px 0 32px;
}
.nv-lib-badge {
  display: inline-block;
  font: 600 0.72rem var(--f-body); letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--v-teal); background: var(--v-teal-lt);
  padding: 4px 14px; border-radius: 20px; margin-bottom: 14px;
}
.nv-lib-title {
  font: 700 2.2rem var(--f-display); color: var(--tx);
  margin: 0 0 8px;
}
.nv-lib-sub {
  font: 400 0.95rem var(--f-body); color: var(--v-muted);
  max-width: 480px; margin: 0 auto;
}
.nv-library {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px; margin-top: 8px;
}
.nv-lib-home { text-align: center; margin-top: 32px; }
.nv-home-btn {
  background: none; border: 1px solid var(--bd); border-radius: 8px;
  padding: 8px 24px; font: 500 0.88rem var(--f-body); color: var(--v-muted);
  cursor: pointer; transition: all 0.15s;
}
.nv-home-btn:hover { border-color: var(--v-teal); color: var(--v-teal); }

/* Novel card */
.nv-card {
  background: var(--card); border: 1px solid var(--bd);
  border-radius: 14px; overflow: hidden; cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.nv-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,0.08); }
.nv-card-cover {
  height: 100px; display: flex; align-items: center; justify-content: center;
}
.nv-card-emoji { font-size: 2.8rem; }
.nv-card-body { padding: 16px; }
.nv-card-diff {
  font: 600 0.68rem var(--f-body); letter-spacing: 0.06em;
  text-transform: uppercase; margin-bottom: 6px;
}
.nv-card-title {
  font: 600 1.1rem var(--f-display); color: var(--tx);
  margin-bottom: 2px;
}
.nv-card-author {
  font: 400 0.82rem var(--f-body); color: var(--v-muted);
  margin-bottom: 8px;
}
.nv-card-desc {
  font: 400 0.82rem var(--f-body); color: var(--v-ink-2);
  line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.nv-card-meta {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--bd);
  font: 400 0.78rem var(--f-body); color: var(--v-muted);
}
.nv-card-prog { color: var(--v-teal); font-weight: 500; }

/* Reader */
.nv-reader-wrap {
  max-width: 720px; margin: 0 auto; padding: 0 20px 60px;
}
.nv-reader {
  padding: 24px 0;
}
.nv-loading, .nv-empty {
  text-align: center; padding: 60px 20px;
  color: var(--v-muted); font: 400 0.95rem var(--f-body);
}
.nv-ch-header {
  text-align: center; margin-bottom: 32px; padding-bottom: 20px;
  border-bottom: 1px solid var(--bd);
}
.nv-ch-num {
  font: 600 0.72rem var(--f-body); letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--v-teal); margin-bottom: 6px;
}
.nv-ch-title {
  font: 600 1.6rem var(--f-display); color: var(--tx);
  margin: 0 0 6px;
}
.nv-ch-meta {
  font: 400 0.82rem var(--f-body); color: var(--v-muted);
}

/* Chapter text */
.nv-ch-text {
  font: 400 1.05rem var(--f-body); color: var(--tx);
  line-height: 1.85; letter-spacing: 0.01em;
}
.nv-para {
  margin-bottom: 1.2em;
  transition: background-color 0.3s;
  padding: 4px 8px; border-radius: 6px;
  margin-left: -8px; margin-right: -8px;
}
.nv-para-active {
  background-color: var(--v-teal-lt);
}

/* Moral (for fables) */
.nv-moral {
  margin-top: 28px; padding: 16px 20px;
  background: var(--v-teal-lt); border-radius: 10px;
  border-left: 3px solid var(--v-teal);
}
.nv-moral-badge {
  font: 600 0.7rem var(--f-body); letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--v-teal); margin-bottom: 6px;
}
.nv-moral-en {
  font: 500 0.95rem var(--f-body); color: var(--tx);
  font-style: italic; margin-bottom: 4px;
}
.nv-moral-zh {
  font: 400 0.88rem var(--f-body); color: var(--v-muted);
}

/* Mobile */
@media (max-width: 640px) {
  .nv-lib-title { font-size: 1.6rem; }
  .nv-library { grid-template-columns: 1fr; }
  .nv-ch-title { font-size: 1.3rem; }
  .nv-ch-text { font-size: 0.98rem; line-height: 1.75; }
  .nv-header-inner { padding: 10px 14px; }
  .nv-tts-btn { padding: 5px 10px; font-size: 0.78rem; }
}


/* ================================================================
   WRITING PRACTICE PAGE
   ================================================================ */
.wp-header { position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--bd); }
.wp-header-inner { display: flex; align-items: center; justify-content: space-between; max-width: 800px; margin: 0 auto; padding: 14px 24px; }
.wp-back-btn { background: none; border: none; font-size: 0.9rem; color: var(--tx-2); cursor: pointer; font-family: var(--f-body); }
.wp-back-btn:hover { color: var(--v-teal); }
.wp-header-title { font-family: var(--f-display); font-size: 1.2rem; font-weight: 700; color: var(--tx); }
.wp-header-right { display: flex; align-items: center; gap: 12px; }
.wp-timer { font-family: var(--f-mono); font-size: 0.9rem; color: var(--tx-2); }

.wp-setup { max-width: 800px; margin: 0 auto; padding: 32px 24px; }
.wp-setup-inner { text-align: center; }
.wp-badge { display: inline-block; background: var(--v-teal-lt); color: var(--v-teal); font-size: 0.78rem; font-weight: 600; padding: 4px 14px; border-radius: 12px; margin-bottom: 12px; }
.wp-setup-heading { font-family: var(--f-display); font-size: 1.8rem; font-weight: 700; color: var(--tx); margin-bottom: 8px; }
.wp-setup-sub { font-size: 0.9rem; color: var(--tx-3); margin-bottom: 24px; }

.wp-type-row { display: flex; justify-content: center; gap: 10px; margin-bottom: 24px; }
.wp-type-btn {
  background: none; border: 1px solid var(--bd); font-family: var(--f-body); font-size: 0.88rem;
  padding: 8px 20px; border-radius: 10px; cursor: pointer; transition: all 0.2s; color: var(--tx-2);
}
.wp-type-btn:hover { border-color: var(--v-teal); color: var(--tx); }
.wp-type-btn.active { background: var(--v-teal); color: #fff; border-color: var(--v-teal); }

.wp-topics { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; text-align: left; margin-bottom: 32px; }
.wp-topic-card {
  background: var(--card); border: 1px solid var(--bd); border-radius: 10px; padding: 12px;
  cursor: pointer; transition: all 0.2s;
}
.wp-topic-card:hover { border-color: var(--v-teal); box-shadow: 0 2px 12px rgba(0,0,0,0.06); }
.wp-topic-num { font-family: var(--f-mono); font-size: 0.75rem; color: var(--v-teal); display: block; margin-bottom: 4px; }
.wp-topic-preview { font-size: 0.82rem; color: var(--tx-2); line-height: 1.4; }

.wp-editor { max-width: 800px; margin: 0 auto; padding: 20px 24px; }
.wp-prompt-box {
  background: var(--card); border: 1px solid var(--bd); border-radius: 12px;
  padding: 16px; margin-bottom: 16px;
}
.wp-prompt-label { font-size: 0.82rem; color: var(--v-teal); font-weight: 600; margin-bottom: 8px; }
.wp-prompt-text { font-size: 0.9rem; color: var(--tx); line-height: 1.6; }
.wp-prompt-chart { font-size: 0.85rem; color: var(--tx-2); margin-top: 8px; font-style: italic; }

.wp-textarea {
  width: 100%; min-height: 400px; padding: 16px; border: 1px solid var(--bd);
  border-radius: 12px; font-family: var(--f-body); font-size: 0.92rem;
  line-height: 1.8; color: var(--tx); background: var(--card); resize: vertical;
  outline: none; box-sizing: border-box;
}
.wp-textarea:focus { border-color: var(--v-teal); }

.wp-editor-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; }
.wp-wc { font-family: var(--f-mono); font-size: 0.82rem; color: var(--tx-3); }
.wp-submit-btn {
  background: var(--v-teal); color: #fff; border: none; padding: 10px 28px;
  border-radius: 10px; font-family: var(--f-body); font-size: 0.9rem;
  font-weight: 600; cursor: pointer; transition: background 0.2s;
}
.wp-submit-btn:hover { background: #1f6357; }
.wp-submit-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.wp-feedback { max-width: 800px; margin: 0 auto; padding: 20px 24px 40px; }
.wp-fb-band {
  text-align: center; font-family: var(--f-display); font-size: 2.5rem;
  font-weight: 700; color: var(--v-teal); margin-bottom: 4px;
}
.wp-fb-wc { text-align: center; font-size: 0.82rem; color: var(--tx-3); margin-bottom: 20px; }
.wp-fb-criteria { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px; }
.wp-fb-crit {
  background: var(--card); border: 1px solid var(--bd); border-radius: 10px; padding: 12px;
}
.wp-fb-crit-hd { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: 0.85rem; font-weight: 600; color: var(--tx); }
.wp-fb-crit-score { color: var(--v-teal); font-family: var(--f-mono); }
.wp-fb-crit-comment { font-size: 0.82rem; color: var(--tx-2); line-height: 1.5; }

.wp-fb-overall {
  background: var(--card); border: 1px solid var(--bd); border-radius: 10px;
  padding: 14px; font-size: 0.88rem; color: var(--tx); line-height: 1.6; margin-bottom: 16px;
}
.wp-fb-suggestions { font-size: 0.85rem; color: var(--tx-2); line-height: 1.6; }
.wp-fb-suggestions ul { margin: 6px 0 0 18px; padding: 0; }
.wp-fb-suggestions li { margin-bottom: 4px; }

.wp-fb-actions { display: flex; gap: 12px; justify-content: center; margin-top: 24px; }
.wp-fb-btn {
  background: var(--v-teal); color: #fff; border: none; padding: 10px 28px;
  border-radius: 10px; font-family: var(--f-body); font-size: 0.88rem;
  font-weight: 600; cursor: pointer; transition: background 0.2s;
}
.wp-fb-btn:hover { background: #1f6357; }
.wp-fb-btn-sec { background: none; border: 1px solid var(--bd); color: var(--tx-2); }
.wp-fb-btn-sec:hover { border-color: var(--v-teal); color: var(--v-teal); background: none; }

.wp-history-section { text-align: left; margin-top: 32px; }
.wp-history-title { font-family: var(--f-display); font-size: 1rem; font-weight: 700; color: var(--tx); margin-bottom: 10px; }
.wp-history-list { display: flex; flex-direction: column; gap: 6px; }
.wp-history-empty { color: var(--tx-3); font-size: 0.85rem; }
.wp-history-item {
  display: flex; align-items: center; gap: 12px; padding: 8px 12px;
  background: var(--card); border: 1px solid var(--bd); border-radius: 8px; font-size: 0.82rem;
}
.wp-history-type { font-family: var(--f-mono); color: var(--v-teal); font-weight: 600; }
.wp-history-band { font-weight: 600; color: var(--tx); }
.wp-history-wc { color: var(--tx-3); }
.wp-history-date { color: var(--tx-3); margin-left: auto; }

.hp-writing-cta .hp-speak-cta-icon { background: linear-gradient(135deg, #d97706 0%, #c07848 100%); }

@media (max-width: 600px) {
  .wp-setup { padding: 20px 16px; }
  .wp-editor { padding: 16px; }
  .wp-feedback { padding: 16px; }
  .wp-fb-criteria { grid-template-columns: 1fr; }
  .wp-topics { grid-template-columns: 1fr 1fr; }
}
/* ================================================================
   DICTATION PAGE
   ================================================================ */
.dc-header { position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--bd); }
.dc-header-inner { display: flex; align-items: center; justify-content: space-between; max-width: 800px; margin: 0 auto; padding: 14px 24px; }
.dc-back-btn { background: none; border: none; font-size: 0.9rem; color: var(--tx-2); cursor: pointer; font-family: var(--f-body); }
.dc-back-btn:hover { color: var(--v-teal); }
.dc-header-title { font-family: var(--f-display); font-size: 1.2rem; font-weight: 700; color: var(--tx); }
.dc-header-right { display: flex; align-items: center; gap: 8px; }

.dc-setup { max-width: 800px; margin: 0 auto; padding: 32px 24px; }
.dc-setup-inner { text-align: center; }
.dc-badge { display: inline-block; background: rgba(37,99,235,0.1); color: var(--c-listen); font-size: 0.78rem; font-weight: 600; padding: 4px 14px; border-radius: 12px; margin-bottom: 12px; }
.dc-setup-heading { font-family: var(--f-display); font-size: 1.8rem; font-weight: 700; color: var(--tx); margin-bottom: 8px; }
.dc-setup-sub { font-size: 0.9rem; color: var(--tx-3); margin-bottom: 20px; }

.dc-speed-row { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 24px; }
.dc-speed-label { font-size: 0.85rem; color: var(--tx-2); }
.dc-speed-btn {
  background: none; border: 1px solid var(--bd); font-family: var(--f-mono); font-size: 0.82rem;
  padding: 4px 14px; border-radius: 8px; cursor: pointer; color: var(--tx-2); transition: all 0.2s;
}
.dc-speed-btn.active { background: var(--c-listen); color: #fff; border-color: var(--c-listen); }

.dc-tests { display: flex; flex-direction: column; gap: 10px; text-align: left; }
.dc-test-card {
  background: var(--card); border: 1px solid var(--bd); border-radius: 10px; padding: 12px 16px;
}
.dc-test-title { font-size: 0.9rem; font-weight: 600; color: var(--tx); margin-bottom: 8px; }
.dc-test-sections { display: flex; gap: 8px; flex-wrap: wrap; }
.dc-sec-btn {
  background: var(--accent-blue-light); border: none; color: var(--c-listen); font-family: var(--f-body);
  font-size: 0.8rem; font-weight: 500; padding: 5px 14px; border-radius: 8px;
  cursor: pointer; transition: all 0.2s;
}
.dc-sec-btn:hover { background: var(--c-listen); color: #fff; }

.dc-session { max-width: 700px; margin: 0 auto; padding: 20px 24px; }
.dc-progress-bar {
  height: 4px; background: var(--bd); border-radius: 2px; margin-bottom: 24px; overflow: hidden;
}
.dc-progress-fill { height: 100%; background: var(--c-listen); border-radius: 2px; transition: width 0.3s; width: 0; }

.dc-sentence-box { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.dc-sent-num { font-family: var(--f-mono); font-size: 0.85rem; color: var(--tx-3); }
.dc-play-btn, .dc-replay-btn {
  background: var(--c-listen); color: #fff; border: none; padding: 8px 18px;
  border-radius: 8px; font-family: var(--f-body); font-size: 0.85rem;
  cursor: pointer; transition: background 0.2s;
}
.dc-play-btn:hover, .dc-replay-btn:hover { background: #1d4ed8; }
.dc-replay-btn { background: none; border: 1px solid var(--c-listen); color: var(--c-listen); }

.dc-input-area { display: flex; gap: 10px; margin-bottom: 16px; }
.dc-input {
  flex: 1; padding: 12px; border: 1px solid var(--bd); border-radius: 10px;
  font-family: var(--f-body); font-size: 0.9rem; color: var(--tx); background: var(--card);
  resize: none; outline: none; box-sizing: border-box;
}
.dc-input:focus { border-color: var(--c-listen); }
.dc-check-btn {
  background: var(--v-teal); color: #fff; border: none; padding: 12px 24px;
  border-radius: 10px; font-family: var(--f-body); font-size: 0.88rem;
  font-weight: 600; cursor: pointer; align-self: flex-end;
}

.dc-diff {
  background: var(--card); border: 1px solid var(--bd); border-radius: 10px;
  padding: 14px; margin-bottom: 16px;
}
.dc-diff-label { font-size: 0.78rem; color: var(--tx-3); margin-bottom: 8px; }
.dc-diff-words { font-size: 0.9rem; line-height: 1.8; }
.dc-w-ok { color: var(--c-read); }
.dc-w-wrong { color: var(--v-error); text-decoration: underline; cursor: help; }
.dc-w-miss { color: var(--tx-3); text-decoration: line-through; }

.dc-next-btn {
  background: var(--c-listen); color: #fff; border: none; padding: 10px 24px;
  border-radius: 10px; font-family: var(--f-body); font-size: 0.88rem;
  font-weight: 600; cursor: pointer; display: block; margin: 0 auto;
}

.dc-result { max-width: 500px; margin: 60px auto; text-align: center; }
.dc-result-inner {
  background: var(--card); border: 1px solid var(--bd); border-radius: 16px; padding: 40px;
}
.dc-result-icon {
  width: 64px; height: 64px; border-radius: 50%;
  background: rgba(37,99,235,0.1); color: var(--c-listen);
  font-size: 1.8rem; display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
}
.dc-result-title { font-family: var(--f-display); font-size: 1.4rem; font-weight: 700; color: var(--tx); margin-bottom: 8px; }
.dc-result-accuracy { font-family: var(--f-mono); font-size: 1.2rem; color: var(--c-listen); margin-bottom: 6px; }
.dc-result-stats { font-size: 0.85rem; color: var(--tx-3); margin-bottom: 24px; }
.dc-result-btn {
  background: var(--c-listen); color: #fff; border: none; padding: 10px 28px;
  border-radius: 10px; font-family: var(--f-body); font-size: 0.88rem;
  font-weight: 600; cursor: pointer;
}
@media (max-width: 600px) {
  .dc-setup { padding: 20px 16px; }
  .dc-session { padding: 16px; }
  .dc-input-area { flex-direction: column; }
}
/* ================================================================
   TIMED READING PAGE
   ================================================================ */
.tr-header { position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--bd); }
.tr-header-inner { display: flex; align-items: center; justify-content: space-between; max-width: 800px; margin: 0 auto; padding: 14px 24px; }
.tr-back-btn { background: none; border: none; font-size: 0.9rem; color: var(--tx-2); cursor: pointer; font-family: var(--f-body); }
.tr-back-btn:hover { color: var(--v-teal); }
.tr-header-title { font-family: var(--f-display); font-size: 1.2rem; font-weight: 700; color: var(--tx); }
.tr-header-right { display: flex; align-items: center; gap: 12px; }
.tr-timer { font-family: var(--f-mono); font-size: 0.95rem; color: var(--c-read); font-weight: 600; }

.tr-setup { max-width: 800px; margin: 0 auto; padding: 32px 24px; }
.tr-setup-inner { text-align: center; }
.tr-badge { display: inline-block; background: rgba(5,150,105,0.1); color: var(--c-read); font-size: 0.78rem; font-weight: 600; padding: 4px 14px; border-radius: 12px; margin-bottom: 12px; }
.tr-setup-heading { font-family: var(--f-display); font-size: 1.8rem; font-weight: 700; color: var(--tx); margin-bottom: 8px; }
.tr-setup-sub { font-size: 0.9rem; color: var(--tx-3); margin-bottom: 24px; }

.tr-passages { display: flex; flex-direction: column; gap: 10px; text-align: left; }
.tr-test-card { background: var(--card); border: 1px solid var(--bd); border-radius: 10px; padding: 12px 16px; }
.tr-test-title { font-size: 0.9rem; font-weight: 600; color: var(--tx); margin-bottom: 8px; }
.tr-test-passages { display: flex; gap: 8px; flex-wrap: wrap; }
.tr-pass-btn {
  background: var(--accent-green-light); border: none; color: var(--c-read);
  font-family: var(--f-body); font-size: 0.8rem; font-weight: 500;
  padding: 5px 14px; border-radius: 8px; cursor: pointer; transition: all 0.2s;
}
.tr-pass-btn:hover { background: var(--c-read); color: #fff; }
.tr-pass-wc { font-family: var(--f-mono); font-size: 0.72rem; opacity: 0.7; margin-left: 4px; }

.tr-reading { max-width: 800px; margin: 0 auto; padding: 20px 24px; }
.tr-passage-box {
  background: var(--card); border: 1px solid var(--bd); border-radius: 14px;
  padding: 24px; margin-bottom: 20px;
}
.tr-pass-title { font-family: var(--f-display); font-size: 1.2rem; font-weight: 700; color: var(--tx); margin-bottom: 12px; }
.tr-pass-text { font-size: 0.92rem; color: var(--tx); line-height: 1.8; }
.tr-pass-text p { margin-bottom: 10px; }
.tr-reading-footer { text-align: center; }
.tr-done-btn {
  background: var(--c-read); color: #fff; border: none; padding: 12px 32px;
  border-radius: 10px; font-family: var(--f-body); font-size: 0.92rem;
  font-weight: 600; cursor: pointer; transition: background 0.2s;
}
.tr-done-btn:hover { background: #047857; }

.tr-quiz { max-width: 700px; margin: 0 auto; padding: 20px 24px; }
.tr-quiz-info {
  text-align: center; font-size: 0.9rem; color: var(--tx-2); margin-bottom: 20px;
  padding: 12px; background: var(--card); border: 1px solid var(--bd); border-radius: 10px;
}
.tr-quiz-qs { display: flex; flex-direction: column; gap: 16px; margin-bottom: 20px; }
.tr-q-item { background: var(--card); border: 1px solid var(--bd); border-radius: 10px; padding: 14px; }
.tr-q-text { font-size: 0.9rem; color: var(--tx); margin-bottom: 10px; font-weight: 500; }
.tr-q-opts { display: flex; flex-direction: column; gap: 6px; }
.tr-q-opt { font-size: 0.85rem; color: var(--tx-2); cursor: pointer; padding: 4px 0; }
.tr-q-input {
  width: 100%; padding: 8px 12px; border: 1px solid var(--bd); border-radius: 8px;
  font-family: var(--f-body); font-size: 0.88rem; color: var(--tx); background: var(--surface);
  outline: none; box-sizing: border-box;
}
.tr-quiz-submit {
  display: block; margin: 0 auto; background: var(--c-read); color: #fff; border: none;
  padding: 10px 28px; border-radius: 10px; font-family: var(--f-body);
  font-size: 0.88rem; font-weight: 600; cursor: pointer;
}

.tr-result { max-width: 500px; margin: 40px auto; padding: 0 24px; }
.tr-result-inner {
  background: var(--card); border: 1px solid var(--bd); border-radius: 16px;
  padding: 40px; text-align: center;
}
.tr-res-wpm {
  font-family: var(--f-display); font-size: 3.5rem; font-weight: 700; color: var(--c-read);
}
.tr-res-wpm-label { font-size: 0.82rem; color: var(--tx-3); margin-bottom: 4px; }
.tr-res-level { font-size: 1rem; font-weight: 600; color: var(--tx); margin-bottom: 16px; }

.tr-res-bar {
  position: relative; height: 12px; background: var(--bd); border-radius: 6px;
  margin-bottom: 4px; overflow: visible;
}
.tr-res-bar-fill { height: 100%; background: linear-gradient(90deg, #ef4444, #d97706, #059669); border-radius: 6px; }
.tr-res-bar-target {
  position: absolute; top: -18px; transform: translateX(-50%);
  font-size: 0.7rem; color: var(--tx-3); font-family: var(--f-mono);
}
.tr-res-bar-target::after {
  content: ''; position: absolute; left: 50%; top: 100%;
  transform: translateX(-50%); width: 1px; height: 18px; background: var(--tx-3);
}
.tr-res-bar-labels {
  display: flex; justify-content: space-between; font-size: 0.68rem; color: var(--tx-3);
  font-family: var(--f-mono); margin-bottom: 16px;
}

.tr-res-comp { font-size: 0.92rem; color: var(--tx); margin-bottom: 6px; }
.tr-res-time { font-size: 0.82rem; color: var(--tx-3); margin-bottom: 24px; }
.tr-res-actions { display: flex; gap: 12px; justify-content: center; }
.tr-res-btn {
  background: var(--c-read); color: #fff; border: none; padding: 10px 24px;
  border-radius: 10px; font-family: var(--f-body); font-size: 0.88rem;
  font-weight: 600; cursor: pointer;
}
.tr-res-btn-sec { background: none; border: 1px solid var(--bd); color: var(--tx-2); }

@media (max-width: 600px) {
  .tr-setup { padding: 20px 16px; }
  .tr-reading { padding: 16px; }
  .tr-result { margin: 20px auto; }
}
