/* Shared surfaces for the public site and contract laboratory. */
.rg-home, .studio-page.light {
  --canvas: #f3f8f4;
  --sheet: #fff;
  --text: #11291e;
  --secondary-text: #485e53;
  --edge: #dce8df;
  --tint: #ebf5ee;
  --emerald: #057549;
  --button: #087d48;
  --button-text: #fff;
  --glass: #fffffff0;
  --mint-banner: radial-gradient(ellipse at 81% 40%, #b6f1d8, transparent 51%),
                 linear-gradient(118deg, #effbe8 0%, #e5f9e9 43%, #d2f3ed 100%);
  --elevation: 0 7px 24px -16px #123f2a35;
}
.rg-home.dark, .studio-page:not(.light) {
  --canvas: #0f1c16;
  --sheet: #192b22;
  --text: #f0faf4;
  --secondary-text: #b3c9b9;
  --edge: #344c3f;
  --tint: #213b2c;
  --emerald: #8be6b2;
  --button: #87e4aa;
  --button-text: #102c1b;
  --glass: #17291ff2;
  --mint-banner: radial-gradient(ellipse at 83% 42%, #1c614a, transparent 54%),
                 linear-gradient(118deg, #172d23, #173d2a 52%, #16453e);
  --elevation: 0 8px 26px -16px #0008;
}
.rg-home {
  --bg: var(--canvas); --paper: var(--sheet); --ink: var(--text);
  --green: var(--emerald); --on: var(--button-text); --muted: var(--secondary-text);
  --line: var(--edge); --soft: var(--tint);
  min-height: 100vh;
  background: radial-gradient(ellipse 70% 440px at 95% -45px, #78d8a529, transparent), var(--canvas);
}
.rg-home .site-bar, .rg-home main, .rg-home footer { width: min(calc(100% - 64px), 1216px); }
.rg-home .site-bar {
  top: 12px; max-width: none; margin: 16px auto; padding: 9px 12px; gap: 10px;
  flex-wrap: nowrap; border-radius: 22px; border: 1px solid var(--edge);
  background: var(--glass); backdrop-filter: blur(18px); box-shadow: var(--elevation); z-index: 8;
}
.rg-home .brand, .studio-page .nav .brand { letter-spacing: -.055em; font-weight: 740; }
.rg-home .brand { margin: 0 10px 0 0; display: inline-flex; align-items: center; gap: 9px; color: var(--text); font-size: 23px; }
.rg-home .brand .brand-mark, .studio-page .nav .brand .mark {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 13px; flex: none;
  color: #fff; background: linear-gradient(135deg, #41bb63, #087b54 63%, #0e928f);
  box-shadow: inset 0 1px 2px #ffffff80; font-size: 25px; line-height: 1;
}
.rg-home .brand .brand-mark { font-family: system-ui, sans-serif; }
.rg-home .site-bar nav, .bar-tools { display: flex; align-items: center; }
.rg-home .site-bar nav { margin: 0 auto 0 0; gap: 2px; }
.rg-home .site-bar nav a { padding: 8px 13px; font-size: 14px; font-weight: 600; color: var(--text); border-radius: 12px; }
.rg-home .site-bar nav a:hover { background: var(--tint); }
.bar-tools { gap: 6px; margin-left: auto; }
.rg-home .site-bar button { border: 0; min-height: 44px; padding: 0 14px; font-size: 14px; border-radius: 14px; }
.rg-home .quiet { background: var(--tint); color: var(--text); border-color: transparent; }
.rg-home .quiet:hover { box-shadow: inset 0 0 0 1px var(--emerald); }
.rg-home .primary, .rg-home .primary.cta { color: var(--button-text); background: var(--button); border-color: transparent; }
.rg-home .primary:hover { filter: brightness(.93); }
.rg-home #catalogOpen { gap: 7px; }
.rg-home .site-bar svg, .rg-home .hero-actions svg, .rg-arrow svg { width: 19px; height: 19px; flex: none; }
.rg-home .bar-tools .quiet { width: 44px; padding: 0; }
.rg-home #account { max-width: 22ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; padding: 0 21px; }
.rg-home main { max-width: none; margin: 0 auto; padding: 0; }
.rg-home .hero {
  position: relative; isolation: isolate; overflow: hidden; display: grid; grid-template-columns: 1.22fr 1fr;
  align-items: center; min-height: 438px; gap: 0; padding: 24px 2.3% 24px 5%;
  border: 1px solid var(--edge); border-radius: 32px; background: var(--mint-banner);
}
.rg-home .hero-copy { position: relative; z-index: 1; }
.hero-kind, .studio-page .mint-breadcrumb {
  display: inline-flex; align-items: center; gap: 8px; margin: 0; border-radius: 100px;
  background: var(--glass); color: var(--emerald); padding: 5px 12px; font-size: 13px; font-weight: 630;
}
.hero-kind i, .mint-breadcrumb i { width: 7px; height: 7px; border-radius: 100%; background: #16a757; }
.rg-home .hero h1 {
  margin: 22px 0 16px; color: var(--text); font-size: clamp(44px, 4.25vw, 64px);
  font-weight: 650; line-height: 1.04; letter-spacing: -.065em;
}
.rg-home .hero h1 em { color: var(--emerald); font-style: normal; }
.rg-home .hero .lead { color: var(--secondary-text); font-size: clamp(16px, 1.3vw, 19px); line-height: 1.5; max-width: 495px; margin: 0; }
.hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.rg-home .hero-actions a { display: inline-flex; align-items: center; justify-content: center; gap: 14px; border-radius: 15px; min-height: 48px; margin: 0; padding: 11px 19px; font-size: 15px; font-weight: 650; }
.secondary-cta { background: var(--glass); color: var(--text); }
.secondary-cta:hover { box-shadow: inset 0 0 0 1px var(--emerald); }
.hero-art { min-width: 0; position: relative; display: grid; align-content: center; justify-items: center; }
.hero-art::before {
  content: ""; position: absolute; width: 75%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, #a0f2b188 10%, #a4eee340 55%, transparent 72%); pointer-events: none;
}
.hero-art img { position: relative; display: block; width: min(100%, 560px); height: auto; transform: rotate(-3deg); filter: drop-shadow(0 14px 12px #0d704720); }
.tools-block { padding: 38px 0 40px; }
.rg-home .tools-block h2, .rg-home .section h2 { color: var(--text); margin: 0; font-size: clamp(29px, 3vw, 42px); font-weight: 650; line-height: 1.12; letter-spacing: -.055em; }
.rg-services { margin-top: 20px; display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; }
.rg-services a {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-end;
  min-width: 0; min-height: 175px; padding: 20px 23px; background: var(--sheet);
  border: 1px solid var(--edge); border-radius: 24px; box-shadow: var(--elevation);
  color: var(--text); transition: transform .2s, box-shadow .2s, border-color .2s;
}
.rg-services a:hover { transform: translateY(-3px); border-color: var(--emerald); box-shadow: 0 10px 25px -16px #035d4070; }
.rg-services img { display: block; width: 74px; height: 68px; object-fit: contain; object-position: left bottom; margin-bottom: 12px; }
.rg-services strong { color: var(--text); font-size: 21px; font-weight: 650; letter-spacing: -.045em; line-height: 1.25; }
.rg-services small { margin-top: 4px; color: var(--secondary-text); font-size: 14px; line-height: 1.4; }
.rg-arrow { position: absolute; top: 17px; right: 17px; width: 31px; height: 31px; display: grid; place-items: center; color: var(--secondary-text); border-radius: 50%; background: var(--tint); }
.rg-arrow svg { width: 14px; height: 14px; }
.rg-home .section { border-top: 1px solid var(--edge); padding: 36px 0; }
.rg-home .section-head { margin-bottom: 18px; gap: 8px 12px; }
.rg-home .section-head > div:first-child { margin-right: auto; }
.rg-home .section-head .pill { color: var(--secondary-text); font-size: 13px; font-weight: 550; padding: 5px 11px; }
.rg-home .section-head .muted { margin: 8px 0 0; }
.rg-home .card, .workflow-guide { border: 1px solid var(--edge); background: var(--sheet); border-radius: 22px; box-shadow: var(--elevation); }
.rg-home #guest { padding: clamp(22px, 3vw, 36px); }
.rg-home #guest h3 { font-size: clamp(21px, 2vw, 28px); }
.rg-home #demoNotice { border-left: 3px solid var(--emerald); padding-left: 10px; font-size: 14px; color: var(--secondary-text); }
.workflow-guide { margin: 0 0 12px; padding: 14px 18px; }
.workflow-guide ol { display: grid; grid-template-columns: repeat(4,1fr); list-style: none; gap: 16px; margin: 20px 0 4px; padding: 0; counter-reset: phase; }
.workflow-guide li { counter-increment: phase; padding-inline-start: 12px; border-inline-start: 2px solid var(--edge); }
.workflow-guide li::before { content: "0" counter(phase); color: var(--emerald); font-size: 13px; display: block; }
.workflow-guide li span { display: block; color: var(--secondary-text); font-size: 14px; }
.rg-home :is(input, textarea, select), .studio-page .panel :is(input, textarea, select) { border-radius: 12px; }
.rg-home :is(button, .cta) { border-radius: 13px; }
.rg-home .task-item.active { box-shadow: inset 3px 0 0 var(--emerald); }
.rg-home dialog { border-radius: 24px; box-shadow: 0 24px 90px #0d3c2838; }
.rg-home dialog::backdrop, .studio-page .lab17::backdrop { background: #10271c6e; backdrop-filter: blur(6px); }
.rg-home .rg-menu { width: min(1000px, calc(100% - 28px)); max-height: 87vh; padding: clamp(20px,3.6vw,42px); }
.rg-menu-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.rg-menu-head h2 { margin: 0; font-size: clamp(26px,3vw,38px); letter-spacing: -.05em; }
.rg-menu-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 24px; padding: 22px 0; }
.rg-menu-grid h3 { color: var(--secondary-text); font-size: 14px; font-weight: 600; }
.rg-menu-grid a { display: block; color: var(--text); border-bottom: 1px solid var(--edge); padding: 11px 0; }
.rg-menu-grid a:hover { color: var(--emerald); }
.rg-home footer { max-width: none; padding: 22px 0 32px; align-items: center; font-size: 13px; border-top: 1px solid var(--edge); }

/* The laboratory has a compact instrument rail and persistent route-specific tools. */
.studio-page { --nav-width: 220px; background: var(--canvas); }
.studio-page.light {
  --bg: var(--canvas); --surface: var(--sheet); --raised: var(--tint); --sidebar: var(--sheet); --field: #f5f9f6;
  --ink: var(--text); --muted: var(--secondary-text); --line: var(--edge); --green: var(--emerald); --primary: var(--button);
  --primary-ink: #fff; --rg-bg: var(--canvas); --rg-text: var(--text); --rg-muted: var(--secondary-text);
  --rg-surface: var(--sheet); --rg-raised: var(--tint); --rg-line: var(--edge); --rg-accent: var(--emerald);
  --rg-deep: #d5efdf; --rg-ink: #fff;
}
.studio-page > header { background: var(--glass); backdrop-filter: blur(16px); border: 1px solid var(--edge); border-radius: 19px; box-shadow: var(--elevation); }
.studio-page > header #theme .ui-icon { display: block; }
.studio-page .nav { background: var(--sheet); border-color: var(--edge); border-radius: 22px; box-shadow: var(--elevation); overflow-y: auto; }
.studio-page .nav .brand { padding-left: 4px; gap: 9px; }
.studio-page .nav .brand .mark { display: block; padding: 6px; border-radius: 11px; }
.studio-page .nav a[data-view] { min-height: 42px; border-radius: 13px; }
.studio-page .nav a[data-view].active { background: var(--tint); color: var(--emerald); box-shadow: inset 3px 0 var(--emerald); }
.studio-page .nav .workspace-label { color: var(--secondary-text); }
.studio-page main { padding: 22px clamp(16px, 2.1vw, 36px) 72px; }
.studio-page .page-heading {
  position: relative; display: grid; grid-template-columns: minmax(0,1fr) minmax(100px,21%); isolation: isolate;
  padding: clamp(22px,2.9vw,42px); border: 1px solid var(--edge); border-radius: 26px; gap: 17px 20px;
  background: var(--mint-banner); align-items: center; overflow: hidden;
}
.studio-page .page-title { grid-column: 1; min-width: 0; }
.studio-page .mint-breadcrumb { color: var(--emerald); padding: 4px 10px; margin: 0 0 10px; font-size: 12px; letter-spacing: 0; text-transform: none; }
.studio-page .page-heading h1 { color: var(--text); font-size: clamp(31px,3.25vw,51px); font-weight: 650; line-height: 1.07; letter-spacing: -.055em; margin: 0; }
.studio-page .page-heading p { margin: 8px 0 0; color: var(--secondary-text); font-size: 15px; line-height: 1.45; }
.studio-page .lab-hero-art {
  grid-column: 2; grid-row: 1/3; align-self: stretch; pointer-events: none;
  background: url('/tool-contract.webp') center / contain no-repeat;
  filter: drop-shadow(0 9px 10px #1d694124); min-height: 140px;
}
.studio-page main[data-view="sim"] .lab-hero-art { background-image: url('/tool-simulation.webp'); }
.studio-page main:is([data-view="quality"],[data-view="auditpanel"]) .lab-hero-art { background-image: url('/tool-laboratory.webp'); }
.studio-page .page-heading .viewtools { grid-column: 1; margin: 0; justify-content: flex-start; gap: 6px; }
.studio-page .viewtools button { border-radius: 12px; padding: 8px 13px; min-height: 38px; background: var(--glass); color: var(--text); }
.studio-page .viewtools #saveDraft { background: var(--button); color: var(--button-text); }
.studio-page .draft-status { color: var(--secondary-text); margin: 7px 4px 12px; }
.studio-page .overview { gap: 12px; margin: 14px 0; }
.studio-page .overview > div, .studio-page .overview > div + div { background: var(--sheet); border: 1px solid var(--edge); border-radius: 18px; box-shadow: var(--elevation); }
.studio-page .overview .status-title { background: var(--tint); }
.studio-page .overview strong { color: var(--text); }
.studio-page .overview .status-title strong { color: var(--emerald); }
.studio-page .steps { background: var(--sheet); padding: 15px 20px; border: 1px solid var(--edge); border-radius: 18px; }
.studio-page .layout { gap: 16px; }
.studio-page .panel, .studio-page .mint-flow-summary {
  background: var(--sheet); border: 1px solid var(--edge); border-radius: 22px; box-shadow: var(--elevation);
  padding: clamp(17px,1.9vw,28px);
}
.studio-page .panel h2, .studio-page .mint-flow-summary h2 { color: var(--text); font-size: clamp(20px,1.75vw,27px); letter-spacing: -.045em; }
.studio-page .panel button { border-radius: 12px; }
.studio-page .lab-search-dialog {
  width: min(590px, calc(100% - 28px)); max-height: min(78dvh, 650px); margin: auto;
  padding: clamp(17px, 3vw, 28px); border: 1px solid var(--edge); border-radius: 22px;
  background: var(--sheet); color: var(--text); box-shadow: 0 24px 80px #092f2333;
}
.lab-search-dialog::backdrop { background: #10271c70; backdrop-filter: blur(5px); }
.lab-search-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 15px; }
.lab-search-heading h2 { font-size: clamp(21px, 3vw, 28px); margin: 0; letter-spacing: -.035em; }
.lab-search-heading button { min-width: 40px; min-height: 40px; padding: 0; font-size: 23px; }
.lab-search-dialog input { width: 100%; min-height: 44px; padding: 9px 12px; border: 1px solid var(--edge); border-radius: 12px; background: var(--tint); color: var(--text); }
.lab-search-status, .lab-search-results h3 { color: var(--secondary-text); font-size: 14px; margin: 12px 0 4px; }
.lab-search-status:empty { margin: 0; }
.lab-search-results .rg-result svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.studio-page .lab17 { border-radius: 26px; padding: clamp(16px,2.5vw,32px); background: var(--sheet); }
.studio-page .lab17 .l17-head { background: var(--mint-banner); border-radius: 18px; padding: 20px 24px; }
.studio-page .l17-head small { color: var(--emerald); }
.studio-page .l17-head h2 { color: var(--text); font-size: clamp(25px,3vw,36px); font-weight: 650; letter-spacing: -.05em; }
.studio-page .l17-tabs { gap: 6px; border: 0; }
.studio-page .lab17 .l17-tabs button[aria-pressed="true"] { background: var(--button); color: var(--button-text); }
.studio-page :is(.l17-diagram,.l17-result,.l17-scroll) { border-radius: 14px; }
.rg-home :focus-visible, .studio-page :focus-visible { outline: 3px solid var(--emerald); outline-offset: 3px; }

@media (max-width: 1024px) {
  .rg-home .site-bar, .rg-home main, .rg-home footer { width: calc(100% - 40px); }
  .rg-home .hero { min-height: 370px; padding-left: 4%; }
  .rg-home .hero h1 { font-size: clamp(40px,5vw,52px); }
  .rg-services a { padding: 18px; }
  .studio-page { --nav-width: 185px; }
}
@media (max-width: 810px) {
  .rg-home .site-bar nav { display: none; }
  .rg-home .hero { grid-template-columns: 1.2fr 1fr; }
  .rg-services { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .studio-page .page-heading { padding: 22px; }
}
@media (min-width: 721px) and (max-width: 1080px) {
  .studio-page > header { height: auto; min-height: 54px; padding: 6px 10px; }
  .studio-page > header .topline { flex-wrap: nowrap; gap: 5px; }
  .studio-page > header .header-context, .studio-page > header .topsep, .studio-page > header #headerView { display: none; }
  .studio-page > header #theme, .studio-page > header #rgSettingsOpen { font-size: 0; gap: 0; min-width: 38px; padding-inline: 9px; }
}
@media (max-width: 720px) {
  .rg-home .hero { grid-template-columns: 1fr; padding: 28px 24px 8px; gap: 0; }
  .rg-home .hero h1 { font-size: clamp(39px,7.9vw,55px); margin: 16px 0 12px; }
  .rg-home .hero .lead { font-size: 16px; }
  .rg-home .hero-art { height: clamp(190px,44vw,255px); margin: 10px 0 4px; }
  .hero-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; transform: none; }
  .workflow-guide ol { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .rg-menu-grid { grid-template-columns: 1fr; gap: 12px; }
  .rg-home .section-head > div:first-child { flex-basis: 100%; }
  .studio-page > header { height: auto; min-height: 50px; flex-flow: row nowrap; align-items: center; justify-content: space-between; gap: 3px; padding: 5px 7px; }
  .studio-page > header .topline { width: auto; min-width: 0; flex: 0 1 auto; flex-wrap: nowrap; gap: 2px; }
  .studio-page > header .sandbox { display: none; }
  .studio-page > header .mint-mobile-brand { margin-right: 4px; }
  .studio-page > header :is(.rg-nav-button,#theme,#rgSettingsOpen,#rgAccountOpen) { width: 36px; height: 38px; min-height: 38px; padding: 0; gap: 0; flex: none; justify-content: center; }
  .studio-page > header :is(#theme,#rgSettingsOpen) { font-size: 0; }
  .studio-page > header #rgAccountOpen span { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
  .studio-page > header:has(#install:not([hidden])) { flex-wrap: wrap; }
  .studio-page .nav { overflow-x: auto; overflow-y: hidden; align-items: center; gap: 4px; padding: 5px; border-radius: 14px; }
  .studio-page .nav :is(a:not(.brand),button) { height: 40px; min-height: 40px; flex: 0 0 auto; white-space: nowrap; margin-block: 0; padding-block: 0; align-content: center; }
  .studio-page .nav a[data-view].active { box-shadow: inset 0 -2px var(--emerald); }
  .studio-page main { margin-left: 0; padding: 10px 12px 72px; }
  .studio-page .page-heading { grid-template-columns: minmax(0,1fr) 84px; padding: 18px; gap: 14px 6px; border-radius: 20px; }
  .studio-page .lab-hero-art { grid-row: 1; min-height: 80px; }
  .studio-page .page-heading .viewtools { grid-column: 1/-1; }
  .studio-page .overview { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; }
  .studio-page .overview > div, .studio-page .overview > div + div { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; padding: 10px; min-height: 70px; gap: 4px; }
  .studio-page .overview .metric { display: none; }
  .studio-page .overview small { font-size: 12px; }
  .studio-page .overview strong, .studio-page .overview .status-title strong { font-size: 16px; }
  .studio-page .lab17 .l17-head { padding: 16px; }
}
@media (max-width: 520px) {
  .rg-home .site-bar, .rg-home main, .rg-home footer { width: calc(100% - 24px); }
  .rg-home .site-bar { top: 6px; margin: 8px auto 12px; padding: 5px 7px; gap: 4px; border-radius: 17px; }
  .rg-home .brand { font-size: 18px; gap: 5px; margin: 0; }
  .rg-home .brand .brand-mark { width: 31px; height: 31px; border-radius: 10px; font-size: 21px; }
  .rg-home .site-bar button { min-height: 40px; }
  .rg-home #catalogOpen, .rg-home .bar-tools .quiet { width: 36px; padding: 0; background: transparent; }
  .rg-home #catalogOpen span { display: none; }
  .rg-home .bar-tools { gap: 0; }
  .rg-home #account { max-width: 15ch; font-size: 13px; padding: 0 12px; }
  .rg-home .hero { border-radius: 23px; padding-inline: 18px; }
  .rg-home .hero-actions { gap: 6px; margin-top: 18px; }
  .rg-home .hero-actions a { font-size: 14px; min-height: 44px; padding: 10px 12px; gap: 7px; }
  .rg-home .hero-actions svg { width: 16px; }
  .tools-block { padding: 26px 0; }
  .rg-services { margin-top: 14px; gap: 9px; }
  .rg-services a { min-height: 158px; padding: 14px 12px; border-radius: 18px; }
  .rg-services img { width: 57px; height: 51px; margin-bottom: 10px; }
  .rg-services strong { font-size: 18px; }
  .rg-services small { font-size: 13px; }
  .rg-arrow { width: 24px; height: 24px; top: 11px; right: 11px; }
  .rg-home footer { align-items: flex-start; }
  .studio-page .lab-hero-art { min-height: 64px; }
  .studio-page .page-heading h1 { font-size: clamp(28px,8vw,35px); }
  .studio-page .steps { padding: 12px 10px; }
}
@media (max-width: 360px) {
  .rg-home .brand { font-size: 16px; }
  .rg-home #account { max-width: 9ch; }
  .rg-home .hero-actions a { padding-inline: 9px; font-size: 13px; }
  .studio-page .page-heading { grid-template-columns: minmax(0,1fr) 55px; }
}
@media (prefers-reduced-motion: reduce) {
  .rg-services a { transition: none; }
  .rg-services a:hover { transform: none; }
}
