/* Writing Assistance — AI teacher card (Claude Code, 2026-10-29). Uses the app's tokens; layout of the issue cards
   comes from screens.css (.issue-card etc., Antigravity). */
.wr-ai-card .results-head { display: flex; flex-direction: column; gap: 6px; }
.wr-ai-tag { font-size: .75rem; font-weight: 600; padding: 2px 9px; border-radius: 999px; color: var(--metal-text);
  background: color-mix(in srgb, var(--metal) 14%, transparent); border: 1px solid color-mix(in srgb, var(--metal) 40%, transparent); white-space: nowrap; }
.wr-ai-note { margin: 0; font-size: .8125rem; line-height: 1.45; color: var(--text-2); }
.wr-ai-card .issues-list:empty { display: none; }
.wr-ai-wait { display: flex; gap: 6px; justify-content: center; padding: 18px 0; }
.wr-ai-wait span { width: 8px; height: 8px; border-radius: 50%; background: var(--metal); opacity: .35; animation: wrAiDot 1s infinite ease-in-out; }
.wr-ai-wait span:nth-child(2) { animation-delay: .15s; }
.wr-ai-wait span:nth-child(3) { animation-delay: .3s; }
@keyframes wrAiDot { 0%, 100% { opacity: .25; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .wr-ai-wait span { animation: none; opacity: .7; } }
a.gemini-default-pill { text-decoration: none; color: inherit; }
a.gemini-default-pill:focus-visible { outline: 2px solid var(--metal); outline-offset: 2px; }
#btnAskAI:disabled { opacity: .6; cursor: progress; }
/* Grammar panel: part-of-speech heading when a word has several (house: Noun / Verb) — Claude Code 2026-10-29 */
.wr-pos-head { margin: 14px 0 2px; font-size: .8125rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--metal-text); }
.wr-pos-head:first-child { margin-top: 2px; }
.vstruct-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
/* Full sentences: Learner / C1 / C2 — compact rows (Claude Code 2026-10-29; owner "compact, erase unused parts") */
.wr-lv-card .results-head { gap: 2px; }
.wr-lv-list, .wr-lv-dict { display: flex; flex-direction: column; gap: 6px; }
.wr-lv-list:empty { display: none; }
.wr-lv-dict { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--hairline); }
.wr-lv-dh { margin: 0; font-size: .75rem; font-weight: 600; color: var(--text-2); display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.wr-lv-dh .ic { width: 14px; height: 14px; color: var(--metal); }
.wr-lv-row { display: grid; grid-template-columns: auto 1fr auto; align-items: start; gap: 8px; padding: 7px 8px;
  border-radius: 8px; border: 1px solid var(--hairline); background: color-mix(in srgb, var(--surface) 60%, transparent); }
.wr-lv-badge { min-width: 52px; text-align: center; font-size: .6875rem; font-weight: 700; padding: 3px 6px; border-radius: 4px; margin-top: 2px; }
.wr-lv-learner { background: #2F7D4F; color: #fff; }
.wr-lv-c1 { background: #2457C5; color: #fff; }
.wr-lv-c2 { background: #7A3FB8; color: #fff; }
.wr-lv-body { min-width: 0; }
.wr-lv-text { margin: 0; font-size: .9375rem; line-height: 1.4; color: var(--text); }
.wr-lv-label { display: block; margin-top: 1px; font-size: .6875rem; color: var(--text-2); line-height: 1.25; }
.wr-lv-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.wr-lv-tag { display: inline-flex; align-items: center; font-size: .6875rem; font-weight: 500; line-height: 1.25; padding: 2px 7px; border-radius: 4px; background: color-mix(in srgb, var(--metal) 12%, transparent); color: var(--text-2); border: 1px solid var(--hairline); }
.wr-lv-tag.wr-lv-tag-structure { font-weight: 600; color: var(--head); background: color-mix(in srgb, var(--accent) 12%, transparent); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
.issue-rule { margin: 4px 0 0; font-size: .75rem; color: var(--text-2); line-height: 1.35; }
.issue-rule-lbl { font-weight: 600; color: var(--head); margin-right: 4px; }
.wr-lv-actions { display: flex; gap: 2px; }
.wr-lv-ic { width: 32px; height: 32px; display: inline-grid; place-items: center; border: 0; border-radius: 50%; background: none; color: var(--text-2); cursor: pointer; }
.wr-lv-ic:hover, .wr-lv-ic:focus-visible { background: color-mix(in srgb, var(--metal) 16%, transparent); color: var(--head); }
.wr-lv-ic .ic { width: 17px; height: 17px; }
/* compact action row under the text box */
.wr-actions-compact { gap: 8px; flex-wrap: nowrap; }
.wr-actions-compact .btn { flex: 1 1 0; min-width: 0; padding: 9px 10px; font-size: .875rem; justify-content: center; white-space: nowrap; }
.wr-actions-compact .btn .ic { width: 16px; height: 16px; }
#writingResultsCard .issues-list:empty { display: none; }
.wr-ai-note:empty { display: none; }
#vstructEmpty:empty { display: none; }
.install-free { margin-left: 6px; font-size: .6875rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: #2F7D4F; color: #fff; vertical-align: middle; }
/* Search in your own language: header row + translation next to each English word (Claude Code 2026-10-29) */
.suggest .sg-head { padding: 6px 12px 2px; font-size: .6875rem; font-weight: 700; letter-spacing: .03em; color: var(--text-2); cursor: default; }
.suggest .sg-g { flex: 1; min-width: 0; margin: 0 8px; font-size: .8125rem; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tv-thumb-wrap .tv-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.tv-thumb-wrap[data-id] { cursor: pointer; }
/* Full-screen video viewer for LexiGlobal TV (Claude Code 2026-10-29) */
.tvx { position: fixed; inset: 0; z-index: 9999; background: #000; display: flex; align-items: center; justify-content: center;
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px); }
.tvx-frame { position: relative; width: min(100vw, calc(100vh * 16 / 9)); aspect-ratio: 16 / 9; }
.tvx-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.tvx-close { position: absolute; top: calc(10px + env(safe-area-inset-top, 0px)); right: calc(10px + env(safe-area-inset-right, 0px)); z-index: 2;
  width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255,255,255,.14); color: #fff; display: grid; place-items: center; cursor: pointer; }
.tvx-close .ic { width: 20px; height: 20px; }
body.tvx-open { overflow: hidden; }
/* Course playlists in the full-screen viewer (Claude Code 2026-10-29) */
.tvx:has(.tvx-list) { flex-direction: column; justify-content: flex-start; overflow-y: auto; }
.tvx:has(.tvx-list) .tvx-frame { flex-shrink: 0; margin-top: calc(56px + env(safe-area-inset-top, 0px)); }
.tvx-list { width: min(100vw, 760px); padding: 12px 14px 28px; box-sizing: border-box; color: #fff; }
.tvx-h { margin: 0 0 8px; font-size: 1rem; font-weight: 700; color: #F3D58A; }
.tvx-list ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.tvx-item { width: 100%; display: grid; grid-template-columns: 26px 1fr auto; gap: 8px; align-items: center; text-align: left;
  padding: 9px 10px; border: 0; border-radius: 8px; background: rgba(255,255,255,.06); color: #E8EDF7; font-size: .875rem; cursor: pointer; }
.tvx-item.is-on { background: rgba(243,213,138,.18); color: #fff; }
.tvx-n { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.12); font-size: .6875rem; font-weight: 700; }
.tvx-item.is-on .tvx-n { background: #F3D58A; color: #0C121E; }
.tvx-d { font-size: .75rem; color: #AEB8CC; }
.tvx-note { margin: 10px 2px 0; font-size: .75rem; color: #AEB8CC; }
.tvx { overflow-x: hidden; } .tvx-frame { max-width: 100%; }
.tvx-frame { width: min(100%, calc(100vh * 16 / 9)); } .tvx-list { width: min(100%, 760px); }
.tvx-t small.tvx-s { display: block; margin-top: 1px; font-size: .6875rem; color: #AEB8CC; }
/* 2026-10-29 owner ("X key cannot close because it is under …"): in Telegram full screen the close button sat under Telegram's
   floating ⌄ ⋯ controls. Put it below them (Telegram's safe + content-safe insets) and push the video down to match. */
.tvx { --tvx-top: max(env(safe-area-inset-top, 0px), var(--tg-top, 0px)); }
.tvx-close { top: calc(10px + var(--tvx-top)); }
.tvx:has(.tvx-list) .tvx-frame { margin-top: calc(60px + var(--tvx-top)); }
.tvx:not(:has(.tvx-list)) .tvx-frame { margin-top: var(--tvx-top); }
/* 2026-10-29 owner (tablet): "and button X" — a larger, clearly visible ✕ */
.tvx-close { width: 44px; height: 44px; background: rgba(255,255,255,.22); border: 1px solid rgba(255,255,255,.45); color: #fff; }
.tvx-close .ic { width: 22px; height: 22px; }
/* 2026-10-29 Video Lessons progress (core/video-progress.js) */
.tv-prog { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.tv-prog-bar { flex: 0 0 64px; height: 5px; border-radius: 3px; background: color-mix(in srgb, currentColor 18%, transparent); overflow: hidden; }
.tv-prog-bar i { display: block; height: 100%; background: #F3D58A; border-radius: 3px; }
.tv-prog-t { font-size: .75rem; color: var(--muted, #8A93A6); }
.tvx-item.is-done .tvx-n { background: #3BA776; color: #fff; }
/* 2026-10-29 word page "Watch" links to Video Lessons (core/video-links.js) */
.word-watch { display: flex; flex-direction: column; gap: 6px; margin: 12px 0 4px; }
.ww-h { display: inline-flex; align-items: center; gap: 6px; font-size: .8125rem; font-weight: 700; color: var(--head); }
.ww-h .ic { width: 16px; height: 16px; }
.ww-item { display: block; padding: 8px 12px; border-radius: 12px; text-decoration: none; color: var(--head);
  background: color-mix(in srgb, currentColor 7%, transparent); border: 1px solid color-mix(in srgb, currentColor 14%, transparent); }
.ww-t { display: block; font-size: .875rem; line-height: 1.3; }
.ww-c { display: block; font-size: .75rem; color: var(--muted, #8A93A6); margin-top: 1px; }

/* 2026-10-30 Claude Code — estimated word level (owner "fill it all words"): outlined instead of filled, with "est." */
.word-meta .cefr.lvl-est { background: transparent !important; color: inherit !important; border: 1.5px dashed #1E4FB0; font-weight: 700; }
.word-meta .cefr.lvl-est.lvl-essential { border-color: #1f8a5b; }
.word-meta .cefr.lvl-est.lvl-academic { border-color: #2d6cdf; }
.word-meta .cefr.lvl-est.lvl-c1 { border-color: #9a3fb5; }
.word-meta .cefr.lvl-est.lvl-c2 { border-color: #c4534f; }
.word-meta .lvl-est-tag { font-weight: 500; font-size: .85em; opacity: .8; }

/* ---- Paraphrase Sentence Engine (Antigravity 2026-10-31) ---- */
.wr-view-tabs { display: flex; gap: 8px; margin-top: 10px; border-bottom: 1px solid var(--hairline); padding-bottom: 8px; }
.wr-tab-btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--text-2); font-size: .8125rem; font-weight: 600; cursor: pointer; transition: all .15s ease; }
.wr-tab-btn:hover { background: color-mix(in srgb, var(--metal) 12%, transparent); color: var(--head); }
.wr-tab-btn.active { background: color-mix(in srgb, #F3D58A 18%, transparent); color: var(--head); border-color: color-mix(in srgb, #F3D58A 45%, transparent); }
.wr-tab-btn .badge-count { font-size: .6875rem; font-weight: 700; padding: 1px 6px; border-radius: 999px; background: color-mix(in srgb, currentColor 18%, transparent); }

/* Paraphrase Toolbar Controls: Space-Saving Segmented Level Bar (1-Row, No Bloat) */
.paraphrase-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  padding: 4px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface) 60%, transparent);
  border: 1px solid var(--hairline);
}

.para-segmented-bar {
  display: flex;
  width: 100%;
  gap: 4px;
  background: color-mix(in srgb, var(--metal) 12%, rgba(0,0,0,0.25));
  padding: 3px;
  border-radius: 8px;
}

.btn-lvl-pill {
  flex: 1 1 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 8px;
  min-height: 36px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  transition: all 0.16s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.btn-lvl-pill:hover {
  background: color-mix(in srgb, var(--metal) 18%, transparent);
  color: var(--head);
}

.btn-lvl-pill .lvl-tag {
  font-weight: 800;
  font-size: 0.875rem;
  letter-spacing: 0.02em;
}

.btn-lvl-pill .lvl-name {
  font-size: 0.75rem;
  font-weight: 500;
  opacity: 0.85;
}

.btn-lvl-pill.active {
  background: #1E3A8A;
  color: #FFFFFF;
  border-color: #3B82F6;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.35);
}

.btn-lvl-pill[data-lvl="B1"].active {
  background: #0284C7;
  border-color: #38BDF8;
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(56, 189, 248, 0.35);
}

.btn-lvl-pill[data-lvl="B2"].active {
  background: #926C15;
  border-color: #F3D58A;
  color: #FFFDF0;
  box-shadow: 0 2px 8px rgba(243, 213, 138, 0.35);
}

.btn-lvl-pill[data-lvl="C1"].active {
  background: #6D28D9;
  border-color: #A855F7;
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(168, 85, 247, 0.35);
}

.btn-lvl-pill[data-lvl="C2"].active {
  background: #BE123C;
  border-color: #FB7185;
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(251, 113, 133, 0.35);
}

/* Paraphrase List Container */
.paraphrase-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 10px;
}

/* Paraphrase Result Card: Polished, High Readability */
.paraphrase-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 14px;
  background: linear-gradient(145deg, color-mix(in srgb, var(--surface) 96%, #182234) 0%, color-mix(in srgb, var(--surface) 86%, #0F172A) 100%);
  border: 1px solid color-mix(in srgb, var(--card-accent, #F3D58A) 32%, var(--hairline));
  border-left: 5px solid var(--card-accent, #F3D58A);
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.18s ease, box-shadow 0.18s ease;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12), 0 1px 3px rgba(0, 0, 0, 0.08);
}

.paraphrase-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--card-accent, #F3D58A) 65%, transparent);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18), 0 0 0 1px color-mix(in srgb, var(--card-accent, #F3D58A) 25%, transparent);
}

.paraphrase-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.paraphrase-badge-group {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.paraphrase-badge {
  font-size: 0.6875rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: 0.05em;
  background: var(--card-accent, #F3D58A);
  color: #0C121E;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.paraphrase-structure-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.paraphrase-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.btn-accept-paraphrase {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 700;
  background: #16A34A;
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
  transition: all 0.16s ease;
  box-shadow: 0 2px 6px rgba(22, 163, 74, 0.35);
  -webkit-tap-highlight-color: transparent;
}

.btn-accept-paraphrase:hover {
  background: #15803D;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(22, 163, 74, 0.45);
}

.btn-accept-paraphrase:active {
  transform: translateY(1px);
}

.btn-accept-paraphrase .ic {
  width: 14px;
  height: 14px;
}

.btn-paraphrase-speak {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--hairline);
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.16s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn-paraphrase-speak:hover {
  background: color-mix(in srgb, var(--metal) 20%, transparent);
  color: var(--head);
  border-color: var(--metal);
}

.btn-paraphrase-speak .ic {
  width: 15px;
  height: 15px;
}

/* Original Reference Quote: Subtle & Discreet */
.para-orig-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 0.8125rem;
  color: var(--muted, #94A3B8);
  padding: 4px 10px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--metal) 8%, rgba(0, 0, 0, 0.18));
  border-left: 2px solid color-mix(in srgb, var(--text-2) 35%, transparent);
}

.para-orig-lbl {
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-2);
  flex-shrink: 0;
}

.para-orig-txt {
  font-style: italic;
  color: var(--muted, #94A3B8);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* HERO: The Rewritten Paraphrased Sentence — Eye-catching, Elegant Typography */
.paraphrase-sentence {
  margin: 4px 0 2px 0;
  font-size: 1.1875rem;
  font-weight: 600;
  line-height: 1.62;
  color: var(--head, #F8FAFC);
  letter-spacing: -0.01em;
  word-break: break-word;
  text-rendering: optimizeLegibility;
}

/* Rules applied badges: High-Contrast Purple for crystal clear phone reading */
.para-rules-applied {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 2px;
}

.para-rule-pill {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 11px;
  border-radius: 6px;
  background: #1E293B;
  color: #F8FAFC;
  border: 1px solid #475569;
  letter-spacing: 0.01em;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

/* Vocabulary changes diff: High-contrast, crystal clear reading on any background */
.para-vocab-changes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 5px;
}

.vocab-diff-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.8125rem;
  padding: 4px 11px;
  border-radius: 6px;
  background: #0B132B;
  border: 1px solid #334155;
  color: #F8FAFC;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
}

.vocab-orig {
  text-decoration: line-through;
  text-decoration-color: #F87171;
  text-decoration-thickness: 1.5px;
  color: #94A3B8;
  font-weight: 600;
}

.vocab-arrow {
  color: #38BDF8;
  font-weight: 800;
  font-size: 0.95rem;
}

.vocab-repl {
  font-weight: 800;
  color: #34D399;
}

/* Light Theme Overrides: Clean, distinct, high-contrast badges */
:root[data-theme="silver-platinum"] .para-rule-pill,
:root[data-theme="champagne-ivory"] .para-rule-pill,
:root[data-theme="sapphire-silver"] .para-rule-pill,
:root:not([data-theme]) .para-rule-pill {
  background: #EEF2F6;
  color: #0F172A;
  border-color: #94A3B8;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

:root[data-theme="silver-platinum"] .vocab-diff-chip,
:root[data-theme="champagne-ivory"] .vocab-diff-chip,
:root[data-theme="sapphire-silver"] .vocab-diff-chip,
:root:not([data-theme]) .vocab-diff-chip {
  background: #FFFFFF;
  border-color: #CBD5E1;
  color: #0F172A;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

:root[data-theme="silver-platinum"] .vocab-orig,
:root[data-theme="champagne-ivory"] .vocab-orig,
:root[data-theme="sapphire-silver"] .vocab-orig,
:root:not([data-theme]) .vocab-orig {
  color: #64748B;
  text-decoration-color: #DC2626;
  text-decoration-thickness: 1.5px;
}

:root[data-theme="silver-platinum"] .vocab-arrow,
:root[data-theme="champagne-ivory"] .vocab-arrow,
:root[data-theme="sapphire-silver"] .vocab-arrow,
:root:not([data-theme]) .vocab-arrow {
  color: #2563EB;
}

:root[data-theme="silver-platinum"] .vocab-repl,
:root[data-theme="champagne-ivory"] .vocab-repl,
:root[data-theme="sapphire-silver"] .vocab-repl,
:root:not([data-theme]) .vocab-repl {
  color: #047857;
}

/* Dark Theme Overrides: Solid dark slate & midnight chips with vivid crisp text (no washed-out pastel) */
:root[data-theme="royal-navy"] .para-rule-pill,
:root[data-theme="emerald-gold"] .para-rule-pill,
:root[data-theme="burgundy-rose"] .para-rule-pill,
:root[data-theme="graphite-copper"] .para-rule-pill,
[data-theme$="navy"] .para-rule-pill,
[data-theme$="emerald"] .para-rule-pill,
:root[data-theme="dark"] .para-rule-pill {
  background: #1E293B;
  color: #F8FAFC;
  border-color: #475569;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.35);
}

:root[data-theme="royal-navy"] .vocab-diff-chip,
:root[data-theme="emerald-gold"] .vocab-diff-chip,
:root[data-theme="burgundy-rose"] .vocab-diff-chip,
:root[data-theme="graphite-copper"] .vocab-diff-chip,
[data-theme$="navy"] .vocab-diff-chip,
[data-theme$="emerald"] .vocab-diff-chip,
:root[data-theme="dark"] .vocab-diff-chip {
  background: #0B132B;
  border-color: #334155;
  color: #F8FAFC;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.35);
}

:root[data-theme="royal-navy"] .vocab-orig,
:root[data-theme="emerald-gold"] .vocab-orig,
:root[data-theme="burgundy-rose"] .vocab-orig,
:root[data-theme="graphite-copper"] .vocab-orig,
[data-theme$="navy"] .vocab-orig,
[data-theme$="emerald"] .vocab-orig,
:root[data-theme="dark"] .vocab-orig {
  color: #94A3B8;
  text-decoration-color: #F87171;
  text-decoration-thickness: 1.5px;
}

:root[data-theme="royal-navy"] .vocab-arrow,
:root[data-theme="emerald-gold"] .vocab-arrow,
:root[data-theme="burgundy-rose"] .vocab-arrow,
:root[data-theme="graphite-copper"] .vocab-arrow,
[data-theme$="navy"] .vocab-arrow,
[data-theme$="emerald"] .vocab-arrow,
:root[data-theme="dark"] .vocab-arrow {
  color: #38BDF8;
}

:root[data-theme="royal-navy"] .vocab-repl,
:root[data-theme="emerald-gold"] .vocab-repl,
:root[data-theme="burgundy-rose"] .vocab-repl,
:root[data-theme="graphite-copper"] .vocab-repl,
[data-theme$="navy"] .vocab-repl,
[data-theme$="emerald"] .vocab-repl,
:root[data-theme="dark"] .vocab-repl {
  color: #34D399;
}

/* Hide the bottom button row ("1.hide this key") */
.paraphrase-card-actions {
  display: none !important;
}

/* Copy button at top of card */
.btn-paraphrase-copy {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--hairline);
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.16s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn-paraphrase-copy:hover {
  background: color-mix(in srgb, var(--metal) 20%, transparent);
  color: var(--head);
  border-color: var(--metal);
}

.btn-paraphrase-copy .ic {
  width: 15px;
  height: 15px;
}

/* Paraphrase Card Action Buttons */
.paraphrase-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid color-mix(in srgb, var(--hairline) 70%, transparent);
}

.btn-para-act {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  min-height: 28px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid var(--hairline);
  background: color-mix(in srgb, var(--surface) 60%, transparent);
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn-para-act:hover {
  background: color-mix(in srgb, var(--metal) 18%, transparent);
  color: var(--head);
  border-color: var(--metal);
}

.btn-para-act .ic {
  width: 13px;
  height: 13px;
}

.btn-para-explain {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid rgba(96, 165, 250, 0.35);
  background: rgba(30, 58, 138, 0.3);
  color: #93C5FD;
  cursor: pointer;
  transition: all 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn-para-explain:hover {
  background: rgba(30, 58, 138, 0.55);
  border-color: #60A5FA;
  color: #BFDBFE;
}

.btn-para-explain .ic {
  width: 13px;
  height: 13px;
  color: #93C5FD;
}

/* Collapsible explanation box */
.para-explanation-box {
  padding: 10px 14px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(59, 130, 246, 0.35);
  font-size: 0.8125rem;
  color: #E2E8F0;
  line-height: 1.5;
  margin-top: 6px;
}

.para-explanation-box p {
  margin: 0;
}

.paraphrase-rule-citation {
  font-size: 0.75rem;
  color: var(--text-2);
  margin: 0;
  font-style: italic;
}

/* Mobile responsive optimizations for phone screens */
@media (max-width: 640px) {
  .paraphrase-card {
    padding: 12px 13px;
    gap: 8px;
    border-radius: 12px;
  }
  .paraphrase-sentence {
    font-size: 1.125rem;
    line-height: 1.58;
  }
  .paraphrase-structure-name {
    font-size: 0.75rem;
    max-width: 140px;
  }
  .btn-accept-paraphrase {
    padding: 5px 10px;
    font-size: 0.75rem;
  }
  .paraphrase-card-actions {
    gap: 4px;
    padding-top: 6px;
  }
  .btn-para-act {
    padding: 3px 8px;
    font-size: 0.6875rem;
  }
}

@media (max-width: 480px) {
  .btn-lvl-pill .lvl-name {
    display: none;
  }
  .btn-lvl-pill {
    padding: 6px 4px;
    font-size: 0.875rem;
  }
}
/* 2026-11-01 Claude Code — IPA generated by eSpeak NG (not from a dictionary source) */
.word-meta .ipa-est { font-size: .72em; opacity: .7; margin-left: .25em; border: 1px dashed currentColor; border-radius: 4px; padding: 0 .3em; vertical-align: .1em; }
/* 2026-11-01 Claude Code — paraphrase card header on phones: the action buttons (318px) were wider than the row and squeezed the
   level badge to 0px, so the buttons covered it. Let the row wrap: badge first, buttons on their own line. */
.paraphrase-top { flex-wrap: wrap; row-gap: 8px; }
.paraphrase-badge-group { flex: 1 1 auto; }
.paraphrase-actions { flex-wrap: wrap; flex-shrink: 1; margin-left: auto; }

/* Claude Code 2026-11-01: AI teacher open / close key (rounded square with a chevron, like the meaning toggle) */
.wr-ai-card .results-head-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; align-self: stretch; }
.wr-ai-card .results-head { align-items: flex-start; }
.wr-ai-toggle { flex: none; margin-left: auto; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0;
  border-radius: 12px; border: 1px solid color-mix(in srgb, var(--metal, #6b7fb3) 55%, transparent);
  background: color-mix(in srgb, var(--surface, #fff) 70%, transparent); color: var(--text-2); cursor: pointer; }
.wr-ai-toggle .ic { width: 16px; height: 16px; transition: transform .2s; }
.wr-ai-toggle[aria-expanded="true"] .ic { transform: rotate(180deg); }
.wr-ai-toggle:hover, .wr-ai-toggle:focus-visible { border-color: var(--metal, #6b7fb3); background: color-mix(in srgb, var(--metal, #6b7fb3) 10%, var(--surface, #fff)); }
.wr-ai-toggle:focus-visible { outline: 2px solid var(--focus, var(--metal)); outline-offset: 1px; }
#aiBody { margin-top: 10px; }
.wr-ai-ask { margin: 0 0 8px; }
.wr-ai-ask[hidden] { display: none; }
/* 2026-11-01 owner: "Ask AI teacher as Expands button" — closed: label + chevron pill; open: the round chevron key only */
.wr-ai-toggle { width: auto; min-width: 44px; padding: 0 12px; gap: 6px; font: 600 .875rem/1 var(--sans); color: var(--head); }
.wr-ai-toggle-t { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.wr-ai-toggle[aria-expanded="true"] { width: 44px; padding: 0; }
.wr-ai-toggle[aria-expanded="true"] .wr-ai-toggle-t { display: none; }

/* 2026-11-01 owner: summary line + Paraphrase Options / Word Fixes tabs hidden; title styled */
#writingResultsCard #resultsSummary[hidden], #writingResultsCard #wrViewTabs[hidden] { display: none !important; }
.wr-para-title { display: flex; align-items: center; gap: 12px; position: relative; padding-bottom: 12px; margin-bottom: 4px;
  font: 700 1.3125rem/1.2 var(--serif); letter-spacing: .005em; color: var(--head); }
.wr-para-title::after { content: ""; position: absolute; left: 56px; bottom: 0; width: min(150px, 45%); height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, #A67C2E, #FFE5A3 55%, transparent); }
.wr-para-medal { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid #A67C2E; background: linear-gradient(135deg, #B88636 0%, #FFE5A3 50%, #C59645 100%);
  box-shadow: 0 2px 10px rgba(166, 124, 46, .3), inset 0 1px 0 rgba(255, 255, 255, .55); }
.wr-para-medal .ic { width: 20px; height: 20px; color: #2A1E08; }
.wr-para-words { min-width: 0; }
.wr-para-amp { font-style: italic; font-weight: 600; color: #A67C2E; padding: 0 .08em; }
@media (prefers-reduced-motion: no-preference) {
  .wr-para-medal { background-size: 200% 200%; animation: wrMedal 6s ease-in-out infinite; }
  @keyframes wrMedal { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
}
/* 2026-11-01 owner "one line save space": title on one line at every width */
#writingResultsCard .h-card.wr-para-title { gap: 9px; padding-bottom: 8px; font-size: min(1.25rem, calc(6.3vw - 6px)); white-space: nowrap; }   /* fills the line: text ≈ 14 em, room ≈ 100vw − 86px */
.wr-para-words { overflow: hidden; text-overflow: ellipsis; }
.wr-para-medal { width: 32px; height: 32px; }
.wr-para-medal .ic { width: 16px; height: 16px; }
.wr-para-title::after { left: 41px; }
/* 2026-11-01 owner: level box (A1 Beginner) hidden — the learner picks Learner / C1 / C2 */
.writing-metrics .metric-badge[hidden] { display: none !important; }
.writing-metrics:has(.metric-badge[hidden]) { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.writing-metrics:has(.metric-badge[hidden]) .m-lbl { font-size: clamp(.5rem, 2.4vw, .75rem); white-space: nowrap; }

/* 2026-11-01 (owner brief "2,000-sentence testing", Phase 9): grammar status + Learner / C1 / C2 in one block */
.wr-gstatus { margin: 4px 0 6px; }
.wr-gs-line { margin: 0; font-size: .875rem; line-height: 1.4; }
.wr-gs-ok { color: var(--success, #15803d); }
.wr-gs-fix { color: var(--ink, inherit); }
.wr-gs-list { margin: 4px 0 0; padding-left: 18px; font-size: .8125rem; line-height: 1.45; }
.wr-gs-list li { margin: 2px 0; overflow-wrap: anywhere; }
.wr-gs-chg s { opacity: .7; }
.wr-gs-why { color: var(--ink-2, #5b6472); }
.wr-levels3 { display: grid; gap: 6px; margin: 4px 0 10px; }
.wr-l3-row { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "lv copy" "text copy" "how how"; gap: 2px 8px; align-items: start;
  padding: 8px 10px; border: 1px solid var(--line, rgba(0,0,0,.12)); border-radius: 12px; background: var(--card, transparent); min-width: 0; }
.wr-l3-lv { grid-area: lv; font-size: .75rem; font-weight: 700; letter-spacing: .02em; color: var(--ink-2, #5b6472); }
.wr-l3-text { grid-area: text; font-size: .9375rem; line-height: 1.45; overflow-wrap: anywhere; min-width: 0; }
.wr-l3-how { grid-area: how; font-size: .75rem; color: var(--ink-2, #5b6472); }
.wr-l3-none { grid-column: 1 / -1; font-size: .8125rem; color: var(--ink-2, #5b6472); }
.wr-l3-copy { grid-area: copy; align-self: center; width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line, rgba(0,0,0,.15));
  background: transparent; color: inherit; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.wr-l3-copy svg { width: 16px; height: 16px; }
.wr-l3-row[data-lv="Learner"] { border-left: 3px solid #10B981; }
.wr-l3-row[data-lv="C1"] { border-left: 3px solid #3B82F6; }
.wr-l3-row[data-lv="C2"] { border-left: 3px solid #8B5CF6; }

/* Claude Code 2026-11-02 (owner: "text colors should the same color line"): the structure label under each level takes the colour of
   that row's left line — Learner green, C1 blue, C2 purple. A deeper shade of the same hue so the small text stays readable on the
   light level cards (they are light in every theme). */
.wr-l3-row .wr-l3-how { font-weight: 600; }
.wr-l3-row[data-lv="Learner"] .wr-l3-how { color: #047857; }
.wr-l3-row[data-lv="C1"] .wr-l3-how { color: #1D4ED8; }
.wr-l3-row[data-lv="C2"] .wr-l3-how { color: #6D28D9; }

/* Claude Code 2026-11-02 (owner: "hide this, it is double work"): the Learner / C1 / C2 switch and the single paraphrase card under it
   repeated the three level rows above (#wrLevels3, each with its own copy button) — hidden; the code still fills them, so nothing breaks.
   To bring them back, delete this rule. */
#writingResultsCard #paraphraseControlsBar, #writingResultsCard #paraphraseList { display: none !important; }

/* Claude Code 2026-11-02: the grammar status now sits inside the AI teacher card — say where it comes from (offline rules, not AI) */
#aiBody .wr-gstatus { margin: 4px 0 10px; padding-bottom: 8px; border-bottom: 1px solid var(--line, rgba(0,0,0,.12)); }
.wr-gs-src { font-size: .75rem; font-weight: 500; color: var(--ink-2, #5b6472); }

/* Claude Code 2026-11-03: Voice Studio row 2 / row 3 mic buttons (owner: "can type or speak all three row") */
.vt-row-mic.listening { background: #d9534f !important; border-color: #d9534f !important; color: #fff !important; animation: vtRowMicPulse 1.2s ease-in-out infinite; }
@keyframes vtRowMicPulse { 50% { box-shadow: 0 0 0 6px rgba(217, 83, 79, .25); } }
@media (prefers-reduced-motion: reduce) { .vt-row-mic.listening { animation: none; } }
.vt-row-2.is-listening, .vt-row-3.is-listening { border-color: #d9534f !important; }

/* Claude Code 2026-11-05: "Ask Google AI" link in the AI teacher card (opens Google AI Mode in the learner's browser) */
#aiCard .wr-gweb { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; padding: 6px 12px; min-height: 36px;
  border: 1px solid rgba(37, 99, 235, .45); border-radius: 999px; color: #1D4ED8; background: rgba(37, 99, 235, .06);
  font-size: .78rem; font-weight: 600; text-decoration: none; max-width: 100%; }
#aiCard .wr-gweb:hover, #aiCard .wr-gweb:focus-visible { background: rgba(37, 99, 235, .12); }
#aiCard .wr-gweb .icon { width: 14px; height: 14px; }
#aiCard .wr-gweb-note { font-weight: 400; color: #475569; }

/* Claude Code 2026-11-05 (owner: "hide both AI teacher and Grammar … they will go check dictionary"): the AI teacher card and the
   Grammar (word patterns) panel are hidden on the Writing screen; their code stays. Delete these two lines to show them again. */
#aiCard { display: none !important; }
#vstructCard { display: none !important; }

/* Claude Code 2026-11-05: "More from Google AI" under the Learner / C1 / C2 rows (layer 3: learner's own Wi-Fi, no key) */
#writingResultsCard .wr-gweb { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; padding: 6px 14px; min-height: 36px;
  border: 1px solid rgba(37, 99, 235, .4); border-radius: 999px; color: #1D4ED8; background: rgba(37, 99, 235, .05);
  font-size: .78rem; font-weight: 600; text-decoration: none; max-width: 100%; align-self: flex-start; cursor: pointer; font-family: inherit; transition: all .2s ease; }
#writingResultsCard .wr-gweb:hover { background: rgba(37, 99, 235, .12); transform: translateY(-1px); }
#writingResultsCard .wr-gweb:active { transform: translateY(0); }
#writingResultsCard .wr-gweb .icon { width: 14px; height: 14px; }
#writingResultsCard .wr-gweb-note { font-weight: 400; color: #475569; }
#writingResultsCard .wr-gweb.is-busy { border-color: #D97706; color: #92400E; background: rgba(217, 119, 6, .1); }


/* Auto-linking & Verified Web Reference Card */
.dict-auto-link {
  color: inherit;
  text-decoration: underline dotted rgba(96, 165, 250, 0.6);
  transition: all 0.15s ease;
  cursor: pointer;
}
.dict-auto-link:hover {
  color: #3B82F6;
  text-decoration: underline solid #3B82F6;
}

.wr-webref-card {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line, rgba(0,0,0,.12));
  background: var(--card, rgba(255,255,255,0.04));
}
.webref-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.webref-badge {
  font-size: 0.8125rem;
  font-weight: 700;
  color: #60A5FA;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.webref-note {
  font-size: 0.75rem;
  color: var(--ink-2, #94A3B8);
  margin-left: 8px;
}
.webref-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.webref-col-h {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: #E2E8F0;
  margin-bottom: 6px;
}
.webref-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.webref-link-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 8px;
  background: rgba(96, 165, 250, 0.12);
  color: #93C5FD;
  text-decoration: none;
  border: 1px solid rgba(96, 165, 250, 0.25);
  transition: all 0.15s ease;
}
.webref-link-pill:hover {
  background: #2563EB;
  color: #ffffff;
  border-color: #2563EB;
}
.webref-vocab-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.webref-vchip {
  display: inline-block;
  padding: 3px 8px;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: #F8FAFC;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: all 0.15s ease;
}
.webref-vchip:hover {
  background: #F59E0B;
  color: #0F172A;
  border-color: #F59E0B;
}

/* Claude Code 2026-11-06 (owner): 1. Auto AI Paraphrase = gold "luxury" button, no "24/7 Free · $0.00" wording;
   2. Grammar Profile & Web References card hidden; 3. no gold line under "Sentence Paraphrases & Rewriting", note
   "AI-generated · AI can make mistakes" instead; 4. sentence-type labels under the rows hidden (they were sometimes wrong).
   Backup before: work/backups/writing-ai.2026-11-06-before-lux-btn.css */
#writingResultsCard .wr-gweb.wr-lux-btn { display: flex; justify-content: center; align-self: stretch; width: 100%; margin-top: 12px;
  min-height: 46px; padding: 10px 18px; border-radius: 999px; border: 1px solid #A67C2E; color: #2A1E08; font-size: .9rem; font-weight: 700;
  letter-spacing: .02em; background: linear-gradient(135deg, #B88636 0%, #FFE5A3 50%, #C59645 100%);
  box-shadow: 0 4px 14px rgba(166, 124, 46, .35), inset 0 1px 0 rgba(255, 255, 255, .55); }
#writingResultsCard .wr-gweb.wr-lux-btn .icon { width: 16px; height: 16px; color: #2A1E08; }
#writingResultsCard .wr-gweb.wr-lux-btn:hover { background: linear-gradient(135deg, #C59645 0%, #FFF0C2 50%, #CFA253 100%); transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(166, 124, 46, .45), inset 0 1px 0 rgba(255, 255, 255, .6); }
#writingResultsCard .wr-gweb.wr-lux-btn:focus-visible { outline: 2px solid #2A1E08; outline-offset: 2px; }
#writingResultsCard .wr-gweb.wr-lux-btn.is-busy { opacity: .8; cursor: progress; border-color: #A67C2E; color: #2A1E08;
  background: linear-gradient(135deg, #B88636 0%, #FFE5A3 50%, #C59645 100%); }
#wrWebRefCard { display: none !important; }
#writingResultsCard .wr-para-title::after { display: none !important; }
#writingResultsCard .results-head-row { flex-wrap: wrap; }
#writingResultsCard .wr-para-ainote { flex-basis: 100%; margin: 2px 0 0; font-size: .75rem; color: var(--ink-2, #5b6472); font-style: italic; }
#writingResultsCard .wr-l3-how { display: none !important; }
/* Claude Code 2026-11-06: fourth word row (B2 = "First option" when a word has 4 real dictionary sentences) */
.wr-l3-row[data-lv="B2"] { border-left: 3px solid #D4A537; }

/* Claude Code 2026-11-07 (owner iPhone photo: "adjust Your English Writing size so the user name shows on the first page,
   more professional"): on phones the writing page fits one screen — text box sized to the screen height, tighter cards —
   so the user-name plaque is visible above the bottom bar without scrolling. Tablets keep the roomier layout. */
@media (max-width: 599px) {
  #v-writing .writing-textarea { height: clamp(90px, calc(var(--tg-viewport-stable-height, 100dvh) * .14), 200px); min-height: 92px; resize: none; }
  #v-writing .writing-card { padding: 12px; gap: 9px; }
  #v-writing .writing-studio { gap: 8px; }
  #writingResultsCard { padding: 12px 12px 12px !important; }
  #writingResultsCard .results-head { padding-bottom: 0; margin-bottom: 0; }
  #writingResultsCard .wr-levels3:empty { display: none; }
  #writingResultsCard .wr-gweb { margin-top: 8px; }
  body[data-route="writing"] .credit { margin-top: 8px; }
}

/* Claude Code 2026-11-07 (owner photos, tablet + iPhone: "first page appears full screen, professional, for all devices"):
   the Writing page fills the screen on every device — the writing box takes all the free height, so the user-name plaque
   sits just above the bottom bar and there is no empty space below (tablets showed half a screen of empty blue). */
body[data-route="writing"] .app { display: flex; flex-direction: column; min-height: var(--tg-viewport-stable-height, 100dvh); box-sizing: border-box; }
body[data-route="writing"] #main { flex: 1 0 auto; display: flex; flex-direction: column; }
body[data-route="writing"] #v-writing:not([hidden]) { flex: 1 0 auto; display: flex; flex-direction: column; }
body[data-route="writing"] #writingStudio { flex: 1 0 auto; display: flex; flex-direction: column; }
body[data-route="writing"] #writingStudio > .writing-card { flex: 1 0 auto; display: flex; flex-direction: column; }
body[data-route="writing"] #writingStudio > .writing-card .editor-input-wrap { flex: 1 0 auto; display: flex; flex-direction: column; }
body[data-route="writing"] #v-writing .writing-textarea { flex: 1 0 auto; height: auto; min-height: 96px; }

/* ===== 2026-11-10 Writing 10/10 pass (owner: "i did not feel enough 10/10") — Claude Code =====
   One main action: the gold Auto AI Paraphrase button sits under the text box (the blue "Paraphrases" did the same thing and
   is hidden); Copy + Clear are two matching small tools; the text box is warm paper like its card (was cool grey-blue);
   the browser-default grey Copy button is gone. Backups: work/backups/writing-ai.2026-11-10-before-one-action.css,
   WritingScreen.2026-11-10-before-one-action.js */
#v-writing .wr-actions-compact { display: flex; }
#v-writing .wr-actions-compact #btnParaphrases[hidden] { display: none !important; }
#v-writing .wr-actions-compact .wr-gweb.wr-lux-btn { display: flex; flex: 1 1 auto; justify-content: center; align-items: center; gap: 8px;
  width: 100%; margin: 0; min-height: 48px; padding: 10px 18px; border-radius: 999px; border: 1px solid #A67C2E; color: #2A1E08;
  font: 700 .95rem/1.2 var(--sans); letter-spacing: .02em; cursor: pointer;
  background: linear-gradient(135deg, #B88636 0%, #FFE5A3 50%, #C59645 100%);
  box-shadow: 0 4px 14px rgba(166, 124, 46, .35), inset 0 1px 0 rgba(255, 255, 255, .55); transition: transform .15s, box-shadow .15s; }
#v-writing .wr-actions-compact .wr-gweb.wr-lux-btn .icon { width: 17px; height: 17px; color: #2A1E08; }
#v-writing .wr-actions-compact .wr-gweb.wr-lux-btn:hover { background: linear-gradient(135deg, #C59645 0%, #FFF0C2 50%, #CFA253 100%);
  transform: translateY(-1px); box-shadow: 0 6px 18px rgba(166, 124, 46, .45), inset 0 1px 0 rgba(255, 255, 255, .6); }
#v-writing .wr-actions-compact .wr-gweb.wr-lux-btn:active { transform: translateY(1px); }
#v-writing .wr-actions-compact .wr-gweb.wr-lux-btn:focus-visible { outline: 2px solid #2A1E08; outline-offset: 2px; }
#v-writing .wr-actions-compact .wr-gweb.wr-lux-btn.is-busy { opacity: .85; cursor: progress; }

/* header row: label + two matching tools */
#v-writing .editor-header-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
#v-writing .editor-prompt-label { font: 700 .8rem/1.2 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: #7A5A1E; }
#v-writing .editor-tool-actions { display: flex; gap: 6px; }
#v-writing .editor-tool-actions .btn-tool { appearance: none; display: inline-flex; align-items: center; gap: 5px; min-height: 32px;
  padding: 4px 11px; border-radius: 999px; border: 1px solid rgba(166, 124, 46, .45); background: rgba(255, 252, 244, .9);
  color: #3A3326; font: 600 .78rem/1 var(--sans); cursor: pointer; transition: background .15s, border-color .15s, color .15s; }
#v-writing .editor-tool-actions .btn-tool:hover { background: #FFF6DE; border-color: #A67C2E; color: #2A1E08; }
#v-writing .editor-tool-actions #btnClearText:hover { color: #9F1D1D; border-color: rgba(159, 29, 29, .45); background: #FFF1F0; }
#v-writing .editor-tool-actions .btn-tool .ic, #v-writing .editor-tool-actions .btn-tool .icon { width: 14px; height: 14px; }

/* text box = warm writing paper, gold focus */
#v-writing .writing-textarea { background: #FFFDF8 !important; border: 1px solid rgba(166, 124, 46, .32) !important; color: #1F2433 !important;
  box-shadow: inset 0 1px 3px rgba(60, 45, 15, .06); }
#v-writing .writing-textarea::placeholder { color: #8C8475; }
#v-writing .writing-textarea:focus { outline: none; border-color: #B88636 !important;
  box-shadow: 0 0 0 3px rgba(184, 134, 54, .22), inset 0 1px 3px rgba(60, 45, 15, .06) !important; }
/* rows: dictionary links stay (tap a word to look it up) but read as plain text with a faint gold dotted line;
   the emoji level dots (look different on every phone) become drawn dots in the row's own colour */
#v-writing #wrLevels3 .dict-auto-link { color: inherit; text-decoration: none; border-bottom: 1px dotted rgba(166, 124, 46, .38); }
#v-writing #wrLevels3 .dict-auto-link:hover, #v-writing #wrLevels3 .dict-auto-link:focus-visible { color: #7A5A1E; border-bottom-color: #A67C2E; }
#v-writing #wrLevels3 .wr-l3-lv > span[aria-hidden="true"] { font-size: 0; display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  margin-right: 2px; vertical-align: 1px; background: #2E7D5B; box-shadow: 0 0 0 2px rgba(46, 125, 91, .16); }
#v-writing #wrLevels3 .wr-l3-row[data-lv="C1"] .wr-l3-lv > span[aria-hidden="true"] { background: #1D4ED8; box-shadow: 0 0 0 2px rgba(29, 78, 216, .16); }
#v-writing #wrLevels3 .wr-l3-row[data-lv="C2"] .wr-l3-lv > span[aria-hidden="true"] { background: #6D28D9; box-shadow: 0 0 0 2px rgba(109, 40, 217, .16); }
#v-writing #wrLevels3 .wr-l3-row[data-lv="B2"] .wr-l3-lv > span[aria-hidden="true"] { background: #A67C2E; box-shadow: 0 0 0 2px rgba(166, 124, 46, .18); }
#v-writing #wrLevels3 .wr-l3-lv { display: inline-flex; align-items: center; gap: 7px; }
#v-writing #wrLevels3 .wr-l3-lv > span[aria-hidden="true"] { margin: 0; vertical-align: middle; flex: 0 0 8px; }
/* tablets / computers: the main action is a normal-size button at the right under the text box (it stretched ~1,100 px) */
@media (min-width: 700px) {
  #v-writing .wr-actions-compact { justify-content: flex-end; }
  #v-writing .wr-actions-compact .wr-gweb.wr-lux-btn { flex: 0 0 auto; width: auto; min-width: 280px; max-width: 360px; }
}

/* ===== 2026-11-10 Writing UX (owner "do all") — Claude Code ===== backup work/backups/WritingScreen.2026-11-10-before-ux4.js */
/* 1. nothing written → no empty result card; the AI note shows only when an AI sentence is on screen */
#v-writing.wr-empty #writingResultsCard { display: none !important; }
#writingResultsCard:not(:has(#wrLevels3[data-ai="1"])) .wr-para-ainote { display: none !important; }
/* while the AI writes: soft shimmering placeholder rows instead of "Writing the first option…" text */
#v-writing #wrLevels3 .wr-l3-row:has(.wr-l3-none) .wr-l3-none { display: block; height: 2.6em; margin-top: 6px; border-radius: 8px; font-size: 0; color: transparent;
  background: linear-gradient(90deg, rgba(166, 124, 46, .08) 0%, rgba(166, 124, 46, .2) 45%, rgba(166, 124, 46, .08) 90%) 0 0 / 220% 100%;
  animation: wrShimmer 1.3s linear infinite; }
@keyframes wrShimmer { from { background-position: 120% 0; } to { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) { #v-writing #wrLevels3 .wr-l3-none { animation: none; } }

/* 2. the four big numbers → one quiet line under the text box */
#v-writing #writingMetrics { display: none !important; }
#v-writing .wr-meta { margin: 8px 2px 0; min-height: 1.2em; font: 500 .78rem/1.3 var(--sans); color: #6B6152; letter-spacing: .01em; }
#v-writing .wr-meta:empty { display: none; }

/* 3. actions look disabled until there is text */
#v-writing .wr-actions-compact .wr-gweb.wr-lux-btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; filter: saturate(.6); }
#v-writing .editor-tool-actions .btn-tool:disabled { opacity: .4; cursor: not-allowed; background: transparent; }
#v-writing .editor-tool-actions .btn-tool:disabled:hover { color: #3A3326; border-color: rgba(166, 124, 46, .45); background: transparent; }

/* 4. what was wrong, as chips */
#v-writing .wr-fixchips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 10px 0 4px; }
#v-writing .wr-fixchips:empty { display: none; }
#v-writing .wr-fx-head { flex-basis: 100%; font: 700 .7rem/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: #7A5A1E; margin-bottom: 2px; }
#v-writing .wr-fixchip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px;
  background: #FFFDF8; border: 1px solid rgba(166, 124, 46, .35); font: 500 .82rem/1.25 var(--sans); color: #2A2418; }
#v-writing .wr-fixchip s { color: #9F1D1D; text-decoration-thickness: 1.5px; text-decoration-color: rgba(159, 29, 29, .7); }
#v-writing .wr-fixchip b { color: #1E6B4A; font-weight: 700; }
#v-writing .wr-fx-arrow { color: #A67C2E; font-weight: 700; }
#v-writing .wr-fx-add { color: #7A5A1E; font-weight: 600; }
#v-writing .wr-fx-more { color: #6B6152; }
#v-writing .wr-fx-ok { color: #1E6B4A; border-color: rgba(30, 107, 74, .35); background: #F2FBF6; font-weight: 600; }

/* ===== 2026-11-10 Writing: tap-to-explain chips + Use / Undo (owner "yes do all") — Claude Code ===== */
#v-writing button.wr-fixchip { appearance: none; cursor: pointer; transition: background .15s, border-color .15s, box-shadow .15s; }
#v-writing button.wr-fixchip:hover { border-color: #A67C2E; background: #FFF6DE; }
#v-writing button.wr-fixchip[aria-expanded="true"] { border-color: #A67C2E; background: #FFF3D1; box-shadow: 0 0 0 2px rgba(184, 134, 54, .22); }
#v-writing button.wr-fixchip:focus-visible { outline: 2px solid #7A5A1E; outline-offset: 2px; }
#v-writing .wr-fx-why { flex-basis: 100%; margin: 4px 0 2px; padding: 9px 12px; border-radius: 10px; background: #FFFDF8;
  border: 1px solid rgba(166, 124, 46, .3); border-left: 3px solid #A67C2E; font: 400 .84rem/1.4 var(--sans); color: #2A2418; }
#v-writing .wr-fx-why b { display: block; margin-bottom: 2px; color: #1E6B4A; font-weight: 700; }
#v-writing .wr-fx-why em { display: block; margin-top: 4px; font-style: italic; color: #5E5546; }
/* Use / Undo on the User sentence: a small green pill under the text, at the right */
#v-writing #wrLevels3 .wr-l3-row[data-lv="Learner"] { grid-template-areas: "lv copy" "text copy" "use use" "how how"; }
#v-writing #wrLevels3 .wr-l3-use { grid-area: use; justify-self: end; display: inline-flex; align-items: center; gap: 5px; margin-top: 6px;
  min-height: 32px; padding: 4px 13px; border-radius: 999px; border: 1px solid rgba(30, 107, 74, .45); background: #F2FBF6;
  color: #1E6B4A; font: 700 .8rem/1 var(--sans); cursor: pointer; transition: background .15s, border-color .15s; }
#v-writing #wrLevels3 .wr-l3-use:hover { background: #E3F6EC; border-color: #1E6B4A; }
#v-writing #wrLevels3 .wr-l3-use .icon, #v-writing #wrLevels3 .wr-l3-use svg { width: 14px; height: 14px; }
#v-writing #wrLevels3 .wr-l3-undo { color: #5E5546; border-color: rgba(94, 85, 70, .4); background: #FFFDF8; }

/* ===== 2026-11-10 Writing: count line + Previous / Next on one row (owner: "add 2 button previous and next") ===== */
#v-writing .wr-under { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; min-height: 0; }
#v-writing .wr-under .wr-meta { margin: 0; flex: 1 1 auto; min-width: 0; }
#v-writing .wr-hist { display: inline-flex; align-items: center; gap: 4px; flex: 0 0 auto; margin-left: auto; }
#v-writing .wr-hist[hidden] { display: none; }
#v-writing .wr-hist-btn { appearance: none; width: 34px; height: 34px; border-radius: 50%; border: 1px solid rgba(166, 124, 46, .45);
  background: rgba(255, 252, 244, .95); color: #5C4416; font: 700 1.15rem/1 var(--serif, Georgia, serif); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; padding: 0 0 2px; transition: background .15s, border-color .15s; }
#v-writing .wr-hist-btn:hover:not(:disabled) { background: #FFF3D1; border-color: #A67C2E; }
#v-writing .wr-hist-btn:disabled { opacity: .35; cursor: default; }
#v-writing .wr-hist-btn:focus-visible { outline: 2px solid #7A5A1E; outline-offset: 2px; }
#v-writing .wr-hist-pos { min-width: 3.4em; text-align: center; font: 600 .74rem/1 var(--sans); color: #6B6152; white-space: nowrap; }
@media (max-width: 599px) { #v-writing .wr-meta .wm-s { display: none; } #v-writing .wr-meta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } }
/* 2026-11-10 essay mode: AI corrections in the chips carry a small "AI" tag */
#v-writing .wr-fx-aitag { display: inline-block; padding: 1px 5px; margin-right: 2px; border-radius: 4px; background: #2A1E08; color: #FFE5A3;
  font: 700 .62rem/1.3 var(--sans); letter-spacing: .06em; }

/* ===== 2026-11-10 Sentence / IELTS Task 1 / Task 2 selector + checklist (owner) — Claude Code ===== */
#v-writing .wr-l3-text { white-space: pre-line; }   /* a corrected essay keeps its paragraphs */
#v-writing .wr-mode { display: grid; grid-template-columns: .8fr 1fr 1fr; gap: 4px; padding: 4px; margin: 0 0 12px; border-radius: 14px;
  background: rgba(166, 124, 46, .1); border: 1px solid rgba(166, 124, 46, .25); }
#v-writing .wr-mode-btn { appearance: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  min-height: 44px; padding: 5px 4px; border: 0; border-radius: 10px; background: transparent; color: #5E5546; cursor: pointer;
  font: 700 .8rem/1.15 var(--sans); text-align: center; transition: background .15s, color .15s, box-shadow .15s; }
#v-writing .wr-mode-btn small { font: 500 .66rem/1.1 var(--sans); color: inherit; opacity: .8; }
#v-writing .wr-mode-btn[aria-checked="true"] { background: linear-gradient(135deg, #B88636 0%, #FFE5A3 50%, #C59645 100%); color: #2A1E08;
  box-shadow: 0 2px 8px rgba(166, 124, 46, .3), inset 0 1px 0 rgba(255, 255, 255, .5); }
#v-writing .wr-mode-btn:focus-visible { outline: 2px solid #7A5A1E; outline-offset: 2px; }
#v-writing .wr-meta b.wm-low { color: #B42318; } #v-writing .wr-meta b.wm-ok { color: #1E6B4A; } #v-writing .wr-meta b.wm-high { color: #A15C07; }
#v-writing.wr-task .wr-meta .wm-s { display: inline; }
#v-writing .wr-taskcheck:empty { display: none; }
#v-writing .wr-taskcheck { margin: 10px 0 6px; padding: 10px 12px; border-radius: 12px; background: #FFFDF8; border: 1px solid rgba(166, 124, 46, .3); }
#v-writing .wr-tc-head { margin: 0 0 6px; font: 700 .72rem/1.2 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: #7A5A1E; }
#v-writing .wr-tc-head span { text-transform: none; letter-spacing: 0; font-weight: 500; color: #8C8475; }
#v-writing .wr-taskcheck ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
#v-writing .wr-taskcheck li { display: grid; grid-template-columns: 22px 1fr; gap: 8px; align-items: start; font: 400 .84rem/1.35 var(--sans); color: #2A2418; }
#v-writing .wr-taskcheck li b { font-weight: 600; }
#v-writing .wr-taskcheck li small { display: block; margin-top: 1px; font-size: .78rem; color: #5E5546; }
#v-writing .wr-tc-ic { width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font: 700 .72rem/1 var(--sans); }
#v-writing .wr-taskcheck li.ok .wr-tc-ic { background: #E3F6EC; color: #1E6B4A; }
#v-writing .wr-taskcheck li.no .wr-tc-ic { background: #FDECEA; color: #B42318; }
#v-writing .wr-taskcheck li.warn .wr-tc-ic { background: #FEF3E2; color: #A15C07; }
/* 2026-11-10 Word-style essay view (owner: justify ≡ + indent for essays) */
#v-writing.wr-task .writing-textarea { text-align: justify; hyphens: auto; }
#v-writing .wr-l3-text p { margin: 0 0 .55em; text-align: justify; text-indent: 1.6em; hyphens: auto; white-space: normal; }
#v-writing .wr-l3-text p:last-child { margin-bottom: 0; }
#v-writing .wr-tc-head span { color: #6B6152; }
#v-writing.wr-task .wr-meta { white-space: normal; overflow: visible; text-overflow: clip; }


/* ===== 2026-11-12 MULTI-ENGINE AUTOCORRECT HUB (LanguageTool + Grammarly + TextGears + Sapling AI) ===== */
.wr-autocorrect-engines {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 10px;
  margin: 0 0 12px;
  border-radius: 12px;
  background: rgba(166, 124, 46, .08);
  border: 1px solid rgba(166, 124, 46, .2);
}

.wr-eng-chip {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid rgba(166, 124, 46, .3);
  background: rgba(255, 253, 248, .9);
  color: #5E5546;
  font: 600 .78rem/1.2 var(--sans, system-ui, sans-serif);
  cursor: pointer;
  transition: all .18s ease;
  white-space: nowrap;
}

.wr-eng-chip:hover {
  background: #FFF8E7;
  border-color: #B88636;
  color: #2A1E08;
  transform: translateY(-1px);
}

.wr-eng-chip.active {
  background: linear-gradient(135deg, #B88636 0%, #FFE5A3 50%, #C59645 100%);
  color: #1A1204;
  border-color: #A67C2E;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(166, 124, 46, .35), inset 0 1px 0 rgba(255, 255, 255, .6);
}

.wr-eng-icon {
  font-size: .88rem;
  line-height: 1;
}

.wr-picky-toggle {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px dashed rgba(166, 124, 46, .45);
  background: transparent;
  color: #6B6152;
  font: 600 .74rem/1.2 var(--sans, system-ui, sans-serif);
  cursor: pointer;
  transition: all .18s ease;
}

.wr-picky-toggle:hover {
  border-color: #B88636;
  color: #2A1E08;
}

.wr-picky-toggle.active {
  border-style: solid;
  border-color: #1E6B4A;
  background: #EAF7F0;
  color: #145337;
  font-weight: 700;
}

.wr-picky-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #999;
}

.wr-picky-toggle.active .wr-picky-dot {
  background: #1E6B4A;
  box-shadow: 0 0 5px #1E6B4A;
}

/* Autocorrect Results Card */
.wr-autocorrect-card {
  margin: 14px 0;
  padding: 14px 16px;
  border-radius: 14px;
  background: #FFFDF9;
  border: 1px solid rgba(166, 124, 46, .35);
  box-shadow: 0 4px 16px rgba(42, 30, 8, .05);
}

.wr-ac-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(166, 124, 46, .18);
  margin-bottom: 10px;
}

.wr-ac-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.wr-ac-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  background: #2A1E08;
  color: #FFE5A3;
  font: 700 .74rem/1.2 var(--sans, system-ui, sans-serif);
  letter-spacing: .02em;
}

.wr-ac-status-text {
  font: 500 .82rem/1.3 var(--sans, system-ui, sans-serif);
  color: #5E5546;
}

.wr-ac-status-text b {
  color: #2A1E08;
}

.wr-ac-actions {
  display: flex;
  gap: 6px;
}

.wr-ac-btn-small {
  padding: 4px 10px;
  font-size: .75rem;
  border-radius: 6px;
}

/* Category Filter Pills */
.wr-ac-categories {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 12px;
}

.wr-cat-pill {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid rgba(166, 124, 46, .2);
  background: rgba(166, 124, 46, .05);
  color: #6B6152;
  font: 600 .72rem/1.2 var(--sans, system-ui, sans-serif);
  cursor: pointer;
  transition: all .15s ease;
}

.wr-cat-pill b {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .08);
  font-size: .68rem;
}

.wr-cat-pill:hover {
  background: rgba(166, 124, 46, .12);
  color: #2A1E08;
}

.wr-cat-pill.active {
  background: #2A1E08;
  color: #FFE5A3;
  border-color: #2A1E08;
}

.wr-cat-pill.active b {
  background: rgba(255, 255, 255, .2);
  color: #FFF;
}

/* Issue Cards List */
.wr-ac-cards-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wr-issue-card {
  padding: 12px 14px;
  border-radius: 10px;
  background: #FFF;
  border: 1px solid rgba(166, 124, 46, .25);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .03);
  transition: all .18s ease;
}

.wr-issue-card:hover {
  border-color: #B88636;
  box-shadow: 0 3px 10px rgba(166, 124, 46, .12);
}

.wr-issue-card.is-applied {
  background: #F4FBF7;
  border-color: #79C29D;
  opacity: .88;
}

.wr-issue-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.wr-issue-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.wr-tag-engine {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font: 700 .68rem/1.2 var(--sans, system-ui, sans-serif);
  background: #F0F4FA;
  color: #1A365D;
  border: 1px solid #D1DCED;
}

.wr-tag-category {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font: 700 .66rem/1.2 var(--sans, system-ui, sans-serif);
  letter-spacing: .04em;
}

.wr-tag-cat-grammar { background: #FEF3E2; color: #9A5B08; border: 1px solid #FCD9A2; }
.wr-tag-cat-spelling { background: #FDE8E8; color: #9B1C1C; border: 1px solid #F8B4B4; }
.wr-tag-cat-punctuation { background: #E1EFFE; color: #1E429F; border: 1px solid #B4C6FC; }
.wr-tag-cat-clarity { background: #EDF8F7; color: #0E7490; border: 1px solid #A5F3FC; }
.wr-tag-cat-style { background: #F3E8FF; color: #6B21A8; border: 1px solid #DDD6FE; }

.wr-tag-applied {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  background: #1E6B4A;
  color: #FFF;
  font: 700 .66rem/1.2 var(--sans, system-ui, sans-serif);
  letter-spacing: .04em;
}

.btn-dismiss-issue {
  appearance: none;
  background: transparent;
  border: 0;
  color: #9C9588;
  font-size: .85rem;
  font-weight: 700;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all .15s ease;
}

.btn-dismiss-issue:hover {
  background: rgba(166, 124, 46, .1);
  color: #2A1E08;
}

.wr-issue-body {
  margin-bottom: 10px;
}

.wr-issue-snippet {
  font: 400 .88rem/1.45 var(--sans, system-ui, sans-serif);
  color: #3A3226;
  margin-bottom: 4px;
}

.wr-err-highlight {
  background: #FEE2E2;
  color: #991B1B;
  padding: 1px 4px;
  border-radius: 3px;
  font-weight: 600;
  text-decoration: underline wavy #DC2626;
}

.wr-err-highlight.was-fixed {
  background: #DCFCE7;
  color: #166534;
  text-decoration: line-through;
}

.wr-issue-expl {
  font: 400 .8rem/1.38 var(--sans, system-ui, sans-serif);
  color: #6B6152;
  margin: 0;
}

.wr-issue-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 8px;
  border-top: 1px dashed rgba(166, 124, 46, .18);
}

.wr-issue-suggest-label {
  font: 600 .74rem/1.2 var(--sans, system-ui, sans-serif);
  color: #8C8475;
}

.wr-issue-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.wr-repl-pill {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  border-radius: 6px;
  border: 1px solid #1E6B4A;
  background: #EAF7F0;
  color: #145337;
  cursor: pointer;
  transition: all .15s ease;
}

.wr-repl-pill:hover {
  background: #1E6B4A;
  color: #FFF;
  box-shadow: 0 2px 6px rgba(30, 107, 74, .3);
  transform: translateY(-1px);
}

.wr-repl-arrow {
  font-size: .78rem;
  color: inherit;
  opacity: .8;
}

.wr-repl-text {
  font: 700 .82rem/1.2 var(--sans, system-ui, sans-serif);
  color: inherit;
}

.wr-applied-pill {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 6px;
  background: #DEF7EC;
  color: #03543F;
  font: 700 .78rem/1.2 var(--sans, system-ui, sans-serif);
  border: 1px solid #31C48D;
}

.wr-ac-success-banner {
  text-align: center;
  padding: 24px 12px;
}

.wr-ac-success-medal {
  font-size: 2.2rem;
  display: block;
  margin-bottom: 6px;
}

.wr-ac-success-banner h4 {
  margin: 0 0 4px;
  font: 700 1rem/1.3 var(--sans, system-ui, sans-serif);
  color: #1E6B4A;
}

.wr-ac-success-banner p {
  margin: 0;
  font: 400 .84rem/1.4 var(--sans, system-ui, sans-serif);
  color: #6B6152;
}

.wr-fixall-btn {
  background: linear-gradient(135deg, #1E6B4A 0%, #2F9E68 100%) !important;
  color: #FFF !important;
  border: 1px solid #145337 !important;
  font-weight: 700 !important;
}

.wr-fixall-btn:hover {
  background: linear-gradient(135deg, #145337 0%, #1E6B4A 100%) !important;
  box-shadow: 0 2px 8px rgba(30, 107, 74, .4) !important;
}


/* ===== 2026-11-12 ALL-IN-ONE AUTO CHECK PIPELINE (1 ➔ 2 ➔ 3) ===== */
.wr-all-in-one-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 12px;
  margin: 0 0 12px;
  border-radius: 12px;
  background: rgba(166, 124, 46, .08);
  border: 1px solid rgba(166, 124, 46, .24);
}

.wr-aio-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.wr-aio-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, #B88636 0%, #FFE5A3 50%, #C59645 100%);
  color: #1A1204;
  font: 700 .8rem/1.2 var(--sans, system-ui, sans-serif);
  box-shadow: 0 2px 6px rgba(166, 124, 46, .35), inset 0 1px 0 rgba(255, 255, 255, .6);
  white-space: nowrap;
}

.wr-aio-pipeline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.wr-pipe-step {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 6px;
  background: rgba(255, 253, 248, .9);
  border: 1px solid rgba(166, 124, 46, .25);
  color: #5E5546;
  font: 600 .74rem/1.2 var(--sans, system-ui, sans-serif);
  transition: all .2s ease;
}

.wr-step-num {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #2A1E08;
  color: #FFE5A3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .65rem;
  font-weight: 700;
}

.wr-pipe-arrow {
  font-size: .75rem;
  color: #A67C2E;
  opacity: .7;
}

.wr-pipe-step.is-running {
  background: #FEF3E2;
  border-color: #B88636;
  color: #9A5B08;
  box-shadow: 0 0 8px rgba(184, 134, 54, .3);
  animation: wrPipePulse 1.2s infinite ease-in-out;
}

.wr-pipe-step.is-done {
  background: #EAF7F0;
  border-color: #1E6B4A;
  color: #145337;
}

.wr-pipe-step.is-done .wr-step-num {
  background: #1E6B4A;
  color: #FFF;
}

@keyframes wrPipePulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.03); opacity: .85; }
}

/* Step Tags on Issue Cards */
.wr-tag-step {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font: 700 .68rem/1.2 var(--sans, system-ui, sans-serif);
}

.wr-tag-step1 { background: #FEF3E2; color: #9A5B08; border: 1px solid #FCD9A2; }
.wr-tag-step2 { background: #E1EFFE; color: #1E429F; border: 1px solid #B4C6FC; }
.wr-tag-step3 { background: #F3E8FF; color: #6B21A8; border: 1px solid #DDD6FE; }

.wr-cat-step1.active { background: #9A5B08 !important; color: #FFF !important; border-color: #9A5B08 !important; }
.wr-cat-step2.active { background: #1E429F !important; color: #FFF !important; border-color: #1E429F !important; }
.wr-cat-step3.active { background: #6B21A8 !important; color: #FFF !important; border-color: #6B21A8 !important; }

/* Claude Code 2026-11-12: Auto AI Check + Paraphrase share the row on wide screens; on phones each gets its own line
   (the Paraphrase button was squeezed to 21 px and its label ran off the screen) */
.writing-actions-row.wr-actions-compact { flex-wrap: wrap; gap: 8px; }
.writing-actions-row.wr-actions-compact > #btnDoParaphrase { flex: 1 1 auto; min-width: 0; white-space: nowrap; justify-content: center; }
@media (max-width: 599px) {
  .writing-actions-row.wr-actions-compact > #wrGoogle,
  .writing-actions-row.wr-actions-compact > #btnDoParaphrase { flex: 1 1 100%; width: 100%; }
}

/* Claude Code 2026-11-12 (owner: "which one can hide please hide it to get more luxury … not affect our data or user"):
   the All-in-One explanation box (badge + 3 step chips + Picky Mode) is hidden — labels only; Picky Mode was never saved
   and starts off, so checks work exactly as before. The step code still runs on the hidden chips. Delete to restore. */
#v-writing #wrAllInOneBar { display: none !important; }
/* Paraphrase (Learner / C1 / C2) stays — calm second button in ivory + gold instead of bright blue */
#v-writing #btnDoParaphrase.wr-para-trigger-btn {
  background: #FFFDF8 !important; color: #6E4E14 !important; border: 0 !important;
  box-shadow: inset 0 0 0 1.5px #C9AE76, 0 2px 8px rgba(60, 44, 10, .10) !important;
  font-weight: 700; letter-spacing: .01em;
}
#v-writing #btnDoParaphrase.wr-para-trigger-btn:hover { background: #FBF4E4 !important; }
#v-writing #btnDoParaphrase.wr-para-trigger-btn:disabled { opacity: .55; }
