/* Grammar Checker v2 — workspace styles
   Depends on aiwa-core.css (tokens, header) and aiwa-tools.css (tools rail). */

.grammar-page { background: #fff; }
.grammar-page main { flex: 0 0 auto; display: flex; flex-direction: column; height: calc(100dvh - 64px); min-height: 480px; background: #fff; overflow: hidden; }
.grammar-page .sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }

/* ---------- Command bar ---------- */
.gc-command-bar { flex: 0 0 auto; z-index: 80; border-bottom: 1px solid var(--aiwa-line); background: #fff; }
.gc-command-inner { min-height: 64px; display: flex; align-items: center; gap: 14px; padding: 10px 18px; }
.gc-title { min-width: 0; display: flex; align-items: center; gap: 12px; }
.gc-title h1 { margin: 0; font-size: 18px; font-weight: 760; letter-spacing: -0.025em; white-space: nowrap; }
.gc-doc { min-width: 0; display: flex; align-items: center; gap: 10px; }
.gc-doc-title { min-width: 0; max-width: 46vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 17px; font-weight: 740; letter-spacing: -0.02em; color: var(--aiwa-text); }
.gc-doc-title.is-placeholder { color: var(--aiwa-muted); font-weight: 600; }
.gc-foot-sep { width: 1px; height: 20px; background: var(--aiwa-line); margin: 0 4px; }
.gc-status { display: inline-flex; align-items: center; gap: 7px; min-height: 26px; padding: 3px 10px 3px 8px; border-radius: 999px; background: var(--aiwa-bg); color: var(--aiwa-muted); font-size: 12px; font-weight: 650; white-space: nowrap; }
.gc-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #a7afa9; flex: 0 0 8px; }
.gc-status[data-state="checking"]::before { background: var(--aiwa-brand); animation: gc-pulse 1.1s ease-in-out infinite; }
.gc-status[data-state="clean"] { background: var(--aiwa-brand-soft); color: var(--aiwa-brand-dark); }
.gc-status[data-state="clean"]::before { background: var(--aiwa-brand); }
.gc-status[data-state="issues"] { background: #fff4e5; color: #7a3e0b; }
.gc-status[data-state="issues"]::before { background: #e08a1e; }
.gc-status[data-state="error"] { background: #fdecea; color: #9b1f14; }
.gc-status[data-state="error"]::before { background: var(--aiwa-danger); }
@keyframes gc-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.45; transform: scale(0.8); } }

.gc-controls { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.gc-wordpill { min-height: 40px; display: inline-flex; align-items: center; gap: 4px; padding: 0 12px; border-radius: 10px; background: var(--aiwa-bg); color: var(--aiwa-muted); font-size: 13px; font-weight: 650; white-space: nowrap; }
.gc-wordpill b { color: var(--aiwa-ink); font-weight: 760; }
.gc-select { min-height: 40px; display: inline-flex; align-items: center; gap: 6px; padding: 0 6px 0 10px; border: 1px solid var(--aiwa-line); border-radius: 10px; background: #fff; }
.gc-select .aiwa-ui-icon { width: 17px; height: 17px; opacity: 0.8; }
.gc-select select { min-width: 0; width: 150px; min-height: 36px; border: 0; background: transparent; color: var(--aiwa-ink); font-size: 13px; font-weight: 650; outline: 0; cursor: pointer; text-overflow: ellipsis; }
.gc-select:focus-within { border-color: var(--aiwa-brand); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.22); }
.gc-toggle { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 10px; border: 1px solid var(--aiwa-line); border-radius: 10px; background: #fff; color: var(--aiwa-text); font-size: 12px; font-weight: 650; cursor: pointer; white-space: nowrap; }
.gc-toggle input { width: 15px; height: 15px; margin: 0; accent-color: var(--aiwa-brand); }
.gc-toggle:hover { background: var(--aiwa-bg); }

.gc-btn { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 14px; border: 1px solid var(--aiwa-line); border-radius: 10px; background: #fff; color: var(--aiwa-ink); font-size: 13px; font-weight: 700; text-decoration: none; cursor: pointer; transition: background-color 140ms var(--aiwa-ease), border-color 140ms var(--aiwa-ease); }
.gc-btn:hover { background: var(--aiwa-bg); }
.gc-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.gc-btn.primary { border-color: var(--aiwa-brand); background: var(--aiwa-brand); color: #fff; }
.gc-btn.primary:hover:not(:disabled) { border-color: var(--aiwa-brand-dark); background: var(--aiwa-brand-dark); }
.gc-btn.primary .aiwa-ui-icon { filter: brightness(0) invert(1); }
.gc-btn.ghost { border-color: transparent; background: transparent; color: var(--aiwa-text); }
.gc-btn.ghost:hover { background: var(--aiwa-bg); }
.gc-btn.small { min-height: 32px; padding: 4px 10px; font-size: 12px; }
.gc-btn.icon-only { width: 36px; padding: 0; }
.gc-btn .aiwa-ui-icon { width: 16px; height: 16px; }
.gc-btn:focus-visible, .gc-toggle:focus-visible, .gc-filter:focus-visible, .gc-card:focus-visible, .gc-rep:focus-visible, .gc-tab:focus-visible { outline: 3px solid rgba(37, 99, 235, 0.45); outline-offset: 2px; }

/* ---------- Workspace grid ---------- */
.gc-workspace { flex: 1 1 auto; display: grid; grid-template-columns: minmax(0, 1fr) 372px; grid-template-rows: minmax(0, 1fr); gap: 0; min-height: 0; }
.gc-editor-pane, .gc-review-pane { min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.gc-review-pane { border-left: 1px solid var(--aiwa-line); background: #fbfcfb; }

.gc-pane-head { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 18px; border-bottom: 1px solid var(--aiwa-line); }
.gc-pane-head h2 { margin: 0; font-size: 13px; font-weight: 750; color: var(--aiwa-text); letter-spacing: 0.005em; }
.gc-pane-head-actions { display: flex; align-items: center; gap: 4px; }

/* ---------- Editor ---------- */
.gc-editor-scroll { position: relative; flex: 1; min-height: 0; overflow: auto; }
.gc-editor { min-height: 100%; padding: 26px 34px 120px; outline: 0; color: var(--aiwa-ink); font-size: 17px; line-height: 1.85; white-space: pre-wrap; overflow-wrap: anywhere; caret-color: var(--aiwa-brand-dark); }
.gc-editor:empty::before { content: attr(data-placeholder); color: #8a958e; pointer-events: none; }
.gc-editor[dir="rtl"] { text-align: right; }
.gc-editor::selection, .gc-editor *::selection { background: rgba(19, 122, 61, 0.18); }

/* Issue underlines — category must never rely on colour alone, so the
   card list carries the text label; underline style also differs. */
.gc-mark { border-radius: 3px; cursor: pointer; text-decoration-line: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; text-decoration-skip-ink: none; transition: background-color 140ms var(--aiwa-ease); box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.gc-mark[data-cat="spelling"], .gc-mark[data-cat="grammar"], .gc-mark[data-cat="punctuation"] { text-decoration-color: #d92d20; }
.gc-mark[data-cat="clarity"] { text-decoration-color: #2a78d6; text-decoration-style: dashed; }
.gc-mark:hover { background: rgba(217, 45, 32, 0.1); }
.gc-mark[data-cat="clarity"]:hover { background: rgba(42, 120, 214, 0.1); }
.gc-mark.is-active { background: rgba(217, 45, 32, 0.16); }
.gc-mark[data-cat="clarity"].is-active { background: rgba(42, 120, 214, 0.16); }
.gc-editor.marks-hidden .gc-mark { text-decoration: none; background: transparent; box-shadow: none; }

.gc-editor-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; padding: 8px 18px; border-top: 1px solid var(--aiwa-line); background: #fbfcfb; flex-wrap: nowrap; }
.gc-editor-scroll { padding-top: 6px; }
.gc-stats { display: flex; align-items: center; flex-wrap: nowrap; gap: 4px 12px; color: var(--aiwa-muted); font-size: 12px; font-weight: 600; white-space: nowrap; flex: 1 1 auto; min-width: 0; overflow: hidden; }
.gc-foot-actions { flex: 0 0 auto; }
.gc-stats .gc-meter { width: 72px; }
@media (max-width: 1600px) { .gc-stats > span:first-child { display: none; } }
@media (max-width: 1560px) { .gc-stats > span:nth-child(2) { display: none; } }
.gc-foot-actions .gc-btn.small { padding-left: 9px; padding-right: 9px; }
.gc-stats b { color: var(--aiwa-ink); font-weight: 750; }
.gc-budget { display: flex; align-items: center; gap: 8px; }
.gc-meter { width: 120px; height: 5px; border-radius: 6px; overflow: hidden; background: #e4e9e5; }
.gc-meter > span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--aiwa-brand); transition: width 180ms var(--aiwa-ease); }
.gc-meter > span.warning { background: #dc8a12; }
.gc-meter > span.over { background: var(--aiwa-danger); }
.gc-budget-text.over { color: var(--aiwa-danger); font-weight: 750; }
.gc-foot-actions { display: flex; align-items: center; gap: 6px; }

/* ---------- Review panel (QuillBot-style) ---------- */
.gc-review-head { display: grid; gap: 10px; padding: 12px 14px 10px; border-bottom: 1px solid var(--aiwa-line); background: #fff; }
.gc-review-brand { display: flex; align-items: center; gap: 10px; }
.gc-review-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: var(--aiwa-brand-soft); }
.gc-review-icon .aiwa-ui-icon { width: 18px; height: 18px; filter: invert(35%) sepia(70%) saturate(680%) hue-rotate(97deg) brightness(91%); }
.gc-review-brand h2 { margin: 0; font-size: 14px; font-weight: 760; letter-spacing: -0.01em; }
.gc-review-brand p { margin: 1px 0 0; color: var(--aiwa-muted); font-size: 11.5px; }
.gc-review-summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 40px; padding: 6px 10px 6px 12px; border: 1px solid var(--aiwa-line); border-radius: 10px; background: #fbfcfb; }
.gc-summary-text { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 700; color: var(--aiwa-text); }
.gc-count { min-width: 24px; height: 24px; display: inline-grid; place-items: center; padding: 0 7px; border-radius: 999px; background: #d92d20; color: #fff; font-size: 12px; font-weight: 750; }
.gc-count.zero { background: var(--aiwa-brand-soft); color: var(--aiwa-brand-dark); }
.gc-review-summary .gc-btn { white-space: nowrap; }
.gc-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: 0 0 8px; }
.gc-dot[data-cat="spelling"], .gc-dot[data-cat="grammar"], .gc-dot[data-cat="punctuation"] { background: #d92d20; }
.gc-dot[data-cat="clarity"] { background: #2a78d6; }

.gc-list { flex: 1; min-height: 0; overflow: auto; padding: 10px 12px 20px; display: grid; align-content: start; gap: 8px; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { .gc-list { scroll-behavior: auto; } .gc-status[data-state="checking"]::before { animation: none; } }

/* Card: compact row that expands when active */
.gc-card { position: relative; display: grid; gap: 6px; padding: 10px 12px 10px 14px; border: 1px solid var(--aiwa-line); border-radius: 12px; background: #fff; text-align: left; cursor: pointer; transition: border-color 140ms var(--aiwa-ease), box-shadow 140ms var(--aiwa-ease), background-color 140ms var(--aiwa-ease); }
.gc-card::before { content: ""; position: absolute; top: 14px; left: 0; width: 3px; height: 10px; border-radius: 0 3px 3px 0; background: #d92d20; }
.gc-card[data-cat="clarity"]::before { background: #2a78d6; }
.gc-card:hover { border-color: #b9c5bd; box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06); }
.gc-card.is-active { border-color: var(--aiwa-brand); box-shadow: 0 0 0 3px rgba(19, 122, 61, 0.12), 0 6px 18px rgba(15, 23, 42, 0.08); }
.gc-card-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 22px; }
.gc-card-title { display: inline-flex; align-items: center; gap: 7px; color: var(--aiwa-text); font-size: 12px; font-weight: 700; letter-spacing: 0.005em; }
.gc-card-quick { display: inline-flex; align-items: center; gap: 2px; opacity: 0; transition: opacity 120ms var(--aiwa-ease); }
.gc-card:hover .gc-card-quick, .gc-card:focus-within .gc-card-quick, .gc-card.is-active .gc-card-quick { opacity: 1; }
@media (hover: none) { .gc-card-quick { opacity: 1; } }
.gc-quick { width: 30px; height: 30px; display: grid; place-items: center; border: 0; border-radius: 8px; background: transparent; color: var(--aiwa-muted); font-size: 16px; line-height: 1; cursor: pointer; }
.gc-quick:hover { background: var(--aiwa-bg); }
.gc-quick.accept { color: var(--aiwa-brand-dark); }
.gc-quick.accept:hover { background: var(--aiwa-brand-soft); }
.gc-quick.dismiss:hover { color: #9b1f14; background: #fdecea; }
.gc-card-diff { font-size: 14px; line-height: 1.6; color: var(--aiwa-ink); overflow-wrap: anywhere; }
.gc-card-diff .ctx { color: var(--aiwa-muted); }
.gc-card-diff del, .gc-sentence del { color: #b42318; text-decoration: line-through; text-decoration-thickness: 1.5px; text-decoration-color: rgba(180, 35, 24, 0.7); }
.gc-card-diff ins, .gc-sentence ins { color: var(--aiwa-brand-dark); font-weight: 750; text-decoration: none; }
.gc-card-diff del.gc-del-only, .gc-sentence del.gc-del-only { background: #fde8e6; border-radius: 3px; padding: 0 2px; }
.gc-card-more { display: none; gap: 10px; padding-top: 4px; border-top: 1px dashed var(--aiwa-line); margin-top: 2px; }
.gc-card.is-active .gc-card-more { display: grid; }
.gc-sentence { margin: 0; color: var(--aiwa-text); font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.gc-card p.gc-why { margin: 0; color: var(--aiwa-muted); font-size: 12.5px; line-height: 1.55; }
.gc-card-actions { display: flex; align-items: center; gap: 6px; }
.gc-card-actions .gc-btn { min-height: 34px; padding: 4px 14px; font-size: 12.5px; }
.gc-card-actions .gc-btn.primary .aiwa-ui-icon { width: 14px; height: 14px; }

/* Scores */
.gc-scores { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 12px 14px 8px; border-top: 1px solid var(--aiwa-line); background: #fff; }
.gc-score { display: grid; justify-items: center; gap: 4px; }
.gc-score small { color: var(--aiwa-muted); font-size: 11px; font-weight: 650; }
.gc-ring { --c: #a7afa9; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--c) calc(var(--p) * 1%), #eceff0 0); position: relative; }
.gc-ring::before { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: #fff; }
.gc-ring b { position: relative; font-size: 13px; font-weight: 750; color: var(--c); }
.gc-ring[data-level="good"] { --c: #137a3d; } .gc-ring[data-level="ok"] { --c: #d28a0c; } .gc-ring[data-level="bad"] { --c: #d92d20; }
.gc-score-bar { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.gc-score-tag { min-height: 22px; display: inline-flex; align-items: center; padding: 0 9px; border-radius: 999px; background: #eceff0; color: var(--aiwa-text); font-size: 11px; font-weight: 750; white-space: nowrap; }
.gc-score-tag[data-level="good"] { background: var(--aiwa-brand-soft); color: var(--aiwa-brand-dark); } .gc-score-tag[data-level="ok"] { background: #fff4e5; color: #7a3e0b; } .gc-score-tag[data-level="bad"] { background: #fdecea; color: #9b1f14; }
.gc-score-track { flex: 1; height: 5px; border-radius: 6px; background: #eceff0; overflow: hidden; }
.gc-score-track > span { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #d92d20, #d28a0c 55%, #137a3d); transition: width 300ms var(--aiwa-ease); }

/* Empty / state blocks */
.gc-state { display: grid; justify-items: center; gap: 10px; padding: 48px 22px; text-align: center; }
.gc-state-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px; background: var(--aiwa-brand-soft); }
.gc-state-icon .aiwa-ui-icon { width: 22px; height: 22px; filter: invert(35%) sepia(70%) saturate(680%) hue-rotate(97deg) brightness(91%); }
.gc-state.error .gc-state-icon { background: #fdecea; }
.gc-state.error .gc-state-icon .aiwa-ui-icon { filter: invert(22%) sepia(70%) saturate(2700%) hue-rotate(350deg) brightness(85%); }
.gc-state strong { font-size: 15px; letter-spacing: -0.01em; }
.gc-state p { margin: 0; max-width: 280px; color: var(--aiwa-muted); font-size: 13px; line-height: 1.55; }
.gc-state .gc-btn { margin-top: 4px; }
.gc-skeleton { display: grid; gap: 10px; padding: 12px 14px; }
.gc-skeleton span { height: 76px; border-radius: 12px; background: linear-gradient(90deg, #eef2ef 0%, #f8faf8 50%, #eef2ef 100%); background-size: 200% 100%; animation: gc-shimmer 1.2s linear infinite; }
@keyframes gc-shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .gc-skeleton span { animation: none; } }

.gc-review-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 16px; border-top: 1px solid var(--aiwa-line); background: #fff; color: var(--aiwa-muted); font-size: 11px; line-height: 1.45; }
.gc-review-foot .gc-engine { min-width: 0; }
.gc-review-foot b { color: var(--aiwa-text); font-weight: 700; }

/* Notice (limits, errors) */
.gc-notice { display: none; margin: 12px 18px 0; padding: 10px 12px; border: 1px solid #f0bd8c; border-radius: 10px; background: #fff7ed; color: #7c3a08; font-size: 13px; line-height: 1.5; }
.gc-notice.show { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.gc-notice.error { border-color: #f1b0a9; background: #fdecea; color: #9b1f14; }
.gc-notice a { color: inherit; font-weight: 750; }
.gc-notice button { flex: 0 0 auto; border: 0; background: transparent; color: inherit; font: inherit; font-weight: 750; cursor: pointer; }

/* Toast */
.gc-toast { position: fixed; left: 50%; bottom: 22px; z-index: 200; transform: translate(-50%, 16px); padding: 10px 16px; border-radius: 999px; background: var(--aiwa-ink); color: #fff; font-size: 13px; font-weight: 650; box-shadow: var(--aiwa-shadow-low); opacity: 0; pointer-events: none; transition: opacity 160ms var(--aiwa-ease), transform 160ms var(--aiwa-ease); }
.gc-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Mobile tabs */
.gc-tabs { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1260px) {
  .gc-workspace { grid-template-columns: minmax(0, 1fr) 340px; }
  .gc-editor { padding-inline: 24px; }
}
@media (max-width: 1020px) {
  .gc-command-inner { padding-inline: 14px; }
}
@media (max-width: 900px) {
  .gc-wordpill { display: none; }
  .gc-scores { grid-template-columns: repeat(4, 1fr); }
  .grammar-page main { height: calc(100dvh - 56px); }
  .gc-command-inner { min-height: 56px; flex-wrap: wrap; gap: 8px; padding: 8px 12px; }
  .gc-title h1 { font-size: 16px; }
  .gc-controls { margin-left: auto; }
  .gc-select select { width: 120px; }
  .gc-toggle span { display: none; }
  .gc-toggle { display: none; }
  .gc-pane-head-actions #gcMarksToggle { display: none; }
  .gc-pane-head { padding-inline: 12px; }
  .gc-tabs { flex: 0 0 auto; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 8px 12px 0; background: #fff; }
  .gc-tab { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--aiwa-line); border-radius: 10px; background: #fff; color: var(--aiwa-text); font-size: 13px; font-weight: 700; cursor: pointer; }
  .gc-tab[aria-selected="true"] { border-color: var(--aiwa-brand); background: var(--aiwa-brand-soft); color: var(--aiwa-brand-dark); }
  .gc-tab .gc-count { min-width: 20px; height: 20px; font-size: 11px; }
  .gc-workspace { grid-template-columns: minmax(0, 1fr); }
  .gc-tabs { padding-bottom: 8px; }
  .gc-review-pane { border-left: 0; border-top: 1px solid var(--aiwa-line); }
  body[data-gc-view="editor"] .gc-review-pane { display: none; }
  body[data-gc-view="review"] .gc-editor-pane { display: none; }
  .gc-editor { padding: 18px 16px 100px; font-size: 16px; line-height: 1.8; }
  .gc-editor-foot { flex-wrap: wrap; }
  .gc-foot-actions { width: 100%; justify-content: flex-end; }
  .gc-meter { width: 90px; }
  .gc-btn .gc-label-wide { display: none; }
}
@media (max-width: 480px) {
  .gc-controls { width: 100%; }
  .gc-select { flex: 1; }
  .gc-select select { width: 100%; }
}

/* ---------- Pro tiering (locked suggestions) ---------- */
.gc-mark.is-locked { text-decoration-style: dotted; text-decoration-color: #98a2b3; background: rgba(152, 162, 179, 0.14); }
.gc-mark.is-locked.is-active { background: rgba(152, 162, 179, 0.3); box-shadow: 0 0 0 2px rgba(152, 162, 179, 0.5); }
.gc-locked-badge { white-space: nowrap; display: inline-flex; align-items: center; min-height: 22px; padding: 0 8px; border-radius: 999px; background: #eef2ff; color: #3538cd; font-size: 11px; font-weight: 750; }
.gc-upsell { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid #c7d2fe; border-radius: 12px; background: linear-gradient(135deg, #eef2ff, #f5f3ff); }
.gc-upsell strong { display: block; font-size: 13px; color: #3538cd; }
.gc-upsell p { margin: 4px 0 0; color: #475467; font-size: 12px; line-height: 1.5; }
.gc-upsell .gc-btn { flex: 0 0 auto; border-color: #4f46e5; background: #4f46e5; }
.gc-upsell .gc-btn:hover { border-color: #4338ca; background: #4338ca; }
.gc-card.is-locked { cursor: default; }
.gc-card.is-locked::before { background: #98a2b3; }
.gc-card.is-locked .gc-card-more { display: none !important; }
.gc-card-blur { filter: blur(5px); opacity: 0.55; pointer-events: none; user-select: none; display: grid; gap: 8px; }
.gc-card-lock { position: absolute; inset: 0; border-radius: inherit; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: #344054; font-size: 13px; font-weight: 700; background: rgba(255, 255, 255, 0.35); }
.gc-lock-icon { font-size: 18px; }
.gc-card-lock .gc-btn { border-color: #4f46e5; background: #4f46e5; }
.gc-card-lock .gc-btn:hover { border-color: #4338ca; background: #4338ca; }
.gc-btn[hidden], .gc-locked-badge[hidden], [hidden].gc-count { display: none !important; }

/* v7: honest score hint + clarity cards */
.gc-score-hint { grid-column: 1 / -1; margin: 4px 0 0; font-size: 11.5px; line-height: 1.4; color: #5c6670; }
.gc-score-hint:empty { display: none; }
.gc-card[data-cat="clarity"] .gc-card-diff del { color: #6b7480; background: none; }

/* provisional marks while a scan streams in */
.gc-mark.is-provisional { background-image: none; border-bottom: 2px dotted rgba(214, 55, 40, 0.75); animation: gcPulse 1.2s ease-in-out infinite; }
@keyframes gcPulse { 0%, 100% { border-bottom-color: rgba(214, 55, 40, 0.35); } 50% { border-bottom-color: rgba(214, 55, 40, 0.95); } }

.gc-scores.no-readability { grid-template-columns: repeat(3, 1fr); }
.gc-score[hidden] { display: none !important; }


/* ---- Improve / Rewrite (inline, QuillBot-style) ---- */
.gc-ai-btn { border-color: #cfe3d6; background: #f3faf5; color: var(--aiwa-brand-dark); }
.gc-ai-btn:hover:not(:disabled) { background: #e6f4ea; border-color: #b9d7c3; }
.gc-ai-btn:disabled { opacity: 0.55; cursor: default; }
.gc-ai-btn .gc-caret, #gcDownloadBtn .gc-caret { font-size: 10px; margin-left: -2px; opacity: 0.8; }
.gc-menu-wrap { position: relative; }
.gc-menu { position: absolute; left: 0; bottom: calc(100% + 6px); z-index: 60; min-width: 230px; padding: 6px; border: 1px solid var(--aiwa-line); border-radius: 12px; background: #fff; box-shadow: 0 12px 32px rgba(16, 24, 40, 0.14), 0 2px 6px rgba(16, 24, 40, 0.06); }
.gc-menu[hidden] { display: none !important; }
.gc-menu-title { padding: 6px 10px 4px; font-size: 10.5px; font-weight: 750; letter-spacing: 0.06em; text-transform: uppercase; color: var(--aiwa-muted); }
.gc-menu-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--aiwa-text); font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.gc-menu-item:hover { background: #f1f6f2; }
.gc-menu-item b { font-weight: 700; }
.gc-menu-item small { display: block; color: var(--aiwa-muted); font-size: 11px; font-weight: 500; }
.gc-menu-item .gc-pro-tag { flex: 0 0 auto; padding: 1px 7px; border-radius: 999px; background: #eef2ff; color: #3f51b5; font-size: 10px; font-weight: 750; }
.gc-menu.floating { bottom: auto; top: calc(100% + 6px); }
/* floating selection toolbar */
.gc-editor-pane { position: relative; }
.gc-floatbar { position: absolute; z-index: 55; display: flex; align-items: center; gap: 2px; padding: 4px; border: 1px solid var(--aiwa-line); border-radius: 12px; background: #fff; box-shadow: 0 10px 28px rgba(16, 24, 40, 0.14), 0 2px 6px rgba(16, 24, 40, 0.06); transform: translate(-50%, calc(-100% - 10px)); }
.gc-floatbar[hidden] { display: none !important; }
.gc-floatbar::after { content: ""; position: absolute; left: 50%; bottom: -6px; width: 10px; height: 10px; background: #fff; border-right: 1px solid var(--aiwa-line); border-bottom: 1px solid var(--aiwa-line); transform: translateX(-50%) rotate(45deg); }
.gc-float-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: var(--aiwa-text); font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; white-space: nowrap; transition: background 120ms, color 120ms; }
.gc-float-btn:hover { background: var(--aiwa-brand-soft); color: var(--aiwa-brand-dark); }
.gc-float-btn .aiwa-ui-icon { width: 13px; height: 13px; }
.gc-float-btn[data-float="improve"], .gc-float-btn[data-float="rewrite"], .gc-float-btn[data-float="synonyms"] { color: var(--aiwa-brand-dark); }
.gc-floatbar .gc-menu { left: 50%; transform: translateX(-50%); bottom: auto; top: calc(100% + 10px); }
/* inline working / changed highlights (CSS Custom Highlight API; no-ops elsewhere) */
::highlight(gc-busy) { background: linear-gradient(90deg, #e8f1ea, #f6faf7); color: #5c6670; }
::highlight(gc-flash) { background: #dff5e6; color: #0f5132; }
.gc-editor.is-rewriting { caret-color: transparent; }
.gc-busy-range { background: #edf3ee; color: #6b7480; border-radius: 3px; animation: gcPulseBg 1.1s ease-in-out infinite; }
@keyframes gcPulseBg { 0%, 100% { background-color: #edf3ee; } 50% { background-color: #d9ece0; } }
.gc-flash-range { background: #dff5e6; border-radius: 3px; transition: background 1.2s ease 1.4s; }
.gc-flash-range.fade { background: transparent; }

@media (max-width: 1700px) { .gc-stats .gc-meter { display: none; } }
.gc-floatbar.below { transform: translate(-50%, 12px); }
.gc-floatbar.below::after { bottom: auto; top: -6px; border: 0; border-left: 1px solid var(--aiwa-line); border-top: 1px solid var(--aiwa-line); }
.gc-floatbar.below .gc-menu { top: calc(100% + 10px); }

.gc-float-btn[hidden] { display: none !important; }
.gc-syn-ico { font-weight: 800; font-size: 14px; line-height: 1; }
.gc-syn-menu { min-width: 200px; max-width: 300px; }
.gc-syn-word { padding: 6px 10px 4px; font-size: 10.5px; font-weight: 750; letter-spacing: 0.06em; text-transform: uppercase; color: var(--aiwa-muted); }
.gc-syn-word b { text-transform: none; letter-spacing: 0; font-size: 12px; color: var(--aiwa-text); }
.gc-syn-list { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 8px 8px; }
.gc-syn { min-height: 28px; padding: 0 11px; border: 1px solid var(--aiwa-line); border-radius: 999px; background: #fff; color: var(--aiwa-text); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.gc-syn:hover { border-color: var(--aiwa-brand); background: var(--aiwa-brand-soft); color: var(--aiwa-brand-dark); }
.gc-syn-empty { padding: 8px 10px 10px; color: var(--aiwa-muted); font-size: 12.5px; }
.gc-syn-loading { display: flex; align-items: center; gap: 8px; padding: 10px; color: var(--aiwa-muted); font-size: 12.5px; }
.gc-syn-loading::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid #cfd8d2; border-top-color: var(--aiwa-brand); animation: gcSpin 0.9s linear infinite; }
@keyframes gcSpin { to { transform: rotate(360deg); } }

/* ---- text formatting layer ---- */
.gc-editor .fmt-b { font-weight: 750; }
.gc-editor .fmt-i { font-style: italic; }
.gc-editor .fmt-u { text-decoration: underline; text-underline-offset: 3px; }
.gc-editor .fmt-s { text-decoration: line-through; }
.gc-editor .fmt-u.fmt-s { text-decoration: underline line-through; }
.gc-editor a.fmt-a { color: #1a56c4; text-decoration: underline; text-underline-offset: 3px; cursor: text; }
.gc-editor .fmt-h1 { font-size: 1.7em; font-weight: 780; letter-spacing: -0.02em; line-height: 1.25; }
.gc-editor .fmt-h2 { font-size: 1.4em; font-weight: 760; letter-spacing: -0.015em; line-height: 1.3; }
.gc-editor .fmt-h3 { font-size: 1.17em; font-weight: 740; line-height: 1.35; }
.gc-float-btn.icon { min-width: 30px; padding: 0 7px; justify-content: center; font-size: 13px; }
.gc-float-btn.icon b, .gc-float-btn.icon i, .gc-float-btn.icon u, .gc-float-btn.icon s { font-size: 13.5px; }
.gc-float-btn.is-on { background: var(--aiwa-brand-soft); color: var(--aiwa-brand-dark); box-shadow: inset 0 0 0 1px #bfe0c9; }
.gc-float-sep { width: 1px; height: 18px; margin: 0 3px; background: var(--aiwa-line); align-self: center; }
.gc-link-ico { font-size: 12px; }
.gc-link-form { display: flex; gap: 6px; padding: 8px; min-width: 280px; }
.gc-link-form input { flex: 1; min-width: 0; min-height: 32px; padding: 4px 10px; border: 1px solid var(--aiwa-line); border-radius: 8px; font: inherit; font-size: 13px; }
.gc-link-form .gc-btn { min-height: 32px; padding: 0 10px; }
.gc-menu-item.is-on { background: var(--aiwa-brand-soft); }

/* list markers */
.gc-editor .gc-li-marker { display: inline-block; min-width: 1.6em; margin-left: 0.4em; padding-right: 0.35em; color: var(--aiwa-brand-dark); font-weight: 700; text-align: right; user-select: none; }
.gc-editor .fmt-ul, .gc-editor .fmt-ol { }

/* ---- SEO / explainer content below the app ---- */
.has-tool-rail > .gc-explainer { margin-right: var(--tools-rail-width); transition: margin-right 180ms var(--aiwa-ease); }
.gc-explainer { padding: 40px 0 60px; border-top: 1px solid var(--aiwa-line); background: #fff; }
.gc-explainer .tool-explainer-inner { max-width: 1000px; }
.gc-explainer .explainer-intro p { color: var(--aiwa-muted); font-size: 15px; line-height: 1.65; max-width: 72ch; }
.gc-seo-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 28px 0 8px; }
.gc-seo-grid article { padding: 18px 18px 16px; border: 1px solid var(--aiwa-line); border-radius: 14px; background: #fbfcfb; }
.gc-seo-grid h3 { margin: 0 0 6px; font-size: 15px; font-weight: 760; letter-spacing: -0.01em; }
.gc-seo-grid p { margin: 0; color: #4b5560; font-size: 13.5px; line-height: 1.6; }
.gc-seo-h3 { margin: 30px 0 8px; font-size: 17px; font-weight: 760; letter-spacing: -0.015em; }
.gc-seo-langs { margin: 0; color: #4b5560; font-size: 13.5px; line-height: 1.65; }
.gc-faq { margin: 0; display: grid; gap: 0; border-top: 1px solid var(--aiwa-line); }
.gc-faq dt { padding: 14px 0 4px; font-weight: 750; font-size: 14.5px; }
.gc-faq dd { margin: 0; padding: 0 0 14px; border-bottom: 1px solid var(--aiwa-line); color: #4b5560; font-size: 13.5px; line-height: 1.6; }
.gc-faq a { color: var(--aiwa-brand-dark); }
@media (max-width: 900px) { .gc-seo-grid { grid-template-columns: 1fr; } .has-tool-rail > .gc-explainer { margin-right: 0; } }

/* Empty state — paste / upload (v17) */
.gc-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 24px; text-align: center; pointer-events: none; }
.gc-empty[hidden] { display: none !important; }
.gc-empty-title { margin: 0; color: #5e8f72; font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
.gc-empty-actions { display: flex; align-items: center; gap: 10px; pointer-events: auto; }
.gc-empty-actions .gc-btn { border-radius: 999px; padding-inline: 18px; }
.gc-empty-actions .gc-btn.ghost { border-color: transparent; background: transparent; color: var(--aiwa-brand-dark); }
.gc-empty-actions .gc-btn.ghost:hover { background: #eef6f0; }
.gc-empty-actions .gc-btn .aiwa-ui-icon { width: 16px; height: 16px; }
.gc-empty-actions .gc-btn.primary .aiwa-ui-icon { filter: brightness(0) invert(1); }
.gc-empty-hint { margin: 0; max-width: 360px; color: #8a958e; font-size: 12.5px; line-height: 1.5; }
.gc-empty .gc-btn.is-busy { pointer-events: none; opacity: 0.7; }
.gc-drop { position: absolute; inset: 8px; z-index: 40; display: flex; align-items: center; justify-content: center; border: 2px dashed var(--aiwa-brand); border-radius: 14px; background: rgba(255, 255, 255, 0.92); pointer-events: none; }
.gc-drop[hidden] { display: none !important; }
.gc-drop-card { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--aiwa-brand-dark); font-size: 15px; }
.gc-drop-card .aiwa-ui-icon { width: 34px; height: 34px; }
.gc-drop-card span { color: var(--aiwa-muted); font-size: 12.5px; }
.gc-editor-pane.is-importing .gc-editor { opacity: 0.5; pointer-events: none; }

/* Download menu */
.gc-menu.gc-menu-right { left: auto; right: 0; min-width: 280px; }
.gc-menu-item .gc-menu-ico { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 8px; background: #f1f6f2; }
.gc-menu-item .gc-menu-ico .aiwa-ui-icon { width: 16px; height: 16px; }
.gc-menu-item:has(.gc-menu-ico) { justify-content: flex-start; }
@media (max-width: 720px) { .gc-empty-title { font-size: 18px; } .gc-empty-hint { display: none; } }
.gc-btn.is-busy { opacity: 0.7; pointer-events: none; }
