/* Resume editor — standalone page (/resume). Self-contained CSS, no Tailwind
   dependency (the vendored tailwind build is static and lacks JIT arbitrary
   values). Two-pane layout: left AI chat, right preview / code / visual editor. */

:root {
  --r-bg: #f6f5f3;
  --r-surface: #ffffff;
  --r-border: #e7e5e1;
  --r-ink: #1f2937;
  --r-muted: #6b7280;
  --r-accent: #2f6fdb;
  --r-accent-soft: #eaf1fc;
  --r-danger: #dc2626;
  --r-danger-soft: #fef2f2;
  --r-radius: 10px;
  --r-shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.08);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--r-bg);
  color: var(--r-ink);
  font-family: "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

[x-cloak] { display: none !important; }

.r-app { display: flex; flex-direction: column; height: 100vh; width: 100vw; overflow: hidden; }

/* ---------- top bar ---------- */
.r-topbar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 16px;
  background: var(--r-surface);
  border-bottom: 1px solid var(--r-border);
}
.r-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.r-back {
  display: inline-flex; align-items: center; gap: 5px;
  color: var(--r-muted); text-decoration: none; font-size: 13px;
  padding: 4px 8px; border-radius: 7px; transition: background .15s, color .15s;
}
.r-back:hover { background: var(--r-bg); color: var(--r-ink); }
/* 与左侧返回链接「Offer岛」(.r-back) 一致的字体风格：同字号 / 字重 / 颜色 */
.r-title { font-size: 13px; font-weight: 400; color: var(--r-muted); white-space: nowrap; }
.r-title .r-dot { color: var(--r-accent); }
.r-topbar-right { display: flex; align-items: center; gap: 8px; }

/* segmented control (mode tabs / language) */
.r-seg {
  display: inline-flex; align-items: center; gap: 2px;
  background: var(--r-bg); border: 1px solid var(--r-border);
  border-radius: 8px; padding: 2px;
}
.r-seg button {
  border: 0; background: transparent; cursor: pointer;
  font: inherit; font-size: 12px; color: var(--r-muted);
  padding: 5px 11px; border-radius: 6px; transition: background .15s, color .15s;
}
.r-seg button:hover { color: var(--r-ink); }
.r-seg button.is-active { background: var(--r-surface); color: var(--r-ink); box-shadow: var(--r-shadow); }
.r-seg button:disabled { opacity: .45; cursor: not-allowed; }

/* dropdown picker (role / style) */
.r-picker { position: relative; }
.r-picker > button {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  border: 1px solid var(--r-border); background: var(--r-bg);
  border-radius: 8px; padding: 5px 10px; font: inherit; font-size: 12px;
  color: var(--r-muted); cursor: pointer; transition: color .15s;
}
.r-picker > button:hover { color: var(--r-ink); }
.r-picker .r-pk-prefix { color: var(--r-muted); }
.r-picker .r-pk-value { color: var(--r-ink); }
.r-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 30;
  min-width: 220px; max-width: 320px; background: var(--r-surface);
  border: 1px solid var(--r-border); border-radius: var(--r-radius);
  box-shadow: 0 8px 24px rgba(16,24,40,.12); overflow: hidden; padding: 4px;
}
.r-menu button {
  display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left;
  border: 0; background: transparent; cursor: pointer; font: inherit;
  padding: 8px 10px; border-radius: 7px; color: var(--r-ink);
}
.r-menu button:hover { background: var(--r-bg); }
.r-menu button.is-active { background: var(--r-accent-soft); }
.r-menu .r-mi-label { font-weight: 500; font-size: 13px; }
.r-menu button.is-active .r-mi-label { color: var(--r-accent); }
.r-menu .r-mi-desc { font-size: 11px; line-height: 1.4; color: var(--r-muted); }
.chev { width: 10px; height: 10px; transition: transform .15s; }
.chev.open { transform: rotate(180deg); }

/* ---------- body split ---------- */
.r-body { flex: 1; display: flex; min-height: 0; }
.r-chat {
  flex: 0 0 auto; min-width: 280px; /* width set inline via chatWidth (draggable) */
  display: flex; flex-direction: column;
  background: var(--r-surface);
}
.r-right { flex: 1; min-width: 0; display: flex; position: relative; }

/* busy overlay (AI translating language): greys + blocks the whole right pane */
.r-busy {
  position: absolute; inset: 0; z-index: 40;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: rgba(246, 245, 243, 0.72); backdrop-filter: blur(1.5px);
  color: var(--r-ink); font-size: 13px; cursor: progress;
}
.r-busy-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--r-accent); animation: rpulse 1s infinite; }

/* draggable divider between chat and right pane */
.r-divider {
  flex: 0 0 auto; width: 1px; position: relative; cursor: col-resize;
  background: var(--r-border); transition: background .15s;
}
.r-divider::before { content: ""; position: absolute; top: 0; bottom: 0; left: -3px; right: -3px; } /* wider grab zone */
.r-divider:hover { background: var(--r-accent); }
body.r-resizing { cursor: col-resize; user-select: none; }
body.r-resizing iframe { pointer-events: none; } /* keep drag alive over the PDF */
.r-pane { flex: 1; min-width: 0; height: 100%; position: relative; overflow: hidden; background: var(--r-surface); }
.r-pane + .r-pane { border-left: 1px solid var(--r-border); }

/* ---------- chat ---------- */
.r-chat-head { padding: 12px 16px; border-bottom: 1px solid var(--r-border); }
.r-chat-head .h { font-weight: 600; font-size: 14px; }
.r-chat-head .s { font-size: 12px; color: var(--r-muted); margin-top: 2px; }
.r-msgs { flex: 1; overflow-y: auto; padding: 16px; }
/* Empty-state suggestions: centered both axes in the chat area. */
.r-suggest {
  height: 100%;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  gap: 10px; color: var(--r-muted);
}
.r-suggest button {
  display: block; width: 100%; max-width: 300px; text-align: center; cursor: pointer; font: inherit;
  border: 1px dashed var(--r-border); border-radius: 8px; padding: 8px 10px;
  background: transparent; transition: border-color .15s, background .15s;
}
.r-suggest button:hover { border-color: var(--r-accent); background: var(--r-bg); }
.r-suggest .tag {
  display: inline-block; background: var(--r-bg); color: var(--r-muted);
  font-size: 10px; padding: 1px 6px; border-radius: 5px; margin-bottom: 4px;
}
.r-suggest .ex { font-size: 12px; font-style: italic; color: var(--r-ink); }

.r-msg { display: flex; margin-bottom: 14px; }
.r-msg.user { justify-content: flex-end; }
/* column wrapper: bubble + (optional) selectable plan buttons stacked under it */
.r-msg .r-msg-col { display: flex; flex-direction: column; max-width: 86%; }
.r-msg.user .r-msg-col { align-items: flex-end; }
.r-msg .bubble {
  max-width: 100%; border-radius: 12px; padding: 8px 12px;
  font-size: 13.5px; line-height: 1.6; white-space: pre-wrap; word-break: break-word;
}
.r-msg.user .bubble { background: var(--r-accent); color: #fff; border-bottom-right-radius: 4px; }
.r-msg.assistant .bubble { background: var(--r-bg); color: var(--r-ink); border-bottom-left-radius: 4px; }
.r-msg .bubble a { color: inherit; text-decoration: underline; }

/* proposal options: clickable plan cards under an assistant bubble */
.r-options { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.r-option {
  display: block; width: 100%; text-align: left; cursor: pointer; font: inherit;
  border: 1px solid var(--r-border); border-radius: 8px; padding: 7px 11px;
  background: var(--r-surface); transition: border-color .15s, background .15s, opacity .15s;
}
.r-option:hover:not(:disabled) { border-color: var(--r-accent); background: var(--r-accent-soft); }
.r-option .t { display: block; font-weight: 600; font-size: 12.5px; color: var(--r-ink); }
.r-option .t::before { content: "→ "; color: var(--r-accent); font-weight: 700; }
.r-option .d { display: block; font-size: 11.5px; color: var(--r-muted); margin-top: 2px; line-height: 1.5; }
.r-option.chosen { border-color: var(--r-accent); background: var(--r-accent-soft); }
.r-option.chosen .t::before { content: "✓ "; }
.r-option.dim { opacity: .4; }
.r-option:disabled { cursor: default; }
.r-typing { display: flex; align-items: center; gap: 5px; color: var(--r-muted); padding: 2px 4px; }
.r-typing .d { width: 6px; height: 6px; border-radius: 50%; background: #b6b3ad; animation: rpulse 1s infinite; }
.r-typing .d:nth-child(2) { animation-delay: .15s; }
.r-typing .d:nth-child(3) { animation-delay: .3s; }
@keyframes rpulse { 0%,100% { opacity: .3; } 50% { opacity: 1; } }

.r-compose { border-top: 1px solid var(--r-border); padding: 12px; }
/* greyed + non-interactive while a background translation is running */
.r-compose.is-busy { opacity: .5; pointer-events: none; }
.r-inputbox {
  border: 1px solid var(--r-border); border-radius: var(--r-radius);
  background: var(--r-surface); padding: 8px 10px; transition: border-color .15s;
}
.r-inputbox:focus-within { border-color: var(--r-accent); }
.r-inputbox textarea {
  width: 100%; border: 0; outline: 0; resize: none; background: transparent;
  font: inherit; font-size: 13.5px; line-height: 1.5; color: var(--r-ink);
  max-height: 140px;
}
.r-compose-row { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
.r-send {
  border: 0; cursor: pointer; font: inherit; font-size: 12px; font-weight: 500;
  padding: 6px 14px; border-radius: 8px; background: var(--r-accent); color: #fff;
  transition: opacity .15s;
}
.r-send:hover { opacity: .9; }
.r-send:disabled { background: #e3e1dd; color: #a8a5a0; cursor: not-allowed; }
.r-compose-hint { font-size: 10px; color: var(--r-muted); margin-top: 6px; }

/* "+" upload button (compose row, left) */
.r-attach {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border: 1px solid var(--r-border); background: var(--r-surface);
  border-radius: 8px; color: var(--r-muted); cursor: pointer; transition: color .15s, border-color .15s;
}
.r-attach:hover:not(:disabled) { color: var(--r-accent); border-color: var(--r-accent); }
.r-attach:disabled { opacity: .45; cursor: not-allowed; }

/* queued file chips (above the input) */
.r-attachments { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.r-att-chip {
  display: inline-flex; align-items: center; gap: 5px; max-width: 100%;
  background: var(--r-bg); border: 1px solid var(--r-border); border-radius: 999px;
  padding: 3px 6px 3px 9px; font-size: 12px; color: var(--r-ink);
}
.r-att-chip svg { color: var(--r-muted); flex-shrink: 0; }
.r-att-chip .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 180px; }
.r-att-chip button {
  border: 0; background: transparent; cursor: pointer; color: var(--r-muted);
  font-size: 14px; line-height: 1; padding: 0 2px;
}
.r-att-chip button:hover { color: var(--r-danger); }

/* ---------- preview pane ---------- */
.r-pv-tools { position: absolute; right: 16px; top: 16px; z-index: 10; display: flex; align-items: center; gap: 8px; }
.r-chip {
  display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,.92);
  border: 1px solid var(--r-border); border-radius: 8px; padding: 5px 10px;
  font-size: 12px; color: var(--r-muted); box-shadow: var(--r-shadow); cursor: pointer;
  font-family: inherit; transition: color .15s, border-color .15s;
}
.r-chip:hover { color: var(--r-accent); border-color: var(--r-accent); }
.r-chip:disabled { color: #b6b3ad; cursor: not-allowed; border-color: var(--r-border); }
.r-chip .spin { width: 8px; height: 8px; border-radius: 50%; background: var(--r-accent); animation: rpulse 1s infinite; }

/* PDF fills the pane; the embedded viewer owns scrolling at the chosen #zoom
   (no offset hack — that clipped content/scrollbars when zoomed). */
.r-pdf { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #f1f0ee; transition: opacity .2s; }
.r-pdf.dim { opacity: .55; }
.r-watermark { pointer-events: none; position: absolute; inset: 0; z-index: 5; background-repeat: repeat; }
.r-pv-empty, .r-pv-blocked {
  height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; color: var(--r-muted); font-size: 13px; text-align: center; padding: 24px;
}
.r-err { height: 100%; display: flex; flex-direction: column; padding: 16px; overflow: hidden; }
.r-err .t { font-weight: 600; color: var(--r-danger); margin-bottom: 8px; font-size: 13px; }
.r-err pre {
  flex: 1; margin: 0; overflow: auto; white-space: pre-wrap; word-break: break-word;
  border: 1px solid #fecaca; background: var(--r-danger-soft); border-radius: 8px;
  padding: 12px; font-size: 11px; line-height: 1.55; color: #7f1d1d;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* preview zoom controls (bottom-right) */
.r-zoom {
  position: absolute; right: 16px; bottom: 16px; z-index: 10;
  display: flex; align-items: center; gap: 2px;
  background: rgba(255, 255, 255, 0.95); border: 1px solid var(--r-border);
  border-radius: 9px; padding: 3px; box-shadow: var(--r-shadow);
}
.r-zoom button {
  border: 0; background: transparent; cursor: pointer; color: var(--r-muted);
  width: 28px; height: 28px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center; font: inherit;
}
.r-zoom button:hover { background: var(--r-bg); color: var(--r-ink); }
.r-zoom .lbl { width: auto; min-width: 46px; padding: 0 6px; font-size: 12px; color: var(--r-ink); }

/* ---------- code pane ---------- */
.r-code { height: 100%; width: 100%; display: flex; }
.r-code textarea {
  flex: 1; width: 100%; height: 100%; border: 0; outline: 0; resize: none;
  padding: 14px 16px; background: var(--r-surface); color: var(--r-ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
  font-size: 12.5px; line-height: 1.6; tab-size: 2; white-space: pre;
}

/* ---------- connection banner ---------- */
.r-conn {
  margin: 16px; padding: 14px 16px; border-radius: var(--r-radius);
  background: #fffbeb; border: 1px solid #fde68a; color: #92400e; font-size: 13px; line-height: 1.6;
}
.r-conn b { color: #78350f; }
.r-conn a { color: var(--r-accent); }
.r-conn code {
  display: block; margin-top: 8px; padding: 8px 10px; background: #fff; border: 1px solid #fde68a;
  border-radius: 7px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11px;
  white-space: pre-wrap; word-break: break-all; color: #78350f;
}
.r-status {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--r-muted);
}
.r-status .led { width: 8px; height: 8px; border-radius: 50%; background: #cbd5e1; }
.r-status.ok .led { background: #16a34a; }
.r-status.bad .led { background: #ef4444; }

/* small spinner for full-page loading */
.r-loading { height: 100%; display: flex; align-items: center; justify-content: center; color: var(--r-muted); }

/* ===================== visual block editor (3b) ===================== */
.r-editor { overflow-y: auto; background: var(--r-surface); }
.r-edit-doc { max-width: 860px; margin: 0 auto; padding: 28px 56px 80px; }

.r-sec { position: relative; }
.r-sechead { position: relative; margin: 26px 0 6px; }
.r-sub { position: relative; margin: 6px 0; border: 1px solid transparent; border-radius: 8px; }
.r-sub:hover { border-color: #f0efec; }
.r-blk { position: relative; padding: 2px 6px; border-radius: 6px; }
.r-blk:hover { background: #fafaf9; }
.r-sub-body { padding: 4px 8px; }

/* hover rails (move / delete controls) */
.rail { position: absolute; z-index: 6; display: none; flex-direction: column; gap: 2px; }
.rail-left { left: -34px; top: 2px; }
.rail-right { right: -34px; top: 2px; }
.rail-inner { left: -26px; top: 2px; }
.r-sechead:hover > .rail, .r-sub:hover > .rail, .r-blk:hover > .rail-inner { display: flex; }
.railbtn {
  width: 24px; height: 24px; border: 0; background: transparent; cursor: pointer;
  border-radius: 6px; color: #a8a5a0; font-size: 13px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.railbtn:hover:not(:disabled) { background: #ebe9e4; color: #3f3f46; }
.railbtn:disabled { color: #d8d6d1; cursor: default; }

/* inputs (transparent, focus highlight) */
.r-editor input { font: inherit; border: 0; outline: 0; background: transparent; border-radius: 5px; padding: 2px 4px; color: var(--r-ink); }
.r-editor input:focus { background: #f4f3f1; }

.r-sec-title {
  width: 100%; font-size: 22px; font-weight: 800; letter-spacing: -0.01em;
  color: var(--r-accent); border-bottom: 2px solid var(--r-accent) !important;
  padding-bottom: 4px !important; border-radius: 0 !important;
}

/* header block */
.r-h-head { text-align: center; padding: 6px 0; display: flex; flex-direction: column; gap: 4px; align-items: center; }
.r-h-name { width: 100%; text-align: center; font-size: 28px; font-weight: 700; }
.r-h-title { width: 100%; text-align: center; font-size: 15px; color: var(--r-muted); }
.r-h-contacts { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px; padding-top: 4px; }
.r-contact { position: relative; display: flex; align-items: center; gap: 2px; border: 1px solid transparent; border-radius: 6px; padding: 1px 3px; }
.r-contact:hover { border-color: #ecebe7; }
.r-contact-icon { display: flex; align-items: center; justify-content: center; width: 22px; height: 22px; border: 0; background: transparent; cursor: pointer; border-radius: 5px; color: #57534e; }
.r-contact-icon.linked { color: var(--r-accent); }
.r-contact-icon:hover { background: #f0efec; }
.r-contact-text { font-size: 13px; min-width: 70px; }
.r-contact-del { border: 0; background: transparent; cursor: pointer; color: #c5c2bc; font-size: 13px; visibility: hidden; }
.r-contact:hover .r-contact-del { visibility: visible; }
.r-contact-del:hover { color: var(--r-danger); }
.r-contact-pop {
  position: absolute; left: 0; top: calc(100% + 6px); z-index: 30; width: 280px;
  background: var(--r-surface); border: 1px solid var(--r-border); border-radius: var(--r-radius);
  box-shadow: 0 8px 24px rgba(16,24,40,.14); padding: 10px; text-align: left;
}
.r-pop-label { font-size: 10px; text-transform: uppercase; letter-spacing: .04em; color: var(--r-muted); margin-bottom: 6px; }
.r-icon-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin-bottom: 10px; }
.r-icon-opt { display: flex; flex-direction: column; align-items: center; gap: 2px; height: 42px; border: 1px solid transparent; border-radius: 7px; background: transparent; cursor: pointer; color: #57534e; font-size: 9px; }
.r-icon-opt:hover { border-color: var(--r-border); background: var(--r-bg); }
.r-icon-opt.is-active { border-color: var(--r-accent); background: var(--r-accent-soft); color: var(--r-accent); }
.r-icon-opt .lbl { line-height: 1; }
.r-pop-href { width: 100%; border: 1px solid var(--r-border) !important; border-radius: 6px; padding: 5px 8px !important; font-size: 12px; }
.r-pop-href:focus { border-color: var(--r-accent) !important; background: var(--r-surface) !important; }

/* entry */
.r-entry { display: grid; grid-template-columns: 1fr auto; gap: 1px 12px; }
.r-e-org { font-size: 15px; font-weight: 700; }
.r-e-date { text-align: right; font-size: 13px; color: var(--r-muted); }
.r-e-role { font-size: 14px; font-style: italic; }
.r-e-loc { text-align: right; font-size: 13px; color: var(--r-muted); }

/* bullets */
.r-bullets { list-style: none; margin: 2px 0; padding: 0 0 0 6px; }
.r-bullet { display: grid; grid-template-columns: 1em 1fr auto; align-items: baseline; gap: 6px; font-size: 14px; line-height: 1.6; }
.r-bullet .dot { color: var(--r-muted); user-select: none; }
.r-bullet-del { border: 0; background: transparent; cursor: pointer; color: #c5c2bc; font-size: 13px; visibility: hidden; align-self: center; }
.r-bullet:hover .r-bullet-del { visibility: visible; }
.r-bullet-del:hover { color: var(--r-danger); }

/* skills */
.r-skills { display: flex; align-items: baseline; gap: 8px; font-size: 14px; }
.r-sk-label { font-weight: 700; width: 130px; }
.r-sk-content { flex: 1; }

/* rich text contenteditable */
.rt { outline: 0; border-radius: 4px; padding: 1px 4px; line-height: 1.6; min-height: 1.4em; }
.rt:focus { background: #f4f3f1; }
.rt:empty:before { content: attr(data-placeholder); color: #b6b3ad; }
.r-para { font-size: 14px; }
.rt a { color: var(--r-accent); }

/* raw placeholder */
.r-raw {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px dashed var(--r-border); background: var(--r-bg); border-radius: 8px;
  padding: 8px 12px; font-size: 12px; color: var(--r-muted); margin: 4px 0;
}

/* inline add buttons / pills / insert menus */
.r-add-inline { border: 0; background: transparent; cursor: pointer; color: #a8a5a0; font-size: 12px; padding: 2px 4px; }
.r-add-inline:hover { color: var(--r-accent); }
.r-add-inline.indent { margin-left: 10px; }
.r-pill {
  border: 1px dashed var(--r-border); background: transparent; cursor: pointer;
  color: var(--r-muted); font-size: 12px; border-radius: 999px; padding: 3px 12px;
}
.r-pill:hover { border-color: var(--r-accent); color: var(--r-accent); }
.r-insert-sub { position: relative; display: flex; justify-content: center; margin: 8px 0; }
.r-insert-menu {
  position: absolute; top: calc(100% + 6px); z-index: 20; display: flex; flex-wrap: wrap; gap: 4px;
  background: var(--r-surface); border: 1px solid var(--r-border); border-radius: 8px; padding: 4px; box-shadow: var(--r-shadow);
}
.r-insert-menu button { border: 0; background: transparent; cursor: pointer; font: inherit; font-size: 12px; padding: 5px 10px; border-radius: 6px; color: var(--r-ink); }
.r-insert-menu button:hover { background: var(--r-bg); }
.r-insert-section { display: block; margin: 24px auto 0; border: 1px dashed var(--r-border); background: transparent; cursor: pointer; color: var(--r-muted); font-size: 12px; font-weight: 500; border-radius: 999px; padding: 5px 16px; }
.r-insert-section:hover { border-color: var(--r-accent); color: var(--r-accent); }

/* floating rich-text toolbar */
.r-rt-toolbar {
  position: fixed; transform: translateX(-50%); z-index: 50;
  display: flex; align-items: center; gap: 2px;
  background: var(--r-surface); border: 1px solid var(--r-border); border-radius: 8px;
  padding: 4px; box-shadow: 0 6px 20px rgba(16,24,40,.18);
}
.r-rt-toolbar button { width: 26px; height: 26px; border: 0; background: transparent; cursor: pointer; border-radius: 6px; color: #3f3f46; font-size: 13px; display: flex; align-items: center; justify-content: center; }
.r-rt-toolbar button:hover { background: var(--r-bg); }
.r-rt-sep { width: 1px; height: 16px; background: var(--r-border); margin: 0 4px; }
.r-rt-color span { display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 1px solid var(--r-border); }

/* download menu (in preview tools) */
.r-dl { position: relative; }
.r-dl-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 168px;
  background: var(--r-surface); border: 1px solid var(--r-border); border-radius: var(--r-radius);
  box-shadow: 0 8px 24px rgba(16,24,40,.12); padding: 4px;
}
.r-dl-menu button {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%;
  border: 0; background: transparent; cursor: pointer; font: inherit; font-size: 13px;
  padding: 7px 10px; border-radius: 7px; color: var(--r-ink);
}
.r-dl-menu button:hover { background: var(--r-bg); color: var(--r-accent); }
.r-dl-menu .ext { font-size: 10px; color: var(--r-muted); }
