/* Shared finishing layer for the product workspaces. The tool-specific
   layouts remain in their own stylesheets. */
body {
  color: #f3eee7;
  background-image:
    radial-gradient(ellipse 80% 50% at 15% 0%, rgba(215, 184, 134, 0.055) 0%, transparent 55%),
    radial-gradient(ellipse 60% 45% at 88% 12%, rgba(124, 92, 255, 0.045) 0%, transparent 50%);
  background-attachment: fixed;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  min-height: 100svh;
  overflow-x: hidden;
}
.tool-header {
  border-bottom: 1px solid rgba(216, 201, 181, .16);
  background: linear-gradient(110deg, rgba(16, 17, 25, .88), rgba(12, 13, 19, .9) 68%, rgba(23, 18, 30, .88));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.tool-title {
  color: #f6f1e9;
  font-weight: 550;
  letter-spacing: -.025em;
}
.back-link { color: #d9c8af; font-size: 11px; transition: color .18s ease; }
.back-link:hover { color: #fff5e3; }
.section-group, .card {
  border: 1px solid rgba(218, 205, 188, .15);
  background: linear-gradient(145deg, rgba(24, 25, 34, .78), rgba(13, 15, 21, .84));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 1px 0 rgba(255,255,255,.03) inset;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.section-group:hover, .card:hover {
  border-color: rgba(218, 205, 188, .26);
}
.section-title {
  color: #d8c2a0;
  letter-spacing: .09em;
  line-height: 1.5;
}
.tool-container {
  height: auto;
  min-height: calc(100svh - 56px);
}
.lpw-help-links { flex-wrap: wrap; }
.lpw-help-body {
  max-width: min(430px, calc(100vw - 32px));
  max-height: min(70svh, 560px);
  overflow: auto;
}
.card, .section-group, .tool-container > *, .controls-sidebar, .visualizer-wrapper {
  min-width: 0;
}
img, canvas, video { max-width: 100%; }
input, select, textarea { max-width: 100%; }
.control-label, .dropzone-sub { line-height: 1.5; }
.dropzone {
  border-color: rgba(216, 198, 175, .36);
  background: rgba(11, 12, 19, .6);
  transition: border-color .18s ease, background-color .18s ease;
}
.dropzone:hover, .dropzone.dragover {
  border-color: #dbc29d;
  background: rgba(219, 194, 157, .06);
}
button, a, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
:where(button, a, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid #ead5b3;
  outline-offset: 3px;
}
button:disabled { cursor: not-allowed; }
@media (max-width: 768px) {
  html, body {
    overflow-x: hidden;
    max-width: 100%;
  }
  .tool-header {
    flex-wrap: wrap;
    gap: 8px 12px;
    padding: 10px 12px;
    min-height: 56px;
  }
  .tool-title {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    max-width: none;
  }
  .workbench-tabs,
  .nav-tabs {
    overflow-x: auto;
    padding-inline: 12px;
  }
  .oracle-workspace,
  .oracle-workspace a,
  .oracle-workspace code,
  .oracle-workspace pre {
    overflow-wrap: anywhere;
  }
  .brand-section {
    flex-wrap: wrap;
    min-width: 0;
    max-width: 100%;
    gap: 8px;
  }
  .telemetry-readout {
    flex-wrap: wrap;
    min-width: 0;
    max-width: 100%;
    font-size: 11px;
  }
  button,
  .tab-btn,
  .workbench-tabs button,
  .workbench-tabs .nav-tab,
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
  select,
  .btn-primary,
  .btn-secondary {
    min-height: 44px;
  }
}
@media (max-width: 650px) {
  .tool-header {
    min-height: 58px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    position: sticky;
    top: 0;
    z-index: 100;
  }
  .brand-section {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
  }
  .back-link { font-size: 10px; white-space: nowrap; }
  .tool-title { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 140px; }
  .air-gap-pill { display: none !important; }
  .telemetry-readout { display: none !important; }
  .section-title { font-size: 11px; }
  .controls-sidebar { min-width: 0; width: 100%; box-sizing: border-box; }
  .lpw-help-links button { min-height: 40px; font-size: 10px; }
  .tool-container { min-height: calc(100svh - 58px); display: flex; flex-direction: column; }
  .lpw-help-links { gap: 6px 12px; padding: 8px 14px; }
  .lpw-help-body { position: fixed; inset: auto 12px 12px; width: auto; max-width: none; max-height: 65svh; z-index: 1000; }
  .studio-bridge { padding: 12px 14px !important; }
  .card-grid { grid-template-columns: minmax(0, 1fr) !important; gap: 14px; }
  .card { padding: 16px; border-radius: 6px; }
  
  /* Tabs across tools */
  .workbench-tabs {
    display: flex;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    border-bottom: 1px solid rgba(220, 205, 188, 0.16);
    background: #090b10;
  }
  .workbench-tabs::-webkit-scrollbar { display: none; }
  .workbench-tabs button, .workbench-tabs .nav-tab {
    flex: 0 0 auto;
    min-height: 44px;
    padding: 10px 14px;
    font-size: 11px;
    white-space: nowrap;
  }
  
  /* PBR Synth specific */
  .pbr-workspace .view-tabs { overflow-x: auto; overscroll-behavior-inline: contain; scrollbar-width: none; padding: 6px 12px; }
  .pbr-workspace .view-tabs::-webkit-scrollbar { display: none; }
  .pbr-workspace .tabs-group { width: max-content; min-width: 100%; }
  .pbr-workspace .tab-btn { flex: 0 0 74px; min-height: 40px; font-size: 10px; }
  .pbr-workspace .viewport-area { width: 100%; min-width: 0; grid-template-columns: minmax(0, 1fr); }
  .pbr-workspace .viewport-area > *, .pbr-workspace .stage-toolbar, .pbr-workspace .canvas-wrapper,
  .pbr-workspace #material-stage, .pbr-workspace .view-tabs, .pbr-workspace .tool-footer,
  .pbr-workspace .studio-bridge { box-sizing: border-box; width: 100%; max-width: 100%; min-width: 0; }
  .pbr-workspace .canvas-wrapper { min-height: 280px; height: 42vh; }
  
  /* Form inputs and buttons */
  input[type="range"] { height: 20px; }
  select, button { min-height: 42px; }
  .btn-primary, .btn-secondary { min-height: 44px; font-size: 12px; }
}
@media (max-height: 560px) and (min-width: 651px) {
  body { min-height: auto; }
  .tool-container { min-height: 480px; }
  .lpw-help-body { max-height: calc(100svh - 120px); }
}
@media (prefers-reduced-motion: reduce) {
  .dropzone { transition: none; }
}

.lp-tool-trust{margin:32px auto 24px;max-width:1200px;padding:16px 24px 0;border-top:1px solid rgba(255,255,255,0.08);display:flex;flex-wrap:wrap;gap:12px;justify-content:space-between;align-items:center;font:11px/1.6 ui-monospace,monospace;color:#8e8a98}
.lp-tool-trust a{color:#d4bb91;text-decoration:none}
.lp-tool-trust a:hover{color:#fff;text-decoration:underline;text-underline-offset:4px}

/* Precision FX, Top-Rim Specular Bevel & Tactile Micro-Squish */
.telemetry-readout,
.coordinates,
.time,
.status,
.readout,
.metric,
.stat-value,
input[type="number"],
code,
pre {
  font-variant-numeric: tabular-nums;
}

.section-group,
.card {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition:
    transform 220ms cubic-bezier(0.22, 1, 0.36, 1),
    border-color 200ms cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

button:not(:disabled),
.btn-primary:not(:disabled),
.btn-secondary:not(:disabled),
.tab-btn:not(:disabled) {
  transition:
    transform 220ms cubic-bezier(0.22, 1, 0.36, 1),
    border-color 180ms cubic-bezier(0.16, 1, 0.3, 1),
    background-color 180ms cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 220ms cubic-bezier(0.16, 1, 0.3, 1),
    color 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

button:not(:disabled):active,
.btn-primary:not(:disabled):active,
.btn-secondary:not(:disabled):active,
.tab-btn:not(:disabled):active,
.card:active {
  transform: scale(0.975) translateY(0.5px);
  transition-duration: 90ms;
  transition-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
}

@media (prefers-reduced-motion: reduce) {
  .section-group,
  .card,
  button:not(:disabled),
  .btn-primary:not(:disabled),
  .btn-secondary:not(:disabled),
  .tab-btn:not(:disabled) {
    transition: none !important;
  }

  button:not(:disabled):active,
  .btn-primary:not(:disabled):active,
  .btn-secondary:not(:disabled):active,
  .tab-btn:not(:disabled):active,
  .card:active {
    transform: none !important;
  }
}
