body { overflow: auto; }
.rw { width: min(1180px, 100%); margin: 0 auto; padding: 24px 16px 48px; }
.rw h1 { margin: 0 0 4px; font-size: 24px; }
.rw .intro { margin: 0 0 16px; color: var(--muted); font-size: 14px; }
.engines { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; margin: 0 0 14px; padding: 10px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; font-size: 13.5px; }
.engines label { display: flex; align-items: center; gap: 7px; cursor: pointer; }
.engines input { accent-color: var(--accent); }
.engines .muted { color: var(--muted); }
.ai-status { flex-basis: 100%; color: var(--muted); font-size: 12.5px; }
.ai-status:empty { display: none; }
.chip:disabled { opacity: .4; cursor: default; }
.offline { margin: 0 0 14px; padding: 10px 14px; border: 1px solid var(--warn-line); background: rgba(250, 178, 25, .08); border-radius: 10px; color: var(--warn-text); font-size: 13.5px; }
.modes { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.chip { border: 1px solid var(--line); background: var(--panel-2); color: var(--text); font: inherit; font-size: 13px; padding: 7px 13px; border-radius: 999px; cursor: pointer; }
.chip.active { border-color: var(--accent); background: rgba(79, 140, 255, .18); }
.panes { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pane { display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.pane-head { display: flex; justify-content: space-between; align-items: center; padding: 9px 12px; border-bottom: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.pane-head strong { color: var(--text); font-size: 13px; }
.pane textarea {
  flex: 1; min-height: 360px; resize: vertical; border: 0; outline: none; padding: 14px; background: transparent;
  color: var(--text); font: 15px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.pane textarea.working { opacity: .45; }
.pane-foot { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-top: 1px solid var(--line); }
.pane-foot .meta { flex: 1; }
.over { color: var(--danger); font-weight: 600; }
.small-print { margin-top: 14px; color: var(--muted); font-size: 12px; }
.rw .toast { position: fixed; }
@media (max-width: 820px) { .panes { grid-template-columns: 1fr; } .pane textarea { min-height: 220px; } }

/* loading and progress */
.spin { display: inline-block; width: 14px; height: 14px; margin-right: 8px; vertical-align: -2px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff; animation: rw-spin .7s linear infinite; }
.btn.loading { pointer-events: none; }
.btn:not(.primary) .spin { border-color: var(--line-strong); border-top-color: var(--accent); }
@keyframes rw-spin { to { transform: rotate(360deg); } }
.progress { height: 3px; background: transparent; margin-top: -1px; }
.progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), #8b5cf6); transition: width .3s; }
.pane { position: relative; }
.pane.working::after {
  content: ""; position: absolute; inset: 40px 0 52px; pointer-events: none;
  background: linear-gradient(100deg, transparent 20%, rgba(79, 140, 255, .10) 50%, transparent 80%); background-size: 200% 100%;
  animation: rw-shimmer 1.1s linear infinite;
}
@keyframes rw-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.pane.fresh { animation: rw-fresh 1s ease-out; }
@keyframes rw-fresh { from { box-shadow: 0 0 0 3px rgba(79, 140, 255, .55); } to { box-shadow: 0 0 0 3px transparent; } }

/* writing style check */
.style-check { margin-top: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.sc-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.sc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.sc-card { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; --sc: #f59e0b; }
.sc-card.good { --sc: #22c55e; } .sc-card.high { --sc: #ef4444; }
.sc-title { font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); font-weight: 700; }
.sc-score { display: flex; align-items: baseline; gap: 10px; margin: 4px 0 6px; }
.sc-score b { font-size: 30px; color: var(--sc); font-variant-numeric: tabular-nums; }
.sc-score span { color: var(--muted); font-size: 13px; }
.sc-bar { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.sc-bar i { display: block; height: 100%; background: var(--sc); border-radius: 3px; transition: width .4s; }
.sc-card ul { list-style: none; margin: 10px 0 0; padding: 0; font-size: 12.5px; color: var(--muted); }
.sc-card li { margin: 5px 0; display: flex; gap: 7px; align-items: baseline; }
.sc-card li b { color: var(--text); font-weight: 600; white-space: nowrap; }
.sc-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--sc); transform: translateY(-1px); }