:root { --ts-paper:#070b12; --ts-ink:#f8fafc; --ts-green:#10b981; --ts-lime:#10b981; --ts-line:#1e2c44; }
body { background:var(--ts-paper); color:var(--ts-ink); }
#header { padding-block:.55rem !important; background:#0b111e !important; border-bottom:1px solid var(--ts-line); }
#header .hlogo { width:min(245px, 100%); height:auto; max-height:62px; }
footer .flogo { width:min(220px, 100%); height:auto; }
body footer.footer { background:#070b12 !important; color:#edf0e6 !important; }
body footer.footer a, body footer.footer .flink { color:#edf0e6; }
body nav .ruby-menu, body nav .ruby-wrapper { background:var(--ts-green) !important; }
body nav .ruby-menu>li>a { color:#fff !important; }
body nav .ruby-menu>li:hover>a,body nav .ruby-menu>li>a:focus-visible { background:#10b981 !important; color:#070b12 !important; }
#_search_q, input[type="text"], input[type="number"], textarea, select { border-radius:.5rem; }
.btn { border-radius:.5rem; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline:2px solid #2e8064; outline-offset:2px; }
.ts-hero { display:grid; grid-template-columns:minmax(0,1fr) minmax(200px,.52fr); gap:1.5rem; padding:clamp(1.3rem,4vw,3.3rem); margin:1.15rem 0 1.25rem; border-radius:1.3rem; background:#131c31; color:#f8fafc; align-items:center; }
.ts-hero h1 { font:700 clamp(2rem,5vw,4rem)/1.04 system-ui,sans-serif; letter-spacing:-.04em; margin:.35rem 0 .8rem; }
.ts-hero p { line-height:1.65; max-width:54ch; }
.ts-hero .label { color:#e5fa91; font:700 .78rem/1.3 system-ui,sans-serif; text-transform:uppercase; letter-spacing:.12em; }
.ts-start { background:#0e1524; color:#f8fafc; padding:1.1rem; border-radius:.8rem; display:grid; gap:.55rem; }
.ts-start a { color:#f8fafc; background:#131c31; padding:.7rem .9rem; border-radius:.55rem; font-weight:700; }
.ts-start a:first-of-type { background:#10b981; }
@media(max-width:700px) { .ts-hero { grid-template-columns:1fr; } }
.ts-tool-grid { margin-block:1rem 2rem; }
.ts-tool-grid .link_block { background:#0b111e !important; border-radius:1rem !important; overflow:hidden; }
.ts-tool-grid .bl:hover { background:#18233c !important; }
nav > .menu, nav .ruby-menu-demo-header, body nav .ruby-wrapper, body nav .ruby-wrapper > ul.ruby-menu { background:#0e1524 !important; }
.ts-practice-note { max-width:72rem; margin:2.4rem auto; padding:clamp(1rem,4vw,2.6rem); border:1px solid #1e2c44; border-radius:1rem; background:#131c31; color:#f8fafc; line-height:1.65; }
.ts-practice-note h2 { font:750 clamp(1.55rem,4vw,2.25rem)/1.2 system-ui,sans-serif; margin-bottom:.75rem; }
.ts-practice-note h3 { font-size:1.12rem; }
.ts-practice-note blockquote { background:var(--bg-surface,#0e1524); color:var(--text-main,inherit); margin:.7rem 0 1.1rem; padding:.65rem 1rem; border-inline-start:4px solid #10b981; }
.ts-practice-note nav { display:flex; flex-wrap:wrap; gap:.45rem 1rem; }
.ts-practice-note a { color:#10b981; text-decoration:underline; }
body td._key { border-radius:.42rem; box-shadow:inset 0 -2px 0 #243c3326; }
body td._key:focus-visible { outline:2px solid #2e8064; outline-offset:1px; }

/* Compact Tutor Header Styling */
#_nav {
  display: flex !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 0.5rem !important;
  padding: 0.5rem 1.25rem !important;
  background: #0e1524 !important;
  border-bottom: 1px solid #1e2c44 !important;
}
.ts-compact-brand {
  display: inline-flex !important;
  align-items: center !important;
  text-decoration: none !important;
}
.ts-compact-brand img {
  height: 26px !important;
  width: auto !important;
  max-width: 140px !important;
  vertical-align: middle !important;
}
@media (max-width: 600px) {
  #_nav {
    padding: 0.4rem 0.6rem !important;
    gap: 0.35rem !important;
  }
  .ts-compact-brand img {
    height: 22px !important;
  }
}

/* Tool Upgrades - Shared Utility Bar */
.ts-util-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.55rem 0.85rem;
  background: #0e1524;
  border: 1px solid #1e2c44;
  border-radius: 0.6rem;
  margin: 0.5rem 0;
  font: 13px/1.4 system-ui, sans-serif;
  color: #f8fafc;
}
.ts-util-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.ts-badge {
  background: #131c31;
  padding: 0.2rem 0.55rem;
  border-radius: 0.35rem;
  border: 1px solid #1e2c44;
  font-weight: 600;
  font-size: 12px;
}
.ts-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.65rem;
  border-radius: 0.4rem;
  border: 1px solid #1e2c44;
  background: #131c31;
  color: #10b981;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
}
.ts-btn:hover {
  background: var(--ts-green);
  color: #04130d;
  text-decoration: none;
}
.ts-btn-primary {
  background: var(--ts-green);
  color: #04130d;
}
.ts-btn-primary:hover {
  background: #059669;
}

/* Typing Test Result Summary Upgrade */
.ts-result-summary {
  margin: 1.25rem auto;
  max-width: 770px;
  background: #131c31;
  border: 2px solid #1e2c44;
  border-radius: 0.85rem;
  padding: 1.25rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  font-family: system-ui, sans-serif;
}
.ts-result-summary h3 {
  margin: 0 0 0.75rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: #10b981;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ts-result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.ts-result-card {
  background: #0e1524;
  border: 1px solid #1e2c44;
  border-radius: 0.5rem;
  padding: 0.75rem;
  text-align: center;
}
.ts-result-card .ts-res-val {
  font-size: 1.6rem;
  font-weight: 750;
  color: #10b981;
  line-height: 1.1;
}
.ts-result-card .ts-res-lbl {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: #94a3b8;
  font-weight: 600;
  margin-top: 0.25rem;
}
.ts-result-comparison {
  background: #0e1524;
  border-radius: 0.45rem;
  padding: 0.5rem 0.85rem;
  margin-bottom: 0.85rem;
  font-size: 0.88rem;
}
.ts-result-comparison.improved {
  border-left: 4px solid #2e8064;
  color: #10b981;
}
.ts-result-comparison.declined {
  border-left: 4px solid #b7382d;
  color: #f43f5e;
}
.ts-result-comparison.same {
  border-left: 4px solid #75867e;
  color: #94a3b8;
}

/* Tutor Progress & Resume Banner */
.ts-tutor-resume {
  background: linear-gradient(135deg, #0e1524, #131c31);
  color: #fff;
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
  margin: 1.2rem auto;
  max-width: 900px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.8rem;
}
.ts-tutor-resume a {
  background: var(--ts-lime);
  color: #04130d;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-weight: 700;
  text-decoration: none;
}
.ts-lesson-done-badge {
  display: inline-block;
  margin-left: 6px;
  color: #10b981;
  font-weight: bold;
}

/* Game Wrapper Upgrade */
.ts-game-wrapper {
  background: #131c31;
  border: 1px solid #1e2c44;
  border-radius: 0.85rem;
  padding: 1rem;
  margin: 1rem auto;
  max-width: 900px;
}
.ts-game-instructions {
  background: #0e1524;
  border-left: 4px solid var(--ts-green);
  padding: 0.75rem 1rem;
  border-radius: 0.4rem;
  margin-bottom: 0.85rem;
  font-size: 0.92rem;
  line-height: 1.5;
}

/* Two-pane layout for converters & translators */
@media (min-width: 768px) {
  .ts-two-pane {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 1.2rem !important;
  }
}

[data-theme="light"] {
  --ts-paper: #f8fafc;
  --ts-ink: #0f172a;
  --ts-green: #059669;
  --ts-lime: #10b981;
  --ts-line: #cbd5e1;
}

[data-theme="light"] body {
  background: var(--ts-paper) !important;
  color: var(--ts-ink) !important;
}

[data-theme="light"] #_nav {
  background: #ffffff !important;
  border-bottom: 1px solid #cbd5e1 !important;
}

[data-theme="light"] .ts-util-bar {
  background: #f1f5f9 !important;
  border: 1px solid #cbd5e1 !important;
  color: #0f172a !important;
}

[data-theme="light"] .ts-badge {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #0f172a !important;
}

[data-theme="light"] .ts-btn {
  background: #ffffff !important;
  color: #047857 !important;
  border: 1px solid #cbd5e1 !important;
}
