/* The shared Ron panel (Model Lab ML1a). Class prefix ron- only. Colours come from the --cl-* tokens in site.css, which is
   light only, so the panel is light only too (it follows the site; it has no dark colours of its own).
   Layout follows the width of the nearest .ron-host (container query), never a device name:
     host 1024px and wider: docked beside the page (open all the time)
     host 640px to 1023px:  slide-over from the right edge
     host under 640px:      bottom sheet with a peek bar
   Without a .ron-host the panel is docked. The page must leave room for: .ron-slot (the mount point; in a grid or flex row
   it should be a column about 360px wide when docked), and nothing else; the slide-over and sheet are position:fixed. */
.ron-host{container-name:ron-host;container-type:inline-size}
.ron-slot{min-width:0}
.ron-panel{
  --ron-bg:var(--cl-panel,#fff);--ron-text:var(--cl-ink,#111827);--ron-muted:var(--cl-text-muted,#334155);--ron-line:var(--cl-line,#c4cbd4);
  --ron-accent:var(--cl-orange,#ff5400);--ron-accent-text:var(--cl-orange-text,#b33c00);--ron-ink:var(--cl-ink,#111827);--ron-on-ink:var(--cl-on-ink,#fff);
  --ron-soft:var(--cl-surface,#f3f4f6);
  font-family:var(--cl-font-sans,system-ui,sans-serif);font-size:15px;line-height:1.5;color:var(--ron-text);box-sizing:border-box;
  background:var(--ron-bg);border:1px solid var(--ron-line);border-radius:var(--cl-radius-xl,8px);}

.ron-panel *,.ron-panel *::before,.ron-panel *::after{box-sizing:border-box}
.ron-dialog{display:flex;flex-direction:column;min-height:0;max-height:inherit}
.ron-head{display:flex;align-items:center;gap:10px;padding:12px 14px 4px}
.ron-mark{display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;border-radius:50%;background:var(--ron-ink);color:var(--cl-orange-on-ink,#ff965f);font-weight:800;flex:none}
.ron-name{margin:0;font-size:18px;flex:1}
.ron-status{margin:0;padding:0 14px 8px;color:var(--ron-muted);font-size:13px;min-height:2.6em;border-bottom:1px solid var(--ron-line)}
.ron-body{padding:12px 14px;overflow:auto;overscroll-behavior:contain;min-height:12rem;flex:1 1 auto}
.ron-disclaimer{margin:0;padding:10px 14px calc(10px + env(safe-area-inset-bottom,0px));border-top:1px solid var(--ron-line);color:var(--ron-muted);font-size:12px}
.ron-peek,.ron-close{display:none}
/* The peek bar and pill: white on the ink colour. The selector is .ron-panel .ron-peek so it beats .ron-panel button{color:inherit},
   which left the label dark on dark (only the orange R mark showed). */
.ron-panel .ron-peek{background:var(--ron-ink);color:var(--ron-on-ink);border:1px solid var(--ron-ink);font-weight:700}
.ron-peek-label{color:var(--ron-on-ink);font-weight:700}
.ron-panel button{font:inherit;min-height:44px;cursor:pointer;color:inherit}
.ron-panel button:focus-visible{outline:3px solid var(--ron-accent);outline-offset:2px}
.ron-message{border:1px solid var(--ron-line);border-radius:var(--cl-radius-lg,7px);padding:12px;margin:0 0 12px;background:var(--ron-soft);overflow-wrap:anywhere}
.ron-sample{display:inline-block;margin-bottom:6px;padding:2px 8px;border:1px solid var(--ron-accent-text);color:var(--ron-accent-text);border-radius:999px;font-size:12px;font-weight:700;text-transform:uppercase;letter-spacing:.5px}
.ron-headline{margin:0 0 8px;font-size:17px;line-height:1.3}
.ron-section{margin:0 0 10px}
.ron-section p,.ron-section ul,.ron-section ol{margin:0}
.ron-section-title{margin:0 0 2px;font-size:13px;text-transform:uppercase;letter-spacing:.5px;color:var(--ron-muted)}
.ron-top-list{padding-left:20px}
.ron-top-list li{margin-bottom:6px}
.ron-reason{display:block;color:var(--ron-muted)}
.ron-links{margin:0 0 8px;display:flex;flex-wrap:wrap;gap:6px}
.ron-link{background:transparent;border:0;padding:0 4px;min-width:44px;text-decoration:underline;text-underline-offset:3px;font-weight:700;color:var(--ron-accent-text)}
.ron-meta,.ron-made{margin:6px 0 0;font-size:12px;color:var(--ron-muted)}
.ron-opinion{margin:10px 0 0;padding-top:8px;border-top:1px dashed var(--ron-line);font-size:12px;font-style:italic;color:var(--ron-muted)}
.ron-banner{margin:0 0 10px;padding:8px 10px;border-left:4px solid var(--ron-accent);background:var(--ron-soft);font-size:13px}
.ron-questions{display:flex;flex-direction:column;gap:8px}
.ron-question,.ron-retry,.ron-apply{background:var(--ron-bg);border:1px solid var(--ron-line);border-radius:var(--cl-radius-sm,5px);padding:8px 12px;text-align:left}
.ron-question[aria-disabled="true"]{opacity:.6;cursor:progress}
.ron-question[disabled]{opacity:.5;cursor:not-allowed}
.ron-questions-note{margin:0;font-size:13px;color:var(--ron-muted)}
.ron-retry,.ron-apply{background:var(--ron-ink);color:var(--ron-on-ink);border-color:var(--ron-ink);font-weight:700;margin-top:8px}
.ron-suggestion{margin:8px 0;padding:8px;border:1px solid var(--ron-line);border-radius:var(--cl-radius-sm,5px)}

/* docked (default) */
.ron-panel{position:sticky;top:12px;max-height:calc(100dvh - 24px);display:flex;flex-direction:column}

/* slide-over: tablet portrait and any narrow host */
@container ron-host (max-width:1023px){
  .ron-panel{position:fixed;top:0;right:0;bottom:0;width:min(380px,92vw);max-height:none;border-radius:0;border-width:0 0 0 1px;z-index:40;visibility:visible}
  .ron-panel[data-open="false"]{transform:translateX(100%)}
  .ron-panel[data-open="false"] .ron-dialog{visibility:hidden}
  /* a small pill tucked at the bottom right, above the safe area (when the panel is closed it sits just left of the screen edge) */
  .ron-panel .ron-peek{display:inline-flex;align-items:center;gap:6px;position:absolute;left:-92px;bottom:calc(12px + env(safe-area-inset-bottom,0px));min-width:80px;min-height:44px;padding:0 12px 0 8px;border-radius:999px;box-shadow:0 2px 8px #0003}
  .ron-panel[data-open="true"] .ron-peek{display:none}
  .ron-close{display:inline-flex;align-items:center;justify-content:center;min-width:44px;padding:0 10px;background:var(--ron-bg);border:1px solid var(--ron-line);border-radius:var(--cl-radius-sm,5px)}
  .ron-panel{padding-top:env(safe-area-inset-top,0px)}
}
/* bottom sheet: phones */
@container ron-host (max-width:639px){
  .ron-panel{top:auto;left:0;right:0;width:auto;height:min(80dvh,640px);border-width:1px 0 0;border-radius:12px 12px 0 0;padding-top:0;padding-left:env(safe-area-inset-left,0px);padding-right:env(safe-area-inset-right,0px)}
  .ron-panel[data-open="false"]{transform:translateY(calc(100% - 56px))}
  .ron-panel[data-open="false"] .ron-dialog{visibility:hidden}
  .ron-panel .ron-peek{display:flex;position:static;width:100%;box-shadow:none;min-height:56px;border-radius:12px 12px 0 0;justify-content:flex-start;padding:0 16px}
  .ron-panel[data-open="true"] .ron-peek{display:flex}
  .ron-dialog{flex:1 1 auto}
}
@media (prefers-reduced-motion:no-preference){
  .ron-panel{transition:transform .2s ease}
}
