/* rsch research tools: the calm editor workspace (Humanizer, DOI finder).
   Quiet surfaces, one accent, no decoration. Uses the site tokens from /site/site.css, so light and dark both work. */

.w-wrap { max-width: 1240px; margin: 0 auto; padding: 0 20px 72px; }
.w-wrap *, .w-wrap *::before, .w-wrap *::after { box-sizing: border-box; }

.w-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 28px 0 18px; }
.w-top h1 { font-family: var(--head); font-weight: 700; font-size: clamp(28px, 4vw, 40px); letter-spacing: -0.025em; line-height: 1.05; margin: 0 0 6px; }
.w-top p { margin: 0; color: var(--muted); font-size: 16px; max-width: 640px; }
.w-crumb { font-family: var(--head); font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); text-decoration: none; display: inline-block; margin-bottom: 10px; }
.w-crumb:hover { color: var(--ink); }
.w-quota { font-size: 14px; color: var(--muted); white-space: nowrap; }
.w-quota b { color: var(--ink); font-weight: 600; }

/* the workspace frame */
.w-frame { border: 1px solid var(--line); border-radius: 18px; background: var(--surface); overflow: hidden; }

/* thin settings bar */
.w-bar { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--bg); }
.w-field { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.w-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; padding: 2px; background: var(--surface); }
.w-seg button { font: 500 14px var(--body); color: var(--muted); background: none; border: 0; border-radius: 8px; padding: 6px 11px; cursor: pointer; }
.w-seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.w-seg button:focus-visible, .w-btn:focus-visible, .w-ghost:focus-visible, .w-select:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 2px; }
.w-select { font: 500 14px var(--body); color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px; }
.w-bar .w-spacer { flex: 1; }

/* two panes */
.w-panes { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 460px; }
.w-pane { display: flex; flex-direction: column; min-width: 0; }
.w-pane + .w-pane { border-left: 1px solid var(--line); }
.w-pane-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px 0; font-size: 13px; color: var(--muted); }
.w-pane-head b { font-family: var(--head); font-weight: 600; font-size: 14px; color: var(--ink); letter-spacing: 0.01em; }
.w-text { flex: 1; width: 100%; min-height: 380px; resize: vertical; border: 0; outline: 0; background: transparent; color: var(--ink); font: 400 16px/1.7 var(--body); padding: 12px 16px 16px; }
.w-text::placeholder { color: var(--muted); opacity: 0.8; }
.w-out { flex: 1; padding: 12px 16px 16px; font: 400 16px/1.7 var(--body); color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; min-height: 380px; }
.w-out.is-empty { color: var(--muted); }
.w-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 16px; border-top: 1px solid var(--line); }
.w-count { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.w-count.is-over { color: #c2410c; }

.w-btn { font: 700 15px var(--head); background: var(--cobalt); color: #fff; border: 0; border-radius: 999px; padding: 10px 20px; cursor: pointer; }
.w-btn:hover { background: var(--ink); color: var(--bg); }
.w-btn[disabled] { opacity: 0.55; cursor: progress; }
.w-ghost { font: 600 14px var(--body); background: none; color: var(--ink); border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; cursor: pointer; }
.w-ghost:hover { border-color: var(--ink); }

/* score meter under the result */
.w-meter { padding: 14px 16px 16px; border-top: 1px solid var(--line); background: var(--bg); }
.w-meter-row { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.w-meter-num { font: 700 28px var(--head); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.w-meter-num small { font-size: 15px; color: var(--muted); font-weight: 600; }
.w-meter-band { font-size: 14px; color: var(--muted); }
.w-track { position: relative; height: 8px; border-radius: 999px; background: var(--sunk); margin: 10px 0 6px; overflow: hidden; }
.w-track i { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 999px; background: var(--cobalt); transition: width 0.4s ease; }
.w-track i.was { background: var(--line); }
.w-scale { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.w-notes { margin: 10px 0 0; padding: 0; list-style: none; display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.w-notes b { color: var(--ink); font-weight: 600; }
:root[data-theme="dark"] .w-track i:not(.was) { background: var(--lime); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .w-track i:not(.was) { background: var(--lime); } }

/* sign-in gate and messages */
.w-gate { margin: 0 16px 16px; border: 1px solid var(--line); border-radius: 14px; padding: 16px; background: var(--bg); }
.w-gate h2 { font: 700 18px var(--head); margin: 0 0 4px; }
.w-gate p { margin: 0 0 12px; color: var(--muted); font-size: 15px; }
.w-gate .w-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.w-gate a { text-decoration: none; }
.w-msg { margin: 0 16px 12px; font-size: 14px; color: #c2410c; }
.w-msg:empty { display: none; }

/* DOI finder results */
.w-results { padding: 8px 16px 16px; display: grid; gap: 10px; align-content: start; }
.w-ref { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--surface); }
.w-ref-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; font-size: 13px; color: var(--muted); }
.w-tag { font: 600 12px var(--body); border-radius: 999px; padding: 2px 9px; border: 1px solid var(--line); color: var(--ink); }
.w-tag.ok { background: var(--lime); border-color: transparent; color: #15122b; }
.w-tag.warn { border-color: #c2410c; color: #c2410c; }
.w-ref p { margin: 0 0 8px; font-size: 15px; line-height: 1.6; }
.w-ref .w-line { font-size: 13px; color: var(--muted); margin: 0 0 6px; overflow-wrap: anywhere; }
.w-ref a { color: var(--link); overflow-wrap: anywhere; }
.w-ref .w-ref-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.w-below { max-width: 760px; margin: 36px 0 0; color: var(--muted); font-size: 15px; line-height: 1.7; }
.w-below h2 { font: 700 20px var(--head); color: var(--ink); margin: 26px 0 6px; }
.w-below p { margin: 0 0 10px; }
.w-below a { color: var(--link); }

@media (max-width: 860px) {
  .w-panes { grid-template-columns: 1fr; }
  .w-pane + .w-pane { border-left: 0; border-top: 1px solid var(--line); }
  .w-text, .w-out { min-height: 240px; }
}
@media (max-width: 520px) {
  .w-wrap { padding: 0 16px 56px; }
  .w-bar { gap: 10px; }
  .w-field { width: 100%; justify-content: space-between; }
  .w-seg button { padding: 6px 8px; font-size: 13px; }
}
