/* R33: a scoped refinement of the live MineBrush card, never a replacement shell. */
/* Native checked-radio ID selectors set display:block in list mode.
   Keep the scoped card container a grid so its 14px row gaps remain effective. */
[data-r33-grid] { display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; align-items: stretch; }
.r33-view-switch { display: inline-flex; align-items: center; flex: 0 0 auto; gap: 2px; margin: 0; padding: 3px; border: 0; border-radius: 7px; background: #e9edf3; }
.r33-view-switch button { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; min-height: 44px; margin: 0; padding: 0; border: 0; border-radius: 5px; background: transparent; color: #7a8798; cursor: pointer; }
.r33-view-switch button:hover { color: #304864; background: #ffffff66; }
.r33-view-switch button[aria-pressed="true"] { color: #34465e; background: #fff; box-shadow: 0 1px 4px #25395510; }
.r33-view-switch button:focus-visible { outline: 3px solid #7aa6ff; outline-offset: 2px; }
.r33-view-switch svg { display: block; width: 18px; height: 18px; }
.r33-view-switch[hidden] { display: none; }
.mb-results-toolbar:has(.r33-view-switch:not([hidden])) > .mb-sort-status { margin-left: auto; margin-right: 16px; }
.r33-card { --r33-accent: #145ff5; --r33-panel: #f5f8fe; --r33-line: #e0e6ef; box-sizing: border-box; display: flex; flex-direction: column; min-width: 0; margin: 0; padding: 0; overflow: hidden; border: 1px solid #dde4ed; border-radius: 10px; color: #18202e; background: #fff; box-shadow: 0 2px 5px #18202e04; font-family: inherit; text-align: left; transition: border-color .15s ease, box-shadow .15s ease; }
.r33-card[data-edition="bedrock"] { --r33-accent: #087a63; --r33-panel: #f2f9f6; }
.r33-card:hover { border-color: #b8c8dc; box-shadow: 0 4px 14px #18202e09; }
.r33-card[id] { scroll-margin-top: 96px; }
.r33-card *, .r33-dialog *, .r33-auth * { box-sizing: border-box; }
.r33-card button, .r33-dialog button, .r33-auth button { font: inherit; cursor: pointer; }
.r33-card :focus-visible, .r33-dialog :focus-visible, .r33-auth :focus-visible { outline: 3px solid #7aa6ff; outline-offset: 3px; }
.r33-icon { display: inline-block; flex: 0 0 18px; width: 18px; height: 18px; vertical-align: middle; }
.r33-media { position: relative; flex: 0 0 auto; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; background: #071922; }
.r33-image { display: block; width: 100%; height: 100%; padding: 0; border: 0; border-radius: 0; background: #071922; color: #b9c6d0; }
.r33-image img { display: block; width: 100%; height: 100%; max-width: 100%; margin: 0; object-fit: cover; }
.r33-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 100%; color: #bdcbd5; background: #071922; font-size: 12px; line-height: 1.5; }
.r33-placeholder .r33-icon { width: 30px; height: 30px; }
.r33-image:focus-visible { outline-offset: -5px; }
.r33-kind { position: absolute; top: 12px; left: 12px; max-width: calc(100% - 78px); padding: 5px 7px; border: 1px solid #ffffff22; border-radius: 4px; color: #fff; background: #071923e8; font-size: 9px; font-weight: 750; line-height: 1.4; letter-spacing: .015em; text-transform: uppercase; pointer-events: none; }
.r33-save { position: absolute; top: 8px; right: 8px; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; min-height: 44px; margin: 0; padding: 0; border: 1px solid #ffffff3d; border-radius: 7px; color: #fff; background: #071923e8; box-shadow: 0 1px 5px #00000020; }
.r33-save:hover { color: #fff; background: #16394de8; border-color: #ffffff7d; }
.r33-save[aria-pressed="true"] { color: #fff; background: #145ff5; border-color: #ffffff9c; }
.r33-save[aria-pressed="true"] .r33-icon { fill: #ffffff2e; }
.r33-save:disabled { cursor: wait; opacity: .7; }
.r33-body { display: flex; flex-direction: column; flex: 1; min-width: 0; padding: 14px 16px 0; }
.r33-titleline { display: flex; align-items: baseline; gap: 10px; min-width: 0; min-height: 52px; }
.r33-title { flex: 1; min-width: 0; margin: 0; padding: 0; color: #18202e; font-size: 20px; font-weight: 700; line-height: 1.3; letter-spacing: -.4px; }
.r33-title > a { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: inherit; font: inherit; line-height: inherit; text-decoration: none; overflow-wrap: anywhere; }
.r33-title > a:hover { color: #145ff5; text-decoration: none; }
.r33-version { flex: 0 0 auto; max-width: 75px; color: #687588; font-size: 10px; line-height: 1.45; overflow-wrap: anywhere; }
.r33-meta { display: block; min-width: 0; margin: 5px 0 0; color: #647186; font-size: 11px; line-height: 18px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.r33-description { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 10px 0 0; min-height: 42px; color: #5c6a7e; font-size: 13px; line-height: 21px; }
.r33-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 10px 0; padding: 0; border: 1px solid var(--r33-line); border-radius: 6px; background: var(--r33-panel); overflow: hidden; }
.r33-fact { min-width: 0; margin: 0; padding: 6px 9px; border: 0; }
.r33-fact:not(.r33-fact--primary):not(.r33-fact--wide) + .r33-fact:not(.r33-fact--wide) { border-left: 1px solid var(--r33-line); }
.r33-fact dt { margin: 0 0 2px; color: #687588; font-size: 10px; font-weight: 400; line-height: 15px; }
.r33-fact dd { min-width: 0; margin: 0; color: #34465e; font-size: 12px; font-weight: 600; line-height: 17px; overflow-wrap: anywhere; }
.r33-fact--primary { grid-column: 1 / -1; display: grid; grid-template-columns: 68px minmax(0, 1fr); gap: 8px; align-items: start; min-height: 31px; padding-top: 6px; padding-bottom: 6px; border-bottom: 1px solid var(--r33-line); }
.r33-fact--primary dt { padding-top: 1px; margin: 0; }
.r33-fact--wide { grid-column: 1 / -1; display: grid; grid-template-columns: 68px minmax(0, 1fr); gap: 8px; align-items: center; min-height: 36px; border-top: 1px solid var(--r33-line); }
.r33-fact--primary + .r33-fact--wide { border-top: 0; }
.r33-fact--wide dt { margin: 0; }
.r33-fact--wide dd { display: flex; align-items: center; gap: 5px; }
.r33-fact--wide dd code { min-width: 0; flex: 1; font: 11px/1.65 Consolas, "Cascadia Code", monospace; color: #34465e; overflow-wrap: anywhere; }
.r33-fact--wide + .r33-fact { grid-column: 1 / -1; display: grid; grid-template-columns: 68px minmax(0, 1fr); gap: 8px; align-items: start; border-top: 1px solid var(--r33-line); }
.r33-fact--wide + .r33-fact dt { margin: 0; }
.r33-copy { flex: 0 0 44px; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; min-height: 44px; margin: -6px 0; padding: 0; border: 0; border-radius: 5px; background: transparent; color: #486584; }
.r33-copy:hover { color: #145ff5; background: #145ff50c; }
.r33-copy .r33-icon { width: 15px; height: 15px; }
.r33-warning { display: flex; align-items: flex-start; gap: 6px; margin: 0 0 10px; padding: 7px 8px; border-radius: 5px; background: #fff7e8; color: #7c602f; font-size: 10.5px; line-height: 1.5; }
.r33-warning .r33-icon { width: 13px; height: 13px; flex-basis: 13px; margin-top: 1px; }
.r33-context { margin: 0 0 10px; color: #5c6a7e; font-size: 11px; line-height: 17px; overflow-wrap: anywhere; }
.r33-context p { margin: 0; }
.r33-context p + p { margin-top: 4px; }
.r33-context p > span { font-weight: 600; color: #34465e; margin-right: 4px; }
.r33-history-note { display: flex; gap: 5px; align-items: flex-start; }
.r33-history-note .r33-icon { flex-basis: 13px; width: 13px; height: 13px; margin-top: 2px; }
.r33-card[data-update-variant] .r33-fact--primary { grid-template-columns: 90px minmax(0,1fr); }
.r33-facts--workflow { grid-template-columns: 1fr; }
.r33-facts--workflow > .r33-fact { display: grid; grid-template-columns: 68px minmax(0,1fr); gap: 8px; border: 0 !important; }
.r33-facts--workflow > .r33-fact + .r33-fact { border-top: 1px solid var(--r33-line) !important; }
.r33-facts--workflow dt { margin: 0; }
.r33-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding: 1px 0; min-height: 47px; border-top: 1px solid #e8edf3; }
.r33-more, .r33-cta { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; margin: 0; padding: 7px 0; border: 0; border-radius: 4px; background: transparent; font-size: 12px; line-height: 1.4; text-decoration: none; }
.r33-more { min-width: 44px; color: #65748a; font-weight: 400; }
.r33-more:hover { color: #18202e; background: transparent; }
.r33-cta { color: #145ff5; font-weight: 700; text-align: right; }
.r33-cta:hover { color: #104fd0; text-decoration: none; }
.r33-cta .r33-icon, .r33-more .r33-icon { width: 14px; height: 14px; flex-basis: 14px; }

/* The existing page chooses grid/list; the refinement stays inside that region. */
[data-r33-grid][data-r33-view="list"] { grid-template-columns: 1fr; gap: 14px; }
[data-r33-grid][data-r33-view="list"] .r33-card { display: grid; grid-template-columns: 224px minmax(0, 1fr); align-items: start; }
[data-r33-grid][data-r33-view="list"] .r33-media { width: calc(100% - 14px); margin: 14px 0 14px 14px; border-radius: 6px; }
[data-r33-grid][data-r33-view="list"] .r33-body { padding-top: 15px; }
[data-r33-grid][data-r33-view="list"] .r33-titleline { min-height: 0; }
[data-r33-grid][data-r33-view="list"] .r33-description { min-height: 0; margin-top: 8px; }

.r33-dialog, .r33-auth { box-sizing: border-box; width: min(720px, calc(100vw - 32px)); max-height: calc(100dvh - 40px); margin: auto; padding: 0; overflow: auto; border: 1px solid #d6e0ec; border-radius: 12px; background: #fff; color: #18202e; box-shadow: 0 20px 90px #10213c55; font-family: inherit; }
.r33-dialog::backdrop, .r33-auth::backdrop { background: #10213c91; backdrop-filter: blur(2px); }
.r33-close { position: absolute; right: 12px; top: 12px; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; min-height: 44px; margin: 0; padding: 0; border: 1px solid #dce4ee; border-radius: 7px; background: #fff; color: #56677f; }
.r33-close:hover { background: #f3f7fc; color: #145ff5; }
.r33-dialog-content { padding: 30px; }
.r33-dialog-content > h2 { margin: 0 48px 12px 0; color: #18202e; font-size: 26px; line-height: 1.25; font-weight: 700; letter-spacing: -.5px; overflow-wrap: anywhere; }
.r33-dialog-content > p { margin: 0 0 16px; color: #5c6d83; font-size: 13px; line-height: 1.75; }
.r33-dialog-content .r33-dialog-kind { margin: 0 48px 7px 0; color: #145ff5; font-size: 10px; line-height: 1.5; font-weight: 750; letter-spacing: .035em; text-transform: uppercase; }
.r33-dialog-content .r33-detail-meta { margin-bottom: 14px; color: #65748a; font-size: 11.5px; }
.r33-dialog-content .r33-demo-note { margin: 18px 0 0; padding: 11px 13px; border: 1px solid #e0e7f0; border-radius: 6px; color: #60718a; background: #f3f6fa; font-size: 11.5px; line-height: 1.65; }
.r33-dialog-content .r33-source-note { color: #65748a; font-size: 12px; }
.r33-copy-panel { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; margin: 14px 0; padding: 10px 14px; border: 1px solid #dce5f1; border-radius: 7px; background: #f4f7fc; }
.r33-copy-panel code { min-width: 0; color: #34465e; font: 12px/1.7 Consolas, monospace; overflow-wrap: anywhere; }
.r33-copy-panel .r33-more { flex: 0 0 auto; color: #145ff5; }
.r33-source-links { display: flex; flex-wrap: wrap; gap: 0 18px; margin: 8px 0; }
.r33-source-links > a { display: inline-flex; align-items: center; min-height: 44px; color: #145ff5; font-size: 12px; font-weight: 600; text-decoration: none; }
.r33-source-links > a:hover { text-decoration: underline; }
.r33-allfacts { margin: 20px 0; padding: 0; border-top: 1px solid #e1e7ef; }
.r33-allfacts > div { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 20px; padding: 11px 0; border-bottom: 1px solid #e9edf3; }
.r33-allfacts dt { margin: 0; color: #687588; font-size: 12px; line-height: 1.6; }
.r33-allfacts dd { min-width: 0; margin: 0; color: #34465e; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.r33-allfacts code { font: 12px/1.6 Consolas, monospace; }
.r33-dialog-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 22px; padding-top: 18px; border-top: 1px solid #e1e7ef; }
.r33-dialog-actions > a, .r33-dialog-actions > button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 10px 16px; border: 1px solid #d6e0ec; border-radius: 7px; background: #fff; color: #3b5578; font-size: 12px; font-weight: 600; text-decoration: none; }
.r33-dialog-actions > a:first-child { margin-right: auto; border-color: #145ff5; background: #145ff5; color: #fff; }
.r33-dialog-actions > .r33-cta { border-color: #145ff5; background: #145ff5; color: #fff; }
.r33-dialog-actions > a:hover, .r33-dialog-actions > button:hover { filter: brightness(.96); text-decoration: none; }
.r33-auth { width: min(460px, calc(100vw - 32px)); }
.r33-auth .r33-dialog-content { padding-top: 60px; }
.r33-toast { position: fixed; left: 50%; bottom: 22px; z-index: 10000; transform: translateX(-50%); box-sizing: border-box; max-width: min(520px, calc(100vw - 32px)); padding: 13px 18px; border-radius: 8px; background: #172b48; color: #fff; box-shadow: 0 6px 24px #10213c30; font-size: 13px; line-height: 1.5; }
.r33-toast:empty { display: none; }
.r33-empty { grid-column: 1 / -1; padding: 44px 24px; border: 1px dashed #c7d3e3; border-radius: 10px; background: #fff; color: #5f7088; text-align: center; }
.r33-empty h2 { margin: 0 0 10px; color: #233b5a; font-size: 23px; }
.r33-empty p { margin: 0; font-size: 14px; }

@media (min-width: 1100px) {
  [data-r33-grid][data-r33-view="list"] .r33-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr) auto auto auto; gap: 0 24px; min-height: 0; }
  [data-r33-grid][data-r33-view="list"] .r33-titleline { grid-column: 1; grid-row: 1; }
  [data-r33-grid][data-r33-view="list"] .r33-meta { grid-column: 1; grid-row: 2; }
  [data-r33-grid][data-r33-view="list"] .r33-description { grid-column: 1; grid-row: 3; align-self: start; margin-bottom: 12px; }
  [data-r33-grid][data-r33-view="list"] .r33-facts { grid-column: 2; grid-row: 1 / span 3; align-self: start; margin: 0 0 12px; }
  [data-r33-grid][data-r33-view="list"] .r33-context { grid-column: 1 / -1; grid-row: 4; }
  [data-r33-grid][data-r33-view="list"] .r33-warning { grid-column: 1 / -1; grid-row: 5; }
  [data-r33-grid][data-r33-view="list"] .r33-footer { grid-column: 1 / -1; grid-row: 6; }
}
@media (max-width: 1180px) {
  [data-r33-grid] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .r33-card[id] { scroll-margin-top: 160px; }
  [data-r33-grid] { grid-template-columns: 1fr; gap: 18px; }
  .r33-title { font-size: 19px; }
  .r33-titleline { min-height: 0; }
  .r33-body { padding-top: 14px; }
  .r33-description { min-height: 0; }
  [data-r33-grid][data-r33-view="list"] .r33-card { grid-template-columns: 108px minmax(0, 1fr); gap: 0 12px; }
  [data-r33-grid][data-r33-view="list"] .r33-media { grid-column: 1; grid-row: 1 / span 2; width: 94px; margin: 14px 0 0 14px; border-radius: 6px; aspect-ratio: 1; }
  [data-r33-grid][data-r33-view="list"] .r33-body { display: contents; }
  [data-r33-grid][data-r33-view="list"] .r33-titleline { grid-column: 2; grid-row: 1; align-self: end; padding-right: 14px; margin-top: 14px; gap: 6px; }
  [data-r33-grid][data-r33-view="list"] .r33-title { font-size: 18px; }
  [data-r33-grid][data-r33-view="list"] .r33-version { max-width: 52px; font-size: 9px; }
  [data-r33-grid][data-r33-view="list"] .r33-meta { grid-column: 2; grid-row: 2; align-self: start; padding-right: 14px; margin-top: 5px; }
  [data-r33-grid][data-r33-view="list"] .r33-description { grid-column: 1 / -1; margin: 12px 16px 0; }
  [data-r33-grid][data-r33-view="list"] .r33-facts { grid-column: 1 / -1; margin: 10px 16px; }
  [data-r33-grid][data-r33-view="list"] .r33-warning { grid-column: 1 / -1; margin: 0 16px 10px; }
  [data-r33-grid][data-r33-view="list"] .r33-context { grid-column: 1 / -1; margin: 0 16px 10px; }
  [data-r33-grid][data-r33-view="list"] .r33-footer { grid-column: 1 / -1; margin: 0 16px; }
  [data-r33-grid][data-r33-view="list"] .r33-kind { top: auto; bottom: 5px; left: 5px; max-width: calc(100% - 10px); padding: 3px 4px; font-size: 8px; line-height: 1.3; }
  [data-r33-grid][data-r33-view="list"] .r33-save { top: 4px; right: 4px; }
  .mb-results-toolbar:has(.r33-view-switch:not([hidden])) { flex-wrap: wrap; gap: 12px; }
  .mb-results-toolbar:has(.r33-view-switch:not([hidden])) > * { min-width: 0; }
  .r33-view-switch { margin-left: auto; }
  .r33-dialog, .r33-auth { width: calc(100vw - 24px); max-height: calc(100dvh - 24px); }
  .r33-dialog-content { padding: 24px 20px; }
  .r33-dialog-content > h2 { font-size: 23px; }
  .r33-allfacts > div { grid-template-columns: 96px minmax(0, 1fr); gap: 12px; }
  .r33-dialog-actions > a:first-child { flex-basis: 100%; margin-right: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .r33-card { transition: none; }
}
