:root {
  --ty-primary: #0284c7;
  --ty-primary-hover: #0369a1;
  --ty-bg-card: #ffffff;
  --ty-border: #e2e8f0;
  --ty-text-main: #0f172a;
  --ty-text-muted: #64748b;
  --ty-pill-bg: #f1f5f9;
  --ty-pill-hover: #e2e8f0;
  --ty-result-bg: #f8fafc;
  --ty-hl-bg: #e0f2fe;
  --ty-hl-border: #bae6fd;
  --ty-hl-text: #0369a1;
  --ty-char-correct: #16a34a;
  --ty-char-incorrect: #dc2626;
  --ty-cursor: #0284c7;
}

.ty-tool-container {
  max-width: 880px;
  margin: 0 auto 3rem auto;
  font-family: inherit;
  color: var(--ty-text-main);
}

.ty-editor-card {
  background: var(--ty-bg-card);
  border: 1px solid var(--ty-border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.ty-config-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--ty-border);
}

.ty-config-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.ty-cfg-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--ty-text-muted);
  margin-right: 0.35rem;
}

.ty-pill-btn {
  background: var(--ty-pill-bg);
  border: 1px solid var(--ty-border);
  color: var(--ty-text-main);
  border-radius: 9999px;
  padding: 0.3rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.ty-pill-btn:hover {
  background: var(--ty-pill-hover);
  border-color: var(--ty-primary);
}

.ty-pill-active {
  background: var(--ty-primary);
  color: #ffffff;
  border-color: var(--ty-primary);
}

.ty-display-wrap {
  position: relative;
  margin-bottom: 1.25rem;
}

.ty-timer-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.ty-timer-val {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--ty-primary);
}

.ty-timer-hint {
  font-size: 0.8rem;
  color: var(--ty-text-muted);
}

.ty-words-box {
  background: var(--ty-result-bg);
  border: 2px solid var(--ty-border);
  border-radius: 10px;
  padding: 1.25rem;
  min-height: 140px;
  max-height: 180px;
  overflow-y: hidden;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 1.2rem;
  line-height: 1.8;
  letter-spacing: 0.05em;
  cursor: text;
  outline: none;
  user-select: none;
}

.ty-words-box:focus-within,
.ty-words-box:focus {
  border-color: var(--ty-primary);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.ty-hidden-input {
  position: absolute;
  top: -9999px;
  left: -9999px;
  opacity: 0;
}

.ty-char {
  position: relative;
  color: var(--ty-text-muted);
}

.ty-correct {
  color: var(--ty-char-correct);
}

.ty-incorrect {
  color: var(--ty-char-incorrect);
  text-decoration: underline;
  background: rgba(220, 38, 38, 0.15);
  border-radius: 2px;
}

.ty-cursor-char {
  background: var(--ty-cursor);
  color: #ffffff !important;
  border-radius: 2px;
  animation: tyBlink 1s infinite;
}

@keyframes tyBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.ty-action-row {
  display: flex;
  gap: 0.75rem;
}

.ty-primary-btn {
  flex: 2;
  background: var(--ty-primary);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 0.85rem 1.5rem;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease;
}

.ty-primary-btn:hover {
  background: var(--ty-primary-hover);
}

.ty-secondary-btn {
  background: var(--ty-pill-bg);
  color: var(--ty-text-main);
  border: 1px solid var(--ty-border);
  border-radius: 8px;
  padding: 0.85rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}

.ty-results-card {
  background: var(--ty-result-bg);
  border: 1px solid var(--ty-border);
  border-radius: 12px;
  padding: 1.75rem;
}

.ty-highlight-box {
  background: var(--ty-hl-bg);
  border: 1px solid var(--ty-hl-border);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  margin-bottom: 1.5rem;
}

.ty-hl-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--ty-hl-text);
  margin-bottom: 0.25rem;
  display: block;
}

.ty-hl-val {
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--ty-hl-text);
  margin-bottom: 0.25rem;
}

.ty-hl-sub {
  font-size: 0.95rem;
  color: var(--ty-hl-text);
}

.ty-specs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 640px) {
  .ty-specs-grid {
    grid-template-columns: 1fr;
  }
}

.ty-spec-item {
  background: var(--ty-bg-card);
  border: 1px solid var(--ty-border);
  border-radius: 8px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.ty-spec-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ty-text-muted);
}

.ty-spec-val {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--ty-text-main);
}

.ty-spec-sub {
  font-size: 0.75rem;
  color: var(--ty-text-muted);
}

.ty-table-card {
  background: var(--ty-bg-card);
  border: 1px solid var(--ty-border);
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.ty-sub-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0 0 0.75rem 0;
  color: var(--ty-text-main);
}

.ty-table-wrap {
  overflow-x: auto;
}

.ty-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  text-align: left;
}

.ty-table th,
.ty-table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--ty-border);
}

.ty-table th {
  background: var(--ty-pill-bg);
  font-weight: 700;
  color: var(--ty-text-muted);
}

.ty-tip-box {
  background: var(--ty-bg-card);
  border: 1px solid var(--ty-border);
  border-radius: 8px;
  padding: 1.25rem;
}

.ty-tip-title {
  font-size: 0.9rem;
  font-weight: 700;
  margin: 0 0 0.25rem 0;
  color: var(--ty-primary);
}

.ty-tip-box p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--ty-text-muted);
  line-height: 1.5;
}

.ty-ad {
  overflow: hidden;
  min-height: 280px;
}
/* tf:dark-palette — generated by migrate_chrome.py */
/* Neutrals inherit the shared chrome tokens so all tools share one
   ground; brand hues are kept and lightened, never inverted. */
[data-theme="dark"] {
  --ty-primary: #81bcda;
  --ty-primary-hover: #69aed4;
  --ty-bg-card: var(--tf-surface);
  --ty-border: var(--tf-surface);
  --ty-text-main: var(--tf-ink);
  --ty-text-muted: var(--tf-ink-faint);
  --ty-pill-bg: var(--tf-surface);
  --ty-pill-hover: var(--tf-surface);
  --ty-result-bg: var(--tf-surface);
  --ty-hl-bg: var(--tf-surface);
  --ty-hl-border: #81bbda;
  --ty-hl-text: #69aed4;
  --ty-char-correct: #7ad89d;
  --ty-char-incorrect: #da8181;
  --ty-cursor: #81bcda;
}
