/* Shared navigation and loaded-workspace presentation for both page templates. */
.site-header,
.topbar {
  height: 48px;
}
.site-header .header-inner,
.topbar .topbar-inner {
  gap: 24px;
}
.site-header .brand,
.topbar .wordmark {
  font-size: 21px;
  gap: 8px;
}
:is(.site-header, .topbar) .brand-mark,
:is(.site-header, .topbar) .brand-mark svg {
  width: 26px;
  height: 28px;
}
.header-inner nav,
.topbar .studio-site-nav {
  height: 100%;
  gap: 22px;
  font-size: 12px;
}
.site-header .header-inner nav a,
.topbar .studio-site-nav a {
  display: flex;
  align-items: center;
  height: 100%;
  min-height: 44px;
  padding: 0;
}
:is(.site-header, .topbar) .header-local {
  padding: 0 0 0 18px;
  gap: 10px;
  border: 0;
  border-left: 1px solid #dce4ef;
  border-radius: 0;
  background: transparent;
  color: #334155;
  font-size: 12px;
  font-weight: 650;
}
:is(.site-header, .topbar) .header-local .icon {
  width: 26px;
  height: 28px;
  flex-shrink: 0;
  color: #3164f4;
}
:is(.site-header, .topbar) .header-local .icon path:first-child {
  fill: currentColor;
  stroke: none;
}
:is(.site-header, .topbar) .header-local .icon path:last-child {
  fill: none;
  stroke: white;
  stroke-width: 2;
}

body.tool-workspace-active .workspace-heading {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
.workspace-tool-label {
  display: inline-block;
  flex: 0 1 auto;
  color: #475569;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
:is(
    .pdf-filebar,
    .trim-filebar,
    .clean-filebar,
    .frames-filebar,
    .ico-filebar,
    .enc-filebar,
    .video-studio-source
  )
  > .workspace-tool-label {
  max-width: 180px;
  padding-right: 12px;
  border-right: 1px solid #dce5f2;
}
:is(.wf-main, .csv-preview-panel) > .workspace-tool-label {
  display: block;
  margin-bottom: 8px;
}
.file-details > .workspace-tool-label {
  display: block;
  font-size: 11px;
  margin-bottom: 3px;
}
.tool-workspace-active .breadcrumbs {
  display: none;
}

@media (max-width: 700px) {
  .site-header,
  .topbar {
    height: auto;
    padding: 0;
  }
  .site-header .header-inner,
  .topbar .topbar-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 8px 16px 0;
    width: 100%;
  }
  .site-header .header-inner nav,
  .topbar .studio-site-nav {
    height: auto;
    flex-wrap: wrap;
    overflow: visible;
    padding-bottom: 8px;
    gap: 2px 16px;
  }
  .site-header .header-inner nav a,
  .topbar .studio-site-nav a {
    height: auto;
    min-height: 40px;
    padding: 6px 0;
  }
  :is(.site-header, .topbar) .header-local {
    display: none;
  }
  :is(
      .pdf-filebar,
      .trim-filebar,
      .clean-filebar,
      .frames-filebar,
      .ico-filebar,
      .enc-filebar,
      .video-studio-source
    )
    > .workspace-tool-label {
    max-width: none;
    flex-basis: 100%;
    border: 0;
    padding: 0;
  }
  :is(
    .pdf-filebar,
    .trim-filebar,
    .clean-filebar,
    .frames-filebar,
    .ico-filebar,
    .enc-filebar,
    .video-studio-source
  ):has(> .workspace-tool-label) {
    flex-wrap: wrap;
    gap: 8px;
  }
}

/* Actions share a scale; import targets and editing handles keep their own geometry. */
body.tool-page {
  --tool-action-height: 44px;
  --tool-action-radius: 8px;
}
body.tool-page
  :is(
    .pdf-primary,
    .trim-primary,
    .clean-primary,
    a.button,
    .wf-settings > button:not(.secondary),
    .enc-settings > button:not(.secondary),
    .settings-pane .process-btn
  ) {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--tool-action-height);
  padding: 10px 16px;
  border-radius: var(--tool-action-radius);
  font: 600 14px/20px var(--font-sans, Arial, sans-serif);
  text-decoration: none;
}
body.tool-page
  :is(.pdf-ghost, .secondary, .handoff-button, .trim-filebar button, .clean-filebar button) {
  box-sizing: border-box;
  min-height: 36px;
  padding: 7px 12px;
  border-radius: var(--tool-action-radius);
  font: 600 13px/20px var(--font-sans, Arial, sans-serif);
}
body.tool-workspace-active
  :is(
    .pdf-filebar,
    .trim-filebar,
    .clean-filebar,
    .frames-filebar,
    .ico-filebar,
    .enc-filebar,
    .video-studio-source
  ) {
  padding: 6px 12px;
  margin-bottom: 8px;
  gap: 8px 12px;
  border-radius: 10px;
}
body.tool-workspace-active :is(.trim-filebar, .clean-filebar, .enc-filebar) > strong,
body.tool-workspace-active .trim-filebar > div:first-of-type {
  flex: 1;
  min-width: 0;
}
body.tool-workspace-active .trim-filebar p {
  margin: 2px 0 0;
  font-size: 12px;
}
body.tool-workspace-active :is(.wf-settings, .enc-settings) > label:has(> select),
body.tool-workspace-active .wf-settings > fieldset > label:has(> select) {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  margin-bottom: 10px;
}
body.tool-workspace-active
  :is(.wf-settings, .enc-settings)
  > label:not(:has(input[type='checkbox'])):not(:has(> select)),
body.tool-workspace-active .wf-settings > fieldset > label:not(.wf-check):not(:has(> select)) {
  display: grid;
  grid-template-columns: minmax(90px, 0.8fr) minmax(0, 1.2fr);
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}
body.tool-workspace-active
  :is(.wf-settings, .enc-settings)
  > label:not(:has(input[type='checkbox']))
  > :is(input, select),
body.tool-workspace-active .wf-settings > fieldset > label:not(.wf-check) > :is(input, select) {
  min-width: 0;
  width: 100%;
}
body.tool-workspace-active #pdf-workspace .pdf-filebar {
  margin-bottom: 6px;
}
body.tool-workspace-active :is(#sub-download, #csv-download) {
  margin: 0 0 12px;
}
.wf-settings > #csv-download {
  width: 100%;
}
@media (max-width: 700px) {
  body.tool-page
    :is(.pdf-ghost, .secondary, .handoff-button, .trim-filebar button, .clean-filebar button) {
    min-height: 44px;
    padding-block: 11px;
  }
}

body.tool-page #pdf-output-actions :is(button, a) {
  min-height: var(--tool-action-height);
  padding: 10px 12px;
  border-radius: var(--tool-action-radius);
}

body.tool-page :is(#crop-submit, #process-images, .ico-primary, .frames-primary),
.workspace :is(button.primary, a.primary, a.wav-download) {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 8px;
  font: 600 14px/20px var(--font-sans, Arial, sans-serif);
}
.workspace :is(button.secondary, a.secondary) {
  box-sizing: border-box;
  min-height: 36px;
  padding: 7px 12px;
  border-radius: 8px;
  font: 600 13px/20px var(--font-sans, Arial, sans-serif);
}
@media (max-width: 700px) {
  .workspace :is(button.secondary, a.secondary) {
    min-height: 44px;
    padding-block: 11px;
  }
}

.tool-item-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
body.tool-page .tool-item-actions > button {
  margin: 0;
  white-space: nowrap;
}

.tool-task-progress {
  display: grid;
  padding: 12px;
  border: 1px solid #dce1ed;
  border-radius: 8px;
  overflow-wrap: anywhere;
  gap: 6px;
  margin-block: 10px;
  font-size: 12px;
  line-height: 1.4;
  color: #475569;
}
.tool-task-progress progress {
  width: 100%;
  height: 9px;
  margin: 0;
  accent-color: var(--primary, #2563eb);
}
#pdf-export-note {
  overflow-wrap: anywhere;
}
