.rb {
  --rb-bg: #161020;
  --rb-panel: #251b33;
  --rb-border: #59416e;
  --rb-muted: #c6b7d7;
  --rb-purple: #bb8bf3;
  max-width: 1680px;
  margin: 0 auto;
  color: #f6edff;
}
.rb *, .rb *::before, .rb *::after { box-sizing: border-box; }
.rb [hidden] { display: none !important; }
.rb h1, .rb h2, .rb h3, .rb p { margin-top: 0; }
.rb h2 { font-size: 1.08rem; margin-bottom: 12px; }
.rb button, .rb input, .rb select, .rb textarea { font: inherit; }
.rb button, .rb-file {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 9px 13px;
  border: 1px solid #795992;
  border-radius: 9px;
  background: #352343;
  color: #fff3ff;
  cursor: pointer;
  line-height: 1.3;
  font-size: .84rem;
}
.rb button:hover, .rb-file:hover { background: #4b2e63; border-color: #be94e9; }
.rb button:disabled { opacity: .4; cursor: default; }
.rb button:focus-visible, .rb input:focus-visible, .rb select:focus-visible, .rb textarea:focus-visible, .rb a:focus-visible, .rb summary:focus-visible, .rb-file:focus-within { outline: 3px solid #e0bcff; outline-offset: 3px; }
.rb .rb-primary { border-color: #d1a7ff; background: linear-gradient(135deg,#9859d1,#733abd); font-weight: 700; }
.rb .rb-primary:hover { background: #9859d1; }
.rb .rb-danger { color: #ffc1d2; }
.rb input:not([type=checkbox]), .rb select, .rb textarea { width: 100%; min-width: 0; padding: 10px 12px; border: 1px solid #6c4e83; border-radius: 8px; background: #181020; color: #f9f1ff; }
.rb textarea { resize: vertical; line-height: 1.65; }
.rb input[type=checkbox] { accent-color: #bc89ef; width: 16px; height: 16px; flex-shrink: 0; }
.rb label:not(.rb-file):not(.rb-check) { display: flex; flex-direction: column; gap: 7px; min-width: 0; font-size: .8rem; color: #d3c2e5; }
.rb .rb-label { margin: 14px 0; }
.rb-check { display: flex; align-items: center; gap: 8px; font-size: .82rem; line-height: 1.5; margin: 12px 0; }
.rb-file { position: relative; overflow: hidden; }
.rb-file input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.rb-hero { display: grid; grid-template-columns: minmax(0,1fr) 240px; gap: 36px; padding: 34px; border: 1px solid #795594; border-radius: 22px; margin-bottom: 24px; background: radial-gradient(ellipse at top right,#65398188,transparent 65%),linear-gradient(120deg,#2e1c40,#191124); }
.rb-hero h1 { font-size: clamp(1.8rem,3.1vw,2.7rem); line-height: 1.2; margin: 14px 0 18px; }
.rb-hero p { line-height: 1.75; max-width: 950px; color: #e1d3f0; }
.rb-eyebrow { color: #d1acfa; font-weight: 800; letter-spacing: .13em; font-size: .7rem; }
.rb-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.rb-tags span { border: 1px solid #715183; border-radius: 30px; background: #281a36; padding: 5px 10px; font-size: .76rem; }
.rb-hero-art { display: grid; align-content: center; gap: 13px; padding: 22px; margin: 8px; border: 1px solid #ac7bd0; border-radius: 16px; background: #1d122cc7; transform: rotate(3deg); box-shadow: 8px 10px 0 #8a55b22b; }
.rb-hero-art > span { font: 700 17px monospace; color: #e3c5ff; }
.rb-hero-art b { display: flex; gap: 10px; align-items: center; font-size: .9rem; }
.rb-hero-art i { display: grid; place-items: center; width: 25px; height: 25px; color: #b0efd3; background: #204a42; border-radius: 6px; font-style: normal; }
.rb-hero-art b:nth-of-type(2) i { background: #5c2a42; color: #ffc4d0; }
.rb-hero-art small { font-size: .58rem; color: #c3a0e0; letter-spacing: .1em; }
.rb-app { border: 1px solid #65477d; border-radius: 18px; overflow: hidden; background: var(--rb-bg); }
.rb-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; padding: 14px; background: #30203f; border-bottom: 1px solid var(--rb-border); }
.rb-toolbar-history { display: flex; gap: 8px; }
.rb-end { margin-left: auto; }
.rb-status { min-height: 45px; margin: 0; padding: 12px 18px; background: #21162e; color: #debdff; font-size: .85rem; line-height: 1.5; overflow-wrap: anywhere; }
.rb-status.is-error { color: #ffd2db; background: #502038; }
.rb-origin { display: grid; grid-template-columns: minmax(220px,1fr) minmax(0,1fr); gap: 20px; padding: 16px 20px; background: #281c35; border-top: 1px solid #493154; border-bottom: 1px solid var(--rb-border); align-items: center; }
.rb-origin > div { display: flex; flex-direction: column; gap: 5px; overflow-wrap: anywhere; }
.rb-origin span { color: #cbb2dd; font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; }
.rb-origin code { color: #e6c2ff; font: 13px/1.6 Consolas,monospace; }
.rb-origin small { color: var(--rb-muted); font-size: .72rem; line-height: 1.6; }
.rb-layout { display: grid; grid-template-columns: minmax(0,1.25fr) minmax(350px,.85fr); align-items: start; }
.rb-controls { min-width: 0; }
.rb-tabs { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); border-bottom: 1px solid var(--rb-border); background: #24172f; padding: 12px 12px 0; gap: 5px; }
.rb-tabs button { border: 0; border-bottom: 3px solid transparent; border-radius: 8px 8px 0 0; min-height: 48px; padding: 10px 7px; background: transparent; color: #baa5cf; font-weight: 700; }
.rb-tabs button[aria-selected=true] { color: #f5e3ff; border-bottom-color: #c18bff; background: #49305f; }
.rb-tab-panel { padding: 22px; min-height: 650px; }
.rb-section-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.rb-section-head h2 { margin: 0; }
.rb-subtle { font-size: .72rem; color: #bda5d1; }
.rb-preset-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: end; }
.rb-note { color: var(--rb-muted); font-size: .79rem; line-height: 1.7; margin: 9px 0; overflow-wrap: anywhere; }
.rb-divider { padding-top: 20px; margin-top: 22px; border-top: 1px solid #493358; }
.rb-pill { border: 1px solid #75508d; background: #382346; border-radius: 30px; padding: 4px 9px; font: 11px/1.3 Consolas,monospace; color: #e0bafb; white-space: nowrap; }
.rb-row { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
.rb-row label:not(.rb-check) { flex: 1; min-width: 130px; }
.rb-row .rb-grow { flex: 3 !important; }
.rb-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.rb-details { padding-top: 15px; margin-top: 16px; border-top: 1px solid #533b64; }
.rb-details summary { font-weight: 600; cursor: pointer; font-size: .88rem; color: #e3c1ff; }
.rb-details[open] summary { margin-bottom: 15px; }
.rb-details p { font-size: .85rem; line-height: 1.75; color: #ccbadb; }
.rb-rule-entry { margin: 20px 0 15px; padding: 15px; background: #2c1d3a; border: 1px solid #66447e; border-radius: 11px; }
.rb-rule-entry .rb-actions { margin-top: 10px; }
.rb-rule-list { max-height: 285px; overflow: auto; scrollbar-color: #9164b7 #21152f; }
.rb-rule { display: grid; grid-template-columns: 65px minmax(0,1fr) auto; gap: 9px; align-items: center; padding: 10px 3px; border-bottom: 1px solid #3e2b4e; }
.rb-rule > code { font: 12px/1.5 Consolas,monospace; overflow-wrap: anywhere; }
.rb-rule > span { font-size: .72rem; }
.rb-rule button { min-height: 30px; padding: 5px 8px; font-size: .73rem; }
.rb-rule .rb-actions { gap: 5px; }
.rb-allowed { color: #a2ecd0; }
.rb-blocked { color: #ffc1cf; }
.rb-outside, .rb-invalid { color: #ffd69b; }
.rb-pager { display: flex; align-items: center; gap: 8px; justify-content: space-between; margin-top: 12px; font-size: .73rem; color: #b9a6cc; }
.rb-pager button { min-height: 30px; padding: 6px 9px; font-size: .72rem; }
.rb-preview { min-width: 0; padding: 22px; background: #251a33; border-left: 1px solid var(--rb-border); }
.rb-preview .rb-code { display: block; height: 340px; min-height: 180px; max-height: 80vh; resize: vertical; font: 13px/1.8 Consolas,'Courier New',monospace; tab-size: 2; background: #110c1b; border-color: #78548f; color: #e5cef9; padding: 17px; }
.rb-export-actions { margin: 14px 0 18px; }
.rb-export-actions button { flex: 1; }
.rb-metrics { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.rb-metric { padding: 12px; border: 1px solid #614577; background: #2e1e3c; border-radius: 10px; }
.rb-metric b { display: block; font-size: 1.35rem; color: #e0b7ff; }
.rb-metric span { color: #cbb4dc; font-size: .7rem; }
.rb-checks { padding-top: 20px; margin-top: 20px; border-top: 1px solid #533968; }
#rbIssues { max-height: 300px; overflow: auto; }
.rb-issue { display: grid; grid-template-columns: auto 1fr; gap: 8px; padding: 10px 0; border-bottom: 1px solid #43304f; align-items: start; }
.rb-issue button { min-height: 27px; padding: 5px 7px; font-size: .68rem; }
.rb-issue p { font-size: .77rem; color: #cbbbda; margin: 0; line-height: 1.65; }
.rb-issue[data-level=error] p { color: #ffc0d4; }
.rb-issue[data-level=warning] p { color: #f3d1a2; }
.rb-result-summary { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.rb-result-summary span { padding: 7px 11px; border-radius: 7px; background: #352246; font-size: .78rem; }
.rb-result-filter { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-bottom: 14px; }
.rb-result-filter label { flex: 1; }
.rb-results { max-height: 420px; overflow: auto; }
.rb-result { display: block !important; text-align: left; width: 100%; margin-bottom: 7px; background: #261a33 !important; }
.rb-result strong { font-size: .78rem; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.rb-result code { display: block; white-space: normal; overflow-wrap: anywhere; font: 12px/1.6 Consolas,monospace; color: #ead6fb; margin-top: 6px; }
.rb-result small { display: block; color: #bda8cd; margin-top: 4px; }
.rb-explanation { margin-top: 16px; padding: 17px; border: 1px solid #9670b2; border-radius: 12px; background: #382148; overflow-wrap: anywhere; }
.rb-explanation h3 { font-size: .95rem; }
.rb-explanation p, .rb-explanation li { font-size: .81rem; line-height: 1.7; }
.rb-explanation ul { padding-left: 18px; }
.rb-publish-card { padding: 20px; border: 1px solid #9672b0; background: #3c2650; border-radius: 12px; display: flex; flex-direction: column; gap: 12px; }
.rb-publish-card span { font-size: .7rem; letter-spacing: .1em; color: #d7b5f4; }
.rb-publish-card code { font: 14px/1.8 Consolas,monospace; overflow-wrap: anywhere; }
.rb-publish-card button { align-self: start; }
.rb-steps { padding-left: 24px; margin-top: 24px; }
.rb-steps li { margin-bottom: 22px; color: #ddc9ec; line-height: 1.65; font-size: .9rem; }
.rb-steps p { color: #c5b1d5; font-size: .83rem; margin: 7px 0 0; }
.rb-callout { background: #3c283c; border-left: 3px solid #e3b57c; padding: 17px; border-radius: 6px; }
.rb-callout p { color: #dcc6d4; font-size: .83rem; line-height: 1.7; margin: 8px 0 0; }
.rb-guide { margin: 28px 0; padding: 28px; background: #261a32; border: 1px solid #644575; border-radius: 18px; }
.rb-guide-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 24px; margin-top: 25px; }
.rb-guide h3 { font-size: 1rem; color: #e0bafa; }
.rb-guide p { line-height: 1.8; font-size: .88rem; color: #d0bddf; }
.rb-sources { display: flex; flex-wrap: wrap; gap: 12px 22px; font-size: .77rem; padding-top: 22px; margin-top: 20px; border-top: 1px solid #51365f; }
.rb-sources span { flex-basis: 100%; color: #bda6ce; }
.rb-sources a { color: #dab1ff; text-decoration: underline; }
.rb-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.rb-app:fullscreen { width: 100vw; height: 100dvh; overflow: auto; border-radius: 0; }
.rb-app:fullscreen .rb-tab-panel { min-height: 0; max-height: calc(100dvh - 260px); overflow: auto; }
.rb-app:fullscreen .rb-preview { max-height: calc(100dvh - 200px); overflow: auto; }
@media (max-width: 1100px) {
  .rb-layout { grid-template-columns: minmax(0,1fr) minmax(300px,.85fr); }
  .rb-tab-panel, .rb-preview { padding: 16px; }
  .rb-tabs { gap: 2px; padding-inline: 6px; }
  .rb-tabs button { font-size: .75rem; }
}
@media (max-width: 850px) {
  .rb-hero { grid-template-columns: 1fr; padding: 25px; }
  .rb-hero-art { display: none; }
  .rb-layout { grid-template-columns: 1fr; }
  .rb-preview { border-left: 0; border-top: 1px solid var(--rb-border); }
  .rb-tab-panel { min-height: 0; }
  .rb-origin { grid-template-columns: 1fr; gap: 12px; }
  .rb-guide-grid { grid-template-columns: 1fr; gap: 12px; }
  .rb-app:fullscreen .rb-tab-panel, .rb-app:fullscreen .rb-preview { max-height: none; overflow: visible; }
}
@media (max-width: 480px) {
  .rb-toolbar { padding: 10px; gap: 7px; }
  .rb-toolbar button, .rb-file { font-size: .74rem; padding: 8px 10px; }
  .rb-tabs button { font-size: .7rem; }
  .rb-preset-row { grid-template-columns: 1fr; }
  .rb-preset-row button { justify-self: start; }
  .rb-rule { grid-template-columns: 60px minmax(0,1fr); }
  .rb-rule .rb-actions { grid-column: 2; }
  .rb-row label:not(.rb-check) { flex-basis: 100%; }
  .rb-row > button { flex: 1; }
  .rb-metric { padding: 10px; }
  .rb-guide { padding: 20px; }
}
.rb-mobile-nav, .rb-mobile-back { display: none; }
#rbControls, #rbPreview, #rbSource { scroll-margin-top: 105px; }
#rbCompareCancel { margin-left: 8px; }
@media (max-width: 850px) {
  .rb-mobile-nav { display: flex; flex-wrap: wrap; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--rb-border); background: #32203f; }
  .rb-mobile-nav a, .rb-mobile-back { color: #e0b7ff; font-size: .8rem; text-decoration: underline; }
  .rb-mobile-back { display: inline-block; margin-bottom: 16px; }
}
