/* One frame for native Free Tools and the retained diagnostic tools. */
.free-tool-shell {
  --free-tool-gutter: clamp(16px, 3vw, 32px);
  --free-tool-sticky-top: 16px;
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  background: #fff;
  color: #182238;
  font-family: Inter, Arial, sans-serif;
}
.free-tool-shell,
.free-tool-shell * { box-sizing: border-box; }
.free-tool-shell > :is(.theralab-chrome-header-host, .theralab-chrome-footer-host, .theralab-public-shell, .free-tool-footer-shell) { flex: 0 0 auto; }

.free-tool-shell > .skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 100;
  padding: 12px;
  border: 2px solid #304fc1;
  background: #fff;
  color: #304fc1;
}
.free-tool-shell > .skip-link:focus { top: 12px; }

.free-tool-scroll {
  position: relative;
  isolation: isolate;
  z-index: 0;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior-y: contain;
  scrollbar-gutter: stable;
  scroll-padding-top: var(--free-tool-sticky-top);
  background: #f6f8fc;
}
.free-tool-scroll:focus-visible { outline: 2px solid #304fc1; outline-offset: -2px; }

.free-tool-shell .free-tool-main {
  width: calc(100% - 2 * var(--free-tool-gutter));
  max-width: 768px;
  min-width: 0;
  min-height: 0;
  margin-inline: auto;
  padding: 20px 0 40px;
}
.free-tool-shell .free-tool-main--wide { max-width: 1200px; }

.free-tool-shell .free-tool-back {
  display: flex;
  margin: 0 0 12px;
  padding: 0;
}
.free-tool-shell .free-tool-back a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  justify-content: center;
  padding: 10px 18px;
  border: 1px solid #3057ed;
  border-radius: 9px;
  background: #3057ed;
  color: #fff;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.4;
  text-decoration: none;
}
.free-tool-shell .free-tool-back a:hover { background: #2947bc; border-color: #2947bc; text-decoration: none; }
.free-tool-shell .free-tool-back a:focus-visible { outline: 3px solid #304fc1; outline-offset: 3px; }

.free-tool-shell .free-tool-intro,
.free-tool-shell .free-tool-diagnostic-content > .page-head {
  display: block;
  max-width: none;
  margin: 0 0 20px;
  padding: 0;
  text-align: left;
}
.free-tool-shell .free-tool-intro h1,
.free-tool-shell .free-tool-diagnostic-content > .page-head h1,
.free-tool-shell .free-tool-diagnostic-content > h1 {
  max-width: none;
  margin: 0;
  color: #182238;
  font-size: 30px;
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: -.02em;
  overflow-wrap: anywhere;
}
.free-tool-shell .free-tool-access,
.free-tool-shell .free-tool-diagnostic-content > .page-head .eyebrow {
  margin: 0 0 6px;
  color: #626b7b;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0;
  text-transform: none;
}
.free-tool-shell .free-tool-description,
.free-tool-shell .free-tool-diagnostic-content > .page-head .intro {
  max-width: 68ch;
  margin: 10px 0 0;
  color: #626b7b;
  font-size: 16px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.free-tool-shell .free-tool-note {
  max-width: 72ch;
  margin: 10px 0 0;
  color: #626b7b;
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.free-tool-workspace { width: 100%; min-width: 0; text-align: left; container-type: inline-size; container-name: free-tool; }
.free-tool-links { display: flex; flex-wrap: wrap; gap: 12px 24px; margin-top: 20px; }
.free-tool-workspace > .recovered-tool-frame { display: block; width: 100%; height: 640px; border: 0; background: transparent; }
.free-tool-shell .free-tool-workspace > .units-calculator { width: 100%; max-width: none; margin: 0; }
.free-tool-shell .units-calculator input { max-width: 14rem; }
.free-tool-shell .units-times { max-width: 30rem; }
.free-tool-shell .units-calculator :is(.units-hint, .units-boundary) { max-width: 68ch; }
.free-tool-shell .free-tool-workspace > .equipment-library { margin-top: 0; }

/* Diagnostic inputs, reports, access checks and saved state remain in their existing main. */
.free-tool-shell .free-tool-diagnostic-content {
  width: 100%;
  max-width: none;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
}
.free-tool-shell .free-tool-diagnostic-content > a[href="/free#diagnostics"] { display: none; }
.free-tool-shell .free-tool-diagnostic-access { margin-bottom: 10px; }
.free-tool-shell .free-tool-diagnostic-content .purpose-label { margin-top: 12px; }
.free-tool-shell .free-tool-diagnostic-content .purpose-label + .intro { margin-top: 6px; }
.free-tool-shell .free-tool-diagnostic-content .back { min-height: 44px; margin: 0 0 12px; display: inline-flex; align-items: center; }
.free-tool-shell .free-tool-diagnostic-content .guide { top: var(--free-tool-sticky-top); }
.free-tool-shell .free-tool-diagnostic-note { margin-top: 24px; }

@media (max-width: 600px) {
  .free-tool-shell { --free-tool-gutter: 16px; }
  .free-tool-shell .free-tool-main { padding-block: 16px 32px; }
  .free-tool-shell .free-tool-intro,
  .free-tool-shell .free-tool-diagnostic-content > .page-head { margin-bottom: 20px; }
  .free-tool-shell .free-tool-intro h1,
  .free-tool-shell .free-tool-diagnostic-content > .page-head h1,
  .free-tool-shell .free-tool-diagnostic-content > h1 { font-size: 28px; }
}

@media print {
  .free-tool-shell,
  .free-tool-scroll { display: block !important; height: auto !important; max-height: none !important; overflow: visible !important; }
  .free-tool-shell > :is(.theralab-chrome-header-host, .theralab-chrome-footer-host, .theralab-public-shell, .free-tool-footer-shell, .skip-link),
  .free-tool-shell .free-tool-back { display: none !important; }
  .free-tool-shell .free-tool-main { width: 100%; max-width: none; margin: 0; padding: 0; }
  .free-tool-shell .free-tool-intro { display: block; margin-bottom: 20px; }
  .free-tool-shell .free-tool-intro h1 { font-size: 24px; }
}

/* Approved fixed shell; bounded product workspace and existing account controls. */
.free-tool-shell .tl-workspace { padding: 0; }
.free-tool-shell .tl-content { max-width: none; min-height: 100%; }
.free-tool-shell .tl-theralab-brand { border: 0; border-radius: 0; background: transparent; color: #17233e; }
.free-tool-shell .tl-top-link { border: 0; border-radius: 0; background: transparent; color: #17233e; padding: 9px 1px; }
.free-tool-shell .tl-nav-button { border: 0; background: transparent; color: #405679; font-size: 14px; gap: 0; min-height: 44px; padding: 10px 12px; }
.free-tool-shell .tl-nav-button > svg { display: none; }
.free-tool-shell .tl-nav-button:hover { background: #eef3ff; }
.free-tool-shell .tl-nav-button.tl-active { background: #e9efff; color: #315aee; }
.free-tool-shell .tl-side-nav { order: 0; width: 100%; flex-wrap: nowrap; align-items: stretch; gap: 3px; overflow-x: hidden; }
.free-tool-shell .tl-side-nav [data-tl-nav="directory"] { margin-bottom: 6px; }
.free-tool-shell .tl-theralab-brand > span, .free-tool-shell .tl-nav-button > span { margin-left: 0; }
.free-tool-shell .tl-hamburger { border: 1px solid #dfe5ef; background: #fff; color: #3057ed; }
.free-tool-shell .tl-product-brand strong { font-size: 21px; }
.free-tool-shell .tl-product-brand small { font-size: 11px; line-height: 1.45; }
.free-tool-shell .tl-workspace .free-tool-main { padding-top: 20px; }
.free-tool-shell .tl-skip-link { color: #17233e; }
.free-tool-loading { margin: 32px; color: #64748c; }
.free-tool-account-host { position: relative; min-width: 0; }
.free-tool-account { position: relative; }
.free-tool-shell .free-tool-account summary { display: flex; align-items: center; justify-content: center; min-height: 44px; max-width: 200px; list-style: none; cursor: pointer; font-size: 13px; line-height: 1.45; }
.free-tool-account summary::-webkit-details-marker { display: none; }
.free-tool-account summary span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.free-tool-account-menu { position: absolute; z-index: 40; right: 0; top: calc(100% + 8px); display: grid; gap: 5px; width: 240px; max-width: calc(100vw - 24px); padding: 12px; border: 1px solid #dfe5ef; border-radius: 12px; background: #fff; box-shadow: 0 8px 24px #17233e18; }
.free-tool-account:not([open]) .free-tool-account-menu { display: none; }
.free-tool-shell .free-tool-account-menu :is(a,button) { width: 100%; min-height: 44px; display: flex; align-items: center; padding: 9px 12px; border: 1px solid #ccd8ee; border-radius: 8px; color: #3057ed; background: #fff; font: inherit; font-size: 13px; text-align: left; text-decoration: none; }
.free-tool-shell .free-tool-account-menu :is(a,button):hover { background: #f6f8fc; }
.free-tool-shell .free-tool-account-menu p { margin: 4px; color: #64748c; font-size: 12px; line-height: 1.45; }
.free-tool-shell .free-tool-account-menu button:disabled { opacity: .6; }
.free-tool-unavailable { max-width: 480px; padding: 24px; border: 1px solid #dfe5ef; border-radius: 12px; background: #fff; }
.free-tool-shell .free-tool-unavailable h2 { margin: 0 0 8px; font-size: 20px; }
.free-tool-shell .free-tool-unavailable p { margin: 0; font-size: 16px; }
@media(max-width:640px) {
  .free-tool-shell .free-tool-account summary { max-width: 130px; }
  .free-tool-shell .tl-workspace .free-tool-main { padding-top: 16px; }
}
@media print {
  .free-tool-shell .tl-topbar, .free-tool-shell .tl-sidebar, .free-tool-shell .tl-mobile-shade, .free-tool-shell .tl-skip-link { display: none !important; }
  .free-tool-shell .tl-layout, .free-tool-shell .tl-workspace, .free-tool-shell .tl-content { display: block !important; height: auto !important; overflow: visible !important; padding: 0 !important; }
}
