:root {
  color-scheme: light;
  --ink: #0b0b0f;
  --ink-soft: #1d1d1f;
  --muted: #6e6e73;
  --soft: #8d8d92;
  --line: rgba(0, 0, 0, 0.075);
  --line-strong: rgba(0, 0, 0, 0.13);
  --paper: #fbfbfd;
  --paper-2: #f5f5f7;
  --panel: rgba(255, 255, 255, 0.76);
  --panel-strong: rgba(255, 255, 255, 0.91);
  --panel-soft: rgba(245, 245, 247, 0.78);
  --accent: #0071e3;
  --accent-dark: #005ac1;
  --accent-soft: rgba(0, 113, 227, 0.105);
  --success: #34c759;
  --danger: #ff3b30;
  --radius-xs: 12px;
  --radius-sm: 16px;
  --radius-md: 24px;
  --radius-lg: 34px;
  --radius-xl: 46px;
  --shadow-xs: 0 1px 0 rgba(255, 255, 255, 0.8) inset, 0 1px 2px rgba(0, 0, 0, 0.025);
  --shadow-sm: 0 1px 1px rgba(0, 0, 0, 0.025), 0 14px 34px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 1px 0 rgba(255, 255, 255, 0.72) inset, 0 26px 70px rgba(0, 0, 0, 0.095);
  --shadow-lg: 0 1px 0 rgba(255, 255, 255, 0.78) inset, 0 48px 120px rgba(0, 0, 0, 0.16);
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", Inter, ui-sans-serif, system-ui, "Segoe UI", sans-serif;
  --font-mono: "SF Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* {
  -webkit-tap-highlight-color: transparent;
}

[hidden] {
  display: none !important;
}

html {
  background: var(--paper-2);
  scroll-behavior: smooth;
}

body {
  background:
    linear-gradient(180deg, #ffffff 0%, #fbfbfd 28%, #f5f5f7 72%, #ffffff 100%) !important;
  color: var(--ink) !important;
  font-family: var(--font-sans) !important;
  font-feature-settings: "kern", "liga", "calt";
  letter-spacing: -0.017em;
  text-rendering: geometricPrecision;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.2) 42%, rgba(255, 255, 255, 0.86)),
    linear-gradient(180deg, rgba(0, 0, 0, 0.026) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.018) 1px, transparent 1px);
  background-size: 100% 100%, 56px 56px, 56px 56px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.34), rgba(0, 0, 0, 0.12) 42%, transparent 78%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.62), transparent 36%, rgba(255, 255, 255, 0.58));
}

main,
.shell {
  width: min(1240px, calc(100% - 44px)) !important;
  padding-top: clamp(28px, 4vw, 62px) !important;
  padding-bottom: clamp(72px, 8vw, 120px) !important;
}

header,
.topbar {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.76) !important;
  border-bottom-color: rgba(0, 0, 0, 0.055) !important;
  border-radius: var(--radius-xl) !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.68)) !important;
  box-shadow: var(--shadow-md) !important;
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  padding: clamp(24px, 3.6vw, 54px) !important;
  margin-bottom: clamp(28px, 4vw, 52px) !important;
}

header::before,
.topbar::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(112deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.18) 34%, rgba(255, 255, 255, 0.58));
  opacity: 0.72;
}

header::after,
.topbar::after {
  content: "";
  position: absolute;
  left: clamp(24px, 3.6vw, 54px);
  right: clamp(24px, 3.6vw, 54px);
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.12), transparent);
  opacity: 0.34;
}

header > *,
.topbar > * {
  position: relative;
  z-index: 1;
}

nav a,
.crumb,
.eyebrow {
  color: var(--accent) !important;
  font-weight: 780 !important;
  letter-spacing: -0.02em;
}

h1 {
  max-width: 900px;
  margin: 0;
  color: var(--ink-soft) !important;
  font-size: clamp(48px, 8.4vw, 104px) !important;
  line-height: 0.9 !important;
  letter-spacing: -0.078em !important;
  font-weight: 860 !important;
}

h2 {
  color: var(--ink-soft) !important;
  letter-spacing: -0.048em !important;
  font-weight: 820 !important;
}

h3,
strong {
  color: var(--ink-soft);
}

p,
.intro,
.tool span,
.description,
.file-meta,
.success-meta,
.mail-preview,
.status,
.message,
.domain,
.path {
  color: var(--muted) !important;
}

.domain,
.status,
.path,
.badge,
.count,
.verb,
.endpoint-route,
pre,
code {
  font-family: var(--font-mono) !important;
  letter-spacing: -0.025em;
}

header .intro {
  max-width: 710px;
  margin: clamp(18px, 2.2vw, 26px) 0 0;
  color: #5b5b60 !important;
  font-size: clamp(18px, 1.8vw, 24px);
  line-height: 1.24;
  letter-spacing: -0.042em;
  font-weight: 560;
}

.header-actions,
.top-actions {
  gap: 12px !important;
}

a,
button,
.tool,
.back-link,
.back-button,
.api-button,
.primary,
.primary-button,
.ghost-button,
.copy-button,
.download,
.format-trigger,
.converter-add,
.icon-button,
.pick {
  transition:
    transform 180ms cubic-bezier(.2, .8, .2, 1),
    box-shadow 180ms ease,
    background-color 180ms ease,
    border-color 180ms ease,
    color 180ms ease,
    opacity 180ms ease,
    filter 180ms ease;
}

.api-button,
.back-link,
.back-button,
.primary,
.primary-button,
.download,
.copy,
.copy-button,
.ghost-button,
button.primary,
#run,
#merge-button,
[data-create] {
  border-radius: 999px !important;
  min-height: 46px !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  font-weight: 760 !important;
  letter-spacing: -0.022em;
  box-shadow: var(--shadow-xs), 0 13px 28px rgba(0, 0, 0, 0.075);
}

.api-button,
.primary,
.primary-button,
button.primary,
#run,
#merge-button,
.download,
[data-create] {
  background: linear-gradient(180deg, #242426, #050505) !important;
  color: #ffffff !important;
  border-color: rgba(0, 0, 0, 0.84) !important;
}

.api-button:hover,
.primary:hover,
.primary-button:hover,
button.primary:hover,
#run:hover,
#merge-button:hover,
.download:hover,
[data-create]:hover {
  filter: brightness(1.08);
  box-shadow: var(--shadow-xs), 0 18px 38px rgba(0, 0, 0, 0.13);
}

.back-link,
.back-button,
.ghost-button,
.copy-button,
.copy,
.domain,
.status,
.path {
  background: rgba(255, 255, 255, 0.72) !important;
  border: 1px solid rgba(0, 0, 0, 0.078) !important;
  border-radius: 999px !important;
  padding-left: 15px !important;
  padding-right: 15px !important;
  box-shadow: var(--shadow-xs);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
}

button:hover,
a.api-button:hover,
.back-link:hover,
.back-button:hover,
.tool:hover,
.download:hover,
.converter-add:hover,
.pick:hover {
  transform: translateY(-2px);
}

button:active,
a:active {
  transform: translateY(0) scale(0.985);
}

.tools {
  grid-template-columns: repeat(auto-fit, minmax(285px, 1fr)) !important;
  gap: clamp(18px, 2.1vw, 24px) !important;
  padding-top: 0 !important;
}

.tool {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 235px !important;
  align-content: space-between;
  border: 1px solid rgba(255, 255, 255, 0.76) !important;
  border-bottom-color: rgba(0, 0, 0, 0.08) !important;
  border-radius: var(--radius-lg) !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.69)) !important;
  box-shadow: var(--shadow-sm) !important;
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  padding: clamp(24px, 2.6vw, 32px) !important;
}

.tool::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.35) 38%, rgba(0, 113, 227, 0.055) 100%);
  transition: opacity 220ms ease;
}

.tool::after {
  content: "→";
  position: absolute;
  top: 22px;
  right: 22px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: rgba(29, 29, 31, 0.72);
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: var(--shadow-xs);
  transform: translateX(7px);
  opacity: 0;
  transition: opacity 190ms ease, transform 190ms cubic-bezier(.2, .8, .2, 1);
}

.tool:hover {
  box-shadow: var(--shadow-lg) !important;
  border-color: rgba(255, 255, 255, 0.88) !important;
}

.tool:hover::before {
  opacity: 1;
}

.tool:hover::after {
  opacity: 1;
  transform: translateX(0);
}

.tool > * {
  position: relative;
}

.tool strong {
  max-width: 11ch;
  font-size: clamp(24px, 2.25vw, 34px) !important;
  line-height: 1.01 !important;
  letter-spacing: -0.056em !important;
  font-weight: 850 !important;
}

.tool span:not(.path) {
  max-width: 32ch;
  font-size: 15.5px !important;
  line-height: 1.45 !important;
}

.path,
.status,
.domain,
.count,
.badge {
  display: inline-flex !important;
  width: fit-content;
  min-height: 30px;
  align-items: center;
  border-radius: 999px !important;
  font-size: 12px !important;
  font-weight: 760 !important;
}

.workspace,
.grid,
.layout,
.split {
  gap: clamp(20px, 2.2vw, 28px) !important;
}

.panel,
.result,
.info-card,
.doc-panel,
.sub-panel,
.code-panel,
.sidebar,
.meta-card,
.success-box,
.address-box,
.mail-card,
.message-detail,
.converter-card,
.converter-toolbar,
.converter-controls,
.format-menu,
.file-row,
.file-pill,
.dropzone,
.converter-empty,
.preview,
.endpoint-item,
.empty-state,
.mail-body,
.code-box {
  border: 1px solid rgba(255, 255, 255, 0.72) !important;
  border-bottom-color: rgba(0, 0, 0, 0.08) !important;
  border-radius: var(--radius-md) !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.91), rgba(255, 255, 255, 0.68)) !important;
  box-shadow: var(--shadow-sm) !important;
  backdrop-filter: blur(26px) saturate(175%);
  -webkit-backdrop-filter: blur(26px) saturate(175%);
}

.panel,
.result,
.doc-panel,
.sidebar,
.converter-card {
  box-shadow: var(--shadow-md) !important;
}

.panel,
.result,
.doc-body,
.panel-body,
.success-box,
.sub-panel,
.code-panel {
  padding: clamp(20px, 2.45vw, 34px) !important;
}

.result,
.content,
.doc-panel {
  min-width: 0;
}

input,
select,
textarea,
.search,
.format-search {
  min-height: 50px !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  border-bottom-color: rgba(0, 0, 0, 0.12) !important;
  border-radius: 17px !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.74)) !important;
  color: var(--ink) !important;
  box-shadow: var(--shadow-xs), 0 10px 22px rgba(0, 0, 0, 0.035);
  outline: none !important;
}

input:focus,
select:focus,
textarea:focus,
.search:focus,
.format-search:focus {
  border-color: rgba(0, 113, 227, 0.52) !important;
  box-shadow: 0 0 0 5px rgba(0, 113, 227, 0.12), var(--shadow-xs), 0 14px 28px rgba(0, 0, 0, 0.05) !important;
}

textarea,
pre {
  border-radius: 22px !important;
}

pre {
  background: linear-gradient(180deg, #16161b, #08080b) !important;
  color: #f5f5f7 !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.18) !important;
}

.dropzone,
.converter-empty {
  min-height: 188px !important;
  border-style: solid !important;
  border-color: rgba(0, 0, 0, 0.075) !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(245, 245, 247, 0.68)) !important;
}

.dropzone.is-over,
.converter-card.is-over,
.converter-empty:hover {
  border-color: rgba(0, 113, 227, 0.44) !important;
  background:
    linear-gradient(180deg, rgba(246, 251, 255, 0.96), rgba(235, 245, 255, 0.82)) !important;
}

.pick,
.converter-add {
  border-radius: 999px !important;
  background: linear-gradient(180deg, #242426, #050505) !important;
  color: #fff !important;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.14);
}

.converter-shell {
  gap: 0 !important;
}

.converter-toolbar {
  border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
  padding: 20px !important;
}

.converter-card {
  overflow: visible !important;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg) !important;
}

.converter-row {
  border-color: rgba(0, 0, 0, 0.058) !important;
}

.file-preview,
.file-index,
.badge,
.file-icon {
  border-radius: 16px !important;
  border-color: rgba(0, 0, 0, 0.075) !important;
  background: rgba(245, 245, 247, 0.88) !important;
}

.format-trigger {
  border-radius: 999px !important;
  border-color: rgba(0, 113, 227, 0.24) !important;
  background: var(--accent-soft) !important;
  color: var(--accent-dark) !important;
  font-weight: 800 !important;
}

.format-menu {
  border-radius: 30px !important;
  box-shadow: var(--shadow-lg) !important;
}

.format-option,
.format-category {
  border-radius: 999px !important;
}

.format-option {
  border-color: rgba(0, 0, 0, 0.075) !important;
  background: rgba(245, 245, 247, 0.88) !important;
}

.format-option.is-active {
  background: linear-gradient(180deg, #242426, #050505) !important;
  color: #fff !important;
  border-color: #050505 !important;
}

.icon-button {
  border-radius: 999px !important;
  background: rgba(255, 255, 255, 0.72) !important;
}

.icon-button:hover {
  box-shadow: var(--shadow-sm);
}

.file-list,
.file-summary,
.inbox-list,
.endpoint-list {
  gap: 12px !important;
}

.file-row,
.file-pill,
.mail-card,
.endpoint-item {
  box-shadow: var(--shadow-xs) !important;
}

.mail-card:hover,
.mail-card.active,
.endpoint-item:hover,
.endpoint-item.is-active {
  background: rgba(0, 113, 227, 0.095) !important;
  border-color: rgba(0, 113, 227, 0.24) !important;
}

.toast {
  border-radius: 999px !important;
  background: rgba(10, 10, 12, 0.88) !important;
  color: white !important;
  box-shadow: var(--shadow-md) !important;
  backdrop-filter: blur(24px) saturate(170%);
  -webkit-backdrop-filter: blur(24px) saturate(170%);
}

.table,
table {
  border-collapse: separate !important;
  border-spacing: 0 !important;
}

td,
th {
  border-color: rgba(0, 0, 0, 0.07) !important;
}

::selection {
  background: rgba(0, 113, 227, 0.18);
}

@media (max-width: 980px) {
  main,
  .shell {
    width: min(100% - 24px, 760px) !important;
    padding-top: 22px !important;
  }

  header,
  .topbar {
    align-items: stretch !important;
    border-radius: 32px !important;
  }

  h1 {
    font-size: clamp(43px, 13.5vw, 68px) !important;
    letter-spacing: -0.07em !important;
  }

  .tools {
    grid-template-columns: 1fr !important;
  }

  .tool {
    min-height: 210px !important;
  }

  .workspace,
  .grid,
  .layout,
  .split {
    grid-template-columns: 1fr !important;
  }

  .sidebar {
    position: relative !important;
    top: auto !important;
  }

  .endpoint-list {
    max-height: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* Clean premium pass: calmer Apple-like proportions and controls. */
:root {
  --ink: #1d1d1f;
  --ink-soft: #1d1d1f;
  --muted: #6e6e73;
  --soft: #86868b;
  --line: rgba(0, 0, 0, 0.1);
  --panel: rgba(255, 255, 255, 0.82);
  --panel-strong: rgba(255, 255, 255, 0.94);
  --accent: #0071e3;
  --accent-dark: #005bb5;
  --accent-soft: rgba(0, 113, 227, 0.09);
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 26px;
  --radius-xl: 32px;
  --shadow-xs: 0 1px 1px rgba(0, 0, 0, 0.035);
  --shadow-sm: 0 8px 24px rgba(0, 0, 0, 0.055);
  --shadow-md: 0 18px 52px rgba(0, 0, 0, 0.075);
  --shadow-lg: 0 28px 80px rgba(0, 0, 0, 0.11);
}

body {
  background: linear-gradient(180deg, #fbfbfd 0%, #f5f5f7 100%) !important;
  letter-spacing: -0.008em;
}

body::before {
  opacity: 0.28;
}

body::after {
  display: none;
}

main,
.shell {
  width: min(1220px, calc(100% - 48px)) !important;
  padding-top: clamp(28px, 3.2vw, 44px) !important;
  padding-bottom: 76px !important;
}

header,
.topbar {
  border: 1px solid rgba(0, 0, 0, 0.065) !important;
  border-radius: var(--radius-xl) !important;
  background: rgba(255, 255, 255, 0.86) !important;
  box-shadow: var(--shadow-md) !important;
  padding: clamp(28px, 4vw, 48px) !important;
  margin-bottom: clamp(28px, 3.6vw, 44px) !important;
}

header::before,
.topbar::before {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.75), transparent) !important;
  opacity: 0.42;
}

header::after,
.topbar::after {
  display: none;
}

h1 {
  max-width: 980px;
  font-size: clamp(42px, 5.2vw, 72px) !important;
  line-height: 1.02 !important;
  letter-spacing: -0.052em !important;
  font-weight: 720 !important;
}

h2 {
  letter-spacing: -0.032em !important;
  font-weight: 700 !important;
}

header .intro {
  max-width: 760px;
  margin-top: 18px;
  color: #515154 !important;
  font-size: clamp(17px, 1.55vw, 22px);
  line-height: 1.32;
  letter-spacing: -0.025em;
  font-weight: 430;
}

nav a,
.crumb,
.eyebrow {
  font-weight: 650 !important;
}

.domain,
.status,
.path,
.badge,
.count,
.verb,
.endpoint-route {
  letter-spacing: -0.012em;
}

a,
button,
label.converter-add,
.tool,
.back-link,
.back-button,
.api-button,
.primary,
.primary-button,
.ghost-button,
.copy-button,
.download,
.format-trigger,
.converter-add,
.icon-button,
.pick {
  -webkit-font-smoothing: antialiased;
}

button,
.download,
.api-button,
.back-link,
.back-button,
.primary,
.primary-button,
.ghost-button,
.copy-button,
.copy,
.pick,
.converter-add,
#run,
#merge-button,
[data-create] {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  min-height: 42px !important;
  border-radius: 999px !important;
  padding: 0 18px !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  line-height: 1 !important;
  letter-spacing: -0.012em !important;
  box-shadow: var(--shadow-xs) !important;
}

.api-button,
.primary,
.primary-button,
button.primary,
#run,
#merge-button,
.download,
[data-create],
.pick,
.converter-add {
  background: #1d1d1f !important;
  border-color: #1d1d1f !important;
  color: #fff !important;
}

.back-link,
.back-button,
.ghost-button,
.copy-button,
.copy,
.domain,
.status,
.path {
  min-height: 34px !important;
  background: rgba(255, 255, 255, 0.86) !important;
  border: 1px solid rgba(0, 0, 0, 0.095) !important;
  color: #515154 !important;
  padding-left: 14px !important;
  padding-right: 14px !important;
}

.api-button {
  min-width: 66px;
  min-height: 46px !important;
}

button:hover,
a.api-button:hover,
.back-link:hover,
.back-button:hover,
.tool:hover,
.download:hover,
.converter-add:hover,
.pick:hover {
  transform: translateY(-1px);
}

.tools {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)) !important;
  gap: 22px !important;
}

.tool {
  min-height: 186px !important;
  border: 1px solid rgba(0, 0, 0, 0.07) !important;
  border-radius: 26px !important;
  background: rgba(255, 255, 255, 0.82) !important;
  box-shadow: var(--shadow-sm) !important;
  padding: 26px !important;
}

.tool::before {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), transparent) !important;
  opacity: 0.25;
}

.tool::after {
  display: none;
}

.tool:hover {
  border-color: rgba(0, 0, 0, 0.105) !important;
  box-shadow: var(--shadow-md) !important;
}

.tool strong {
  max-width: none !important;
  font-size: clamp(22px, 1.55vw, 26px) !important;
  line-height: 1.08 !important;
  letter-spacing: -0.032em !important;
  font-weight: 700 !important;
}

.tool span:not(.path) {
  max-width: 33ch;
  font-size: 15px !important;
  line-height: 1.43 !important;
  font-weight: 400 !important;
}

.path,
.status,
.domain,
.count,
.badge {
  min-height: 30px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
}

.panel,
.result,
.info-card,
.doc-panel,
.sub-panel,
.code-panel,
.sidebar,
.meta-card,
.success-box,
.address-box,
.mail-card,
.message-detail,
.converter-card,
.converter-toolbar,
.converter-controls,
.format-menu,
.file-row,
.file-pill,
.dropzone,
.converter-empty,
.preview,
.endpoint-item,
.empty-state,
.mail-body,
.code-box {
  border: 1px solid rgba(0, 0, 0, 0.075) !important;
  border-radius: 22px !important;
  background: rgba(255, 255, 255, 0.84) !important;
  box-shadow: var(--shadow-sm) !important;
}

.panel,
.result,
.doc-panel,
.sidebar,
.converter-card {
  box-shadow: var(--shadow-sm) !important;
}

.panel,
.result,
.doc-body,
.panel-body,
.success-box,
.sub-panel,
.code-panel {
  padding: clamp(18px, 2vw, 26px) !important;
}

label {
  font-weight: 600 !important;
  letter-spacing: -0.01em;
}

input,
select,
textarea,
.search,
.format-search {
  min-height: 44px !important;
  border: 1px solid rgba(0, 0, 0, 0.105) !important;
  border-radius: 14px !important;
  background: rgba(255, 255, 255, 0.88) !important;
  box-shadow: none !important;
  font-weight: 500 !important;
  padding: 10px 14px !important;
}

input:focus,
select:focus,
textarea:focus,
.search:focus,
.format-search:focus {
  border-color: rgba(0, 113, 227, 0.55) !important;
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.11) !important;
}

pre {
  border-radius: 18px !important;
  box-shadow: var(--shadow-sm) !important;
}

.converter-shell {
  max-width: 1120px !important;
}

.converter-toolbar {
  display: grid !important;
  grid-template-columns: auto minmax(220px, 1fr) auto;
  align-items: center !important;
  gap: 16px !important;
  border-radius: 26px 26px 0 0 !important;
  padding: 16px 18px !important;
}

.converter-add {
  min-height: 46px !important;
  padding: 0 18px !important;
  font-size: 16px !important;
  white-space: nowrap;
}

.converter-add-mark {
  display: inline-flex !important;
  width: 24px !important;
  height: 24px !important;
  align-items: center !important;
  justify-content: center !important;
  border: 1.5px solid currentColor !important;
  border-radius: 7px !important;
  font-size: 18px !important;
  font-weight: 650 !important;
  line-height: 1 !important;
}

.converter-help {
  justify-content: center !important;
  color: var(--soft) !important;
  font-size: 14px !important;
  font-weight: 560 !important;
  text-align: center !important;
}

.converter-global-format {
  min-height: 50px !important;
  border-radius: 16px !important;
  background: rgba(255, 255, 255, 0.82) !important;
  padding: 6px 8px 6px 14px !important;
}

.format-control {
  font-size: 14px !important;
  font-weight: 600 !important;
}

.format-trigger {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 104px !important;
  min-height: 38px !important;
  border: 1px solid rgba(0, 113, 227, 0.34) !important;
  border-radius: 999px !important;
  background: var(--accent-soft) !important;
  color: var(--accent-dark) !important;
  padding: 0 16px !important;
  font-size: 14px !important;
  font-weight: 650 !important;
}

.converter-card {
  border-radius: 0 0 26px 26px !important;
}

.converter-list.is-empty {
  min-height: 214px !important;
}

.converter-empty {
  width: calc(100% - 32px) !important;
  min-height: 172px !important;
  margin: 16px !important;
  border-style: dashed !important;
  border-radius: 22px !important;
  background: rgba(255, 255, 255, 0.62) !important;
  padding: 28px !important;
}

.converter-empty strong {
  color: var(--ink-soft) !important;
  font-size: 20px !important;
  line-height: 1.14;
  font-weight: 650 !important;
  letter-spacing: -0.02em;
}

.converter-empty span {
  color: var(--muted) !important;
  font-size: 14px !important;
  line-height: 1.45 !important;
  font-weight: 450 !important;
}

.converter-controls {
  border-radius: 0 0 26px 26px !important;
  padding: 16px 18px !important;
}

.converter-settings {
  align-items: end;
  gap: 12px !important;
}

.converter-settings-title {
  font-size: 13px !important;
  font-weight: 600 !important;
}

.mini-field {
  font-size: 12px !important;
  font-weight: 600 !important;
}

.mini-field input {
  min-height: 40px !important;
  font-size: 14px !important;
}

.converter-row {
  grid-template-columns: minmax(0, 1fr) auto 40px !important;
  gap: 16px !important;
  min-height: 82px !important;
  padding: 14px 18px !important;
}

.converter-row:hover {
  background: rgba(255, 255, 255, 0.72) !important;
}

.converter-file {
  grid-template-columns: 54px minmax(0, 1fr) !important;
  gap: 14px !important;
}

.file-preview {
  width: 54px !important;
  height: 54px !important;
  border: 1px solid rgba(0, 0, 0, 0.09) !important;
  border-radius: 14px !important;
  background: #f5f5f7 !important;
  font-size: 11px !important;
  font-weight: 650 !important;
}

.file-preview-badge {
  border-radius: 7px !important;
  font-size: 9px !important;
  font-weight: 650 !important;
  padding: 4px 5px !important;
}

.converter-file-meta strong {
  font-size: 16px !important;
  font-weight: 650 !important;
  letter-spacing: -0.018em !important;
}

.converter-file-meta span {
  margin-top: 4px !important;
  font-size: 13px !important;
  font-weight: 450 !important;
}

.icon-button {
  display: inline-flex !important;
  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;
  min-height: 38px !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 50% !important;
  padding: 0 !important;
  background: rgba(255, 255, 255, 0.88) !important;
  color: var(--muted) !important;
  font-size: 17px !important;
  font-weight: 600 !important;
  line-height: 1 !important;
}

.format-menu {
  border-radius: 24px !important;
  padding: 18px !important;
  box-shadow: var(--shadow-lg) !important;
}

.format-option {
  min-height: 38px !important;
  border-radius: 999px !important;
  font-size: 14px !important;
  font-weight: 560 !important;
  padding: 0 15px !important;
}

.format-category {
  min-height: 40px !important;
  font-size: 13px !important;
  font-weight: 650 !important;
  line-height: 40px !important;
}

.converter-page .actions {
  border-radius: 22px !important;
  background: rgba(255, 255, 255, 0.82) !important;
  padding: 14px !important;
}

.converter-page #run {
  min-width: 156px !important;
  min-height: 44px !important;
  font-size: 15px !important;
}

.converter-page .message {
  font-size: 15px !important;
  font-weight: 560 !important;
}

.transcription-page .panel {
  overflow: visible !important;
  padding: clamp(24px, 3vw, 40px) !important;
}

.transcribe-shell {
  gap: clamp(20px, 2.1vw, 28px) !important;
}

.transcribe-flow {
  display: grid !important;
  gap: clamp(18px, 1.8vw, 24px) !important;
}

.transcribe-upload,
.transcribe-empty,
.transcribe-file,
.transcript-card {
  border: 1px solid rgba(0, 0, 0, 0.075) !important;
  border-radius: 22px !important;
  background: rgba(255, 255, 255, 0.84) !important;
  box-shadow: var(--shadow-sm) !important;
}

.transcribe-upload {
  gap: 18px !important;
  padding: clamp(22px, 2.4vw, 30px) !important;
}

.transcribe-add {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px !important;
  min-height: 44px !important;
  border-radius: 999px !important;
  background: #1d1d1f !important;
  color: #fff !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  padding: 0 18px !important;
}

.transcribe-add span:last-child {
  white-space: nowrap;
}

.transcribe-add-mark {
  display: inline-flex !important;
  width: 24px !important;
  height: 24px !important;
  align-items: center !important;
  justify-content: center !important;
  border: 1.5px solid currentColor !important;
  border-radius: 7px !important;
  font-size: 18px !important;
  font-weight: 650 !important;
  line-height: 1 !important;
}

.transcribe-hint {
  color: var(--muted) !important;
  font-size: 14px !important;
  font-weight: 450 !important;
  line-height: 1.5 !important;
  max-width: 1080px;
}

.transcribe-empty {
  min-height: clamp(154px, 13vw, 210px) !important;
  color: var(--muted) !important;
  font-weight: 560 !important;
  padding: clamp(28px, 3vw, 44px) !important;
}

.transcribe-file {
  padding: 14px 16px !important;
}

.transcribe-file strong,
.transcript-head strong {
  font-size: 16px !important;
  font-weight: 650 !important;
  letter-spacing: -0.018em !important;
}

.transcribe-file span {
  color: var(--muted) !important;
  font-size: 13px !important;
  font-weight: 450 !important;
}

.transcribe-options {
  display: grid !important;
  grid-template-columns: minmax(210px, 0.95fr) minmax(170px, 0.72fr) minmax(220px, 1fr);
  gap: 16px !important;
  align-items: end !important;
  padding: 2px 0 8px !important;
}

.transcribe-options .mini-field {
  min-width: 0 !important;
  gap: 7px !important;
}

.transcribe-options .mini-field input,
.transcribe-options .mini-field select {
  min-height: 48px !important;
  padding-left: 16px !important;
  padding-right: 16px !important;
}

.transcription-page .actions {
  align-items: center !important;
  gap: 16px !important;
  margin-top: clamp(18px, 2.1vw, 28px) !important;
  padding-top: 0 !important;
}

.transcription-page #run {
  min-width: 154px !important;
  min-height: 48px !important;
  padding-left: 22px !important;
  padding-right: 22px !important;
}

.transcription-page .message {
  font-size: 15px !important;
  font-weight: 560 !important;
  line-height: 1.35 !important;
}

.transcript-card {
  gap: 12px !important;
  padding: 16px !important;
}

.transcript-head {
  display: flex !important;
  align-items: center !important;
}

.transcript-copy {
  min-height: 36px !important;
  padding: 0 14px !important;
}

.transcript-text {
  min-height: 178px !important;
  border-radius: 16px !important;
  font-family: var(--font-sans) !important;
  font-size: 15px !important;
  font-weight: 450 !important;
  line-height: 1.55 !important;
}

@media (max-width: 980px) {
  main,
  .shell {
    width: min(100% - 28px, 760px) !important;
  }

  header,
  .topbar {
    border-radius: 26px !important;
    padding: 26px !important;
  }

  h1 {
    font-size: clamp(38px, 10.5vw, 56px) !important;
    line-height: 1.02 !important;
  }

  header .intro {
    font-size: 17px;
  }

  .tool {
    min-height: 168px !important;
    padding: 24px !important;
  }

  .tool strong {
    font-size: 23px !important;
  }

  .converter-toolbar {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .converter-add {
    width: 100%;
  }

  .converter-global-format {
    width: 100%;
  }

  .format-control {
    align-items: stretch !important;
  }

  .converter-row {
    grid-template-columns: 1fr !important;
    align-items: stretch !important;
  }

  .icon-button {
    justify-self: end;
  }

  .transcription-page .panel {
    padding: 20px !important;
  }

  .transcribe-upload {
    padding: 20px !important;
  }

  .transcribe-options {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  .transcription-page .actions {
    align-items: stretch !important;
    flex-direction: column !important;
  }

  .transcription-page #run,
  .transcription-page .download {
    width: 100%;
  }

  .transcript-head {
    align-items: stretch !important;
    flex-direction: column !important;
  }
}

a[hidden],
button[hidden],
.download[hidden] {
  display: none !important;
}

.session-controls {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(17, 17, 19, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  padding: 4px 5px 4px 14px;
}

.session-controls[hidden] {
  display: none !important;
}

.session-user {
  max-width: 220px;
  overflow: hidden;
  color: #52525a;
  font-size: 12px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

button.session-logout {
  min-height: 32px;
  border: 0;
  border-radius: 999px;
  background: #171719;
  color: #fff;
  font-size: 12px;
  padding: 0 13px;
}

.transcribe-access {
  color: #6e6e73;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  padding: 2px 2px 0;
}

@media (max-width: 720px) {
  .session-controls {
    width: 100%;
    justify-content: space-between;
  }

  .session-user {
    max-width: 180px;
  }
}

/* Shared application shell */
@view-transition {
  navigation: auto;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 140ms;
  animation-timing-function: ease-out;
}

html {
  background: #fafafa;
}

html.app-booting body {
  opacity: 0;
}

html.app-ready body {
  opacity: 1;
}

body.has-tool-sidebar {
  min-height: 100vh;
  padding-left: 240px;
  background: #fafafa !important;
  letter-spacing: 0 !important;
}

body.has-tool-sidebar::before,
body.has-tool-sidebar::after {
  display: none;
}

body.has-tool-sidebar main,
body.has-tool-sidebar .shell {
  width: min(1320px, calc(100% - 48px)) !important;
  margin: 0 auto !important;
  padding: 30px 0 64px !important;
}

body.has-tool-sidebar main > header,
body.has-tool-sidebar .topbar {
  min-height: 70px;
  align-items: center !important;
  overflow: visible;
  border: 0 !important;
  border-bottom: 1px solid #e5e5e7 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  margin: 0 0 24px !important;
  padding: 0 0 22px !important;
}

body.has-tool-sidebar main > header::before,
body.has-tool-sidebar main > header::after,
body.has-tool-sidebar .topbar::before,
body.has-tool-sidebar .topbar::after {
  display: none;
}

body.has-tool-sidebar main > header h1,
body.has-tool-sidebar .topbar h1 {
  max-width: none;
  margin: 0 !important;
  color: #171719 !important;
  font-size: 32px !important;
  font-weight: 650 !important;
  line-height: 1.12 !important;
  letter-spacing: 0 !important;
}

body.has-tool-sidebar main > header nav,
body.has-tool-sidebar .topbar .crumb,
body.has-tool-sidebar main > header .eyebrow {
  display: none;
}

body.has-tool-sidebar .intro {
  max-width: 720px;
  margin: 7px 0 0 !important;
  font-size: 14px !important;
  line-height: 1.55 !important;
}

body.has-tool-sidebar .header-actions,
body.has-tool-sidebar .top-actions {
  gap: 8px !important;
}

body.has-tool-sidebar .back-link,
body.has-tool-sidebar .back-button {
  display: none !important;
}

body.has-tool-sidebar .api-button {
  min-height: 38px !important;
  border-radius: 8px !important;
  padding: 0 13px !important;
  font-size: 13px !important;
}

body.has-tool-sidebar .session-controls {
  display: none !important;
}

body.has-tool-sidebar .tools {
  grid-template-columns: repeat(auto-fill, minmax(245px, 1fr)) !important;
  gap: 14px !important;
  padding-top: 0 !important;
}

body.has-tool-sidebar .tool {
  min-height: 156px !important;
  border: 1px solid #e4e4e7 !important;
  border-radius: 8px !important;
  background: #fff !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.025) !important;
  padding: 20px !important;
}

body.has-tool-sidebar .tool:hover {
  border-color: #cfcfd3 !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.055) !important;
  transform: translateY(-1px) !important;
}

body.has-tool-sidebar .tool strong {
  font-size: 18px !important;
  font-weight: 650 !important;
  letter-spacing: 0 !important;
}

body.has-tool-sidebar .tool span {
  font-size: 13px !important;
  line-height: 1.5 !important;
}

body.has-tool-sidebar .workspace,
body.has-tool-sidebar .grid,
body.has-tool-sidebar .layout {
  padding-top: 0 !important;
}

body.has-tool-sidebar .panel,
body.has-tool-sidebar .result,
body.has-tool-sidebar .converter-shell,
body.has-tool-sidebar .transcribe-flow,
body.has-tool-sidebar .video-compress-flow,
body.has-tool-sidebar .overview,
body.has-tool-sidebar .doc-panel,
body.has-tool-sidebar .sidebar {
  border-color: #e4e4e7 !important;
  border-radius: 8px !important;
  background: #fff !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.035) !important;
}

body.has-tool-sidebar button,
body.has-tool-sidebar .download,
body.has-tool-sidebar .primary-button,
body.has-tool-sidebar .ghost-button,
body.has-tool-sidebar .copy-button {
  border-radius: 8px !important;
}

.tool-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 1000;
  display: flex;
  width: 240px;
  height: 100vh;
  flex-direction: column;
  border-right: 1px solid rgba(229, 229, 229, 0.9);
  background: rgba(255, 255, 255, 0.94);
  color: #171719;
  box-shadow: 1px 0 0 rgba(255, 255, 255, 0.75) inset;
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
}

.tool-sidebar-brand {
  display: flex;
  height: 64px;
  flex: 0 0 64px;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
}

.tool-sidebar-brand > a {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  color: #171719;
  text-decoration: none;
}

.tool-sidebar-logo {
  display: block;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  object-fit: contain;
}

.tool-sidebar-brand a > span:last-child {
  display: flex;
  align-items: baseline;
  font-size: 16px;
}

.tool-sidebar-brand strong {
  font-weight: 680;
}

.tool-sidebar-brand em {
  margin-left: 5px;
  color: #2563eb;
  font-style: normal;
  font-weight: 600;
}

.tool-sidebar-close {
  display: none !important;
}

.tool-sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 4px 12px 18px;
  scrollbar-width: thin;
  scrollbar-color: #d4d4d8 transparent;
}

.tool-sidebar-group + .tool-sidebar-group {
  margin-top: 18px;
}

.tool-sidebar-group-label {
  margin: 0 9px 6px;
  color: #a1a1aa;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tool-sidebar-link {
  display: flex;
  min-height: 46px;
  align-items: center;
  gap: 10px;
  border-radius: 8px;
  color: #5f5f67;
  padding: 6px 8px;
  text-decoration: none;
  transition: background-color 140ms ease, color 140ms ease;
}

.tool-sidebar-link:hover {
  background: #f4f4f5;
  color: #171719;
}

.tool-sidebar-link.is-active {
  background: #eef4ff;
  color: #1d4ed8;
}

.tool-sidebar-glyph {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  place-items: center;
  border: 1px solid #e4e4e7;
  border-radius: 7px;
  background: #fff;
  color: #71717a;
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 750;
}

.tool-sidebar-link.is-active .tool-sidebar-glyph {
  border-color: #c7d7fe;
  background: #fff;
  color: #2563eb;
}

.tool-sidebar-link-copy {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.tool-sidebar-link-copy strong {
  overflow: hidden;
  color: currentColor;
  font-size: 13px;
  font-weight: 610;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tool-sidebar-link-copy small {
  overflow: hidden;
  color: #a1a1aa;
  font-family: var(--font-mono);
  font-size: 9px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tool-sidebar-footer {
  flex: 0 0 auto;
  border-top: 1px solid #e5e5e7;
  padding: 12px;
}

.tool-sidebar-account {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  padding: 4px;
  border-radius: 8px;
  text-decoration: none;
  transition: background 140ms ease;
}

.tool-sidebar-account:hover { background: #f4f4f5; }

.tool-sidebar-avatar {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border-radius: 50%;
  background: #e4e4e7;
  color: #52525b;
  font-size: 13px;
  font-weight: 700;
}

.tool-sidebar-avatar img { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }

.tool-sidebar-account-copy {
  display: grid;
  min-width: 0;
}

.tool-sidebar-account-copy strong,
.tool-sidebar-account-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tool-sidebar-account-copy strong {
  color: #27272a;
  font-size: 12px;
  font-weight: 650;
}

.tool-sidebar-account-copy small {
  color: #8a8a92;
  font-size: 10px;
}

.tool-sidebar-login,
.tool-sidebar-logout {
  display: flex;
  width: 100%;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid #e4e4e7;
  border-radius: 8px;
  background: #fff;
  color: #52525b;
  font-size: 11px;
  font-weight: 650;
  text-decoration: none;
}

.tool-sidebar-logout {
  margin-top: 6px;
}

.tool-sidebar-login:hover,
.tool-sidebar-logout:hover {
  background: #f4f4f5;
  color: #171719;
}

.tool-sidebar-legal {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 2px 0;
  color: #a1a1aa;
  font-size: 9px;
}

.tool-sidebar-legal a {
  color: #71717a;
  text-decoration: none;
}

.tool-sidebar-legal a:hover {
  color: #171719;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.tool-sidebar-menu,
.tool-sidebar-overlay {
  display: none !important;
}

/* Tool/API mode */
.tool-mode-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tool-mode-route {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  border: 1px solid #e4e4e7;
  border-radius: 8px;
  background: #fff;
  color: #71717a;
  padding: 0 11px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}

.tool-mode-switch {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(58px, 1fr));
  gap: 3px;
  border: 1px solid #e4e4e7;
  border-radius: 9px;
  background: #f4f4f5;
  padding: 3px;
}

.tool-mode-switch button {
  display: flex !important;
  min-height: 30px !important;
  align-items: center !important;
  justify-content: center !important;
  border: 0 !important;
  border-radius: 6px !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #71717a !important;
  padding: 0 11px !important;
  font-size: 12px !important;
  font-weight: 650 !important;
}

.tool-mode-switch button.is-active {
  background: #fff !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
  color: #1d4ed8 !important;
}

main.is-api-mode > *:not(header):not(.topbar):not(.tool-api-view) {
  display: none !important;
}

.tool-api-view {
  display: grid;
  gap: 14px;
}

.tool-api-view[hidden] {
  display: none !important;
}

.tool-api-frame-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  border: 1px solid #e4e4e7;
  border-radius: 8px;
  background: #fff;
  padding: 18px 20px;
}

.tool-api-frame-head > div {
  display: grid;
  gap: 4px;
}

.tool-api-frame-head span {
  color: #71717a;
  font-size: 11px;
  font-weight: 650;
  text-transform: uppercase;
}

.tool-api-frame-head strong {
  color: #18181b;
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 650;
}

.tool-api-frame-head p {
  max-width: 520px;
  margin: 0;
  color: #71717a;
  font-size: 13px;
  line-height: 1.45;
  text-align: right;
}

.tool-api-view iframe {
  display: block;
  width: 100%;
  height: 1px;
  min-height: 0;
  overflow: hidden;
  border: 0;
  border-radius: 8px;
  background: transparent;
}

.tool-api-view iframe[hidden] {
  display: none !important;
}

.tool-api-loading {
  display: grid;
  gap: 12px;
  min-height: 420px;
  align-content: start;
  border: 1px solid #e4e4e7;
  border-radius: 8px;
  background: #fff;
  padding: 24px;
}

.tool-api-loading span {
  display: block;
  height: 44px;
  border-radius: 7px;
  background: linear-gradient(90deg, #f4f4f5 20%, #fafafa 45%, #f4f4f5 70%);
  background-size: 220% 100%;
  animation: tool-api-loading 1.1s linear infinite;
}

.tool-api-loading span:first-child {
  width: 42%;
  height: 28px;
}

.tool-api-loading span:nth-child(2) {
  width: 76%;
}

.tool-api-loading span:nth-child(3) {
  height: 140px;
}

.tool-api-loading span:nth-child(4) {
  height: 96px;
}

.tool-api-view.is-loaded .tool-api-loading {
  display: none;
}

@keyframes tool-api-loading {
  to {
    background-position: -220% 0;
  }
}

/* Dashboard groups */
.dashboard-page main > header {
  padding-bottom: 20px !important;
}

.dashboard-api-hint {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #f8fafc;
  color: #475569;
  padding: 0 11px;
  font-size: 11px;
  font-weight: 650;
}

body.has-tool-sidebar.dashboard-page .tools {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 28px !important;
}

.overview-group {
  display: grid;
  gap: 12px;
  padding-bottom: 26px;
  border-bottom: 1px solid #e5e7eb;
}

.overview-group:last-child {
  border-bottom: 0;
}

.overview-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2px;
}

.overview-group-head h2 {
  margin: 0;
  color: #27272a;
  font-size: 15px;
  font-weight: 680;
}

.overview-group-head > span {
  color: #a1a1aa;
  font-size: 11px;
  font-weight: 600;
}

.overview-group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.dashboard-page .tool {
  position: relative;
  min-height: 168px !important;
  align-content: start;
  gap: 11px !important;
  overflow: hidden;
}

.dashboard-page .tool-card-marker {
  display: grid !important;
  width: 34px;
  height: 30px;
  place-items: center;
  border: 1px solid #dbe7ff;
  border-radius: 7px;
  background: #f3f7ff;
  color: #2563eb;
  font-family: var(--font-mono);
  font-size: 8px !important;
  font-weight: 750;
}

.dashboard-page .tool .path {
  margin-top: auto;
}

/* Embedded API document shown inside a tool page */
html.api-embed,
html.api-embed body {
  min-height: 100%;
  overflow: hidden !important;
  background: transparent !important;
}

html.api-embed body::before,
html.api-embed body::after,
html.api-embed main > header,
html.api-embed .overview,
html.api-embed .sidebar {
  display: none !important;
}

html.api-embed main {
  width: 100% !important;
  margin: 0 !important;
  padding: 0 0 28px !important;
}

html.api-embed .layout {
  display: block !important;
  padding: 0 !important;
}

html.api-embed .content,
html.api-embed .doc-panel {
  width: 100% !important;
  max-width: none !important;
}

html.api-embed .doc-panel {
  border-color: #e4e4e7 !important;
  border-radius: 8px !important;
  box-shadow: none !important;
}

@media (max-width: 900px) {
  body.has-tool-sidebar {
    padding-left: 0;
  }

  body.has-tool-sidebar main,
  body.has-tool-sidebar .shell {
    width: min(100% - 24px, 760px) !important;
    padding-top: 72px !important;
  }

  body.has-tool-sidebar main > header,
  body.has-tool-sidebar .topbar {
    align-items: flex-start !important;
    flex-direction: column !important;
    gap: 14px !important;
  }

  body.has-tool-sidebar main > header h1,
  body.has-tool-sidebar .topbar h1 {
    font-size: 28px !important;
  }

  body.has-tool-sidebar .header-actions,
  body.has-tool-sidebar .top-actions {
    width: 100%;
    justify-content: flex-start !important;
  }

  .tool-sidebar {
    width: min(290px, calc(100vw - 40px));
    transform: translateX(-102%);
    transition: transform 180ms ease;
  }

  .tool-sidebar-open .tool-sidebar {
    transform: translateX(0);
  }

  .tool-sidebar-menu {
    position: fixed;
    top: 14px;
    left: 14px;
    z-index: 900;
    display: grid !important;
    width: 42px;
    height: 42px;
    place-content: center;
    gap: 4px;
    border: 1px solid #e4e4e7;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 5px 18px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(14px);
  }

  .tool-sidebar-menu span {
    display: block;
    width: 17px;
    min-width: 17px;
    height: 1.5px;
    flex: 0 0 17px;
    border-radius: 2px;
    background: #27272a;
  }

  .tool-sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 950;
    border: 0;
    background: rgba(17, 17, 19, 0.28);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
  }

  .tool-sidebar-open .tool-sidebar-overlay {
    display: block !important;
    opacity: 1;
    pointer-events: auto;
  }

  .tool-mode-controls {
    width: 100%;
    justify-content: space-between;
  }

  .tool-mode-route {
    max-width: calc(100% - 142px);
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .tool-api-frame-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .tool-api-frame-head p {
    text-align: left;
  }

  .overview-group-grid {
    grid-template-columns: 1fr;
  }
}

/* Account and integration gates ------------------------------------------ */
body.has-tool-sidebar main { position: relative; }

main.has-tool-access-gate > *:not(header):not(.topbar):not(.tool-access-gate) {
  filter: blur(5px);
  opacity: .42;
  pointer-events: none !important;
  user-select: none;
}

.tool-access-gate {
  position: absolute;
  top: 98px;
  right: 40px;
  left: 40px;
  z-index: 80;
  display: grid;
  min-height: 430px;
  place-items: center;
  padding: 40px;
}

.tool-access-gate-card {
  display: grid;
  width: min(460px, 100%);
  justify-items: center;
  gap: 22px;
  border: 1px solid rgba(229, 229, 229, .9);
  border-radius: 18px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .1);
  padding: 34px;
  text-align: center;
  backdrop-filter: blur(18px);
}

.tool-access-gate-card > div:not(.tool-access-actions) { display: grid; gap: 8px; }

.tool-access-gate-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 12px;
  background: #eff6ff;
  color: #0a84ff;
  font-size: 12px;
  font-weight: 750;
}

.tool-access-eyebrow {
  color: #0a84ff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.tool-access-gate h2 {
  margin: 0;
  color: #171717 !important;
  font-size: 22px !important;
  font-weight: 620 !important;
  line-height: 1.2;
  letter-spacing: -.03em !important;
}

.tool-access-gate p {
  margin: 0;
  color: #737373 !important;
  font-size: 13px;
  line-height: 1.55;
}

.tool-access-actions {
  display: flex;
  width: 100%;
  justify-content: center;
  gap: 10px;
}

.tool-access-primary,
.tool-access-secondary {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  padding: 0 17px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.tool-access-primary { background: #0a84ff; color: #fff; }
.tool-access-primary:hover { background: #0070e0; }
.tool-access-secondary { border: 1px solid #e5e5e5; background: #fff; color: #404040; }
.tool-access-secondary:hover { background: #f5f5f5; }

.tool-access-gate.is-pending { visibility: hidden; }
.tool-access-spinner {
  width: 26px;
  height: 26px;
  border: 2px solid #e5e5e5;
  border-top-color: #0a84ff;
  border-radius: 50%;
  animation: tool-access-spin .8s linear infinite;
}
@keyframes tool-access-spin { to { transform: rotate(360deg); } }

/* Compact workflow proportions */
body.has-tool-sidebar .transcribe-upload,
body.has-tool-sidebar .video-compress-upload {
  min-height: 116px;
  gap: 12px !important;
}

body.has-tool-sidebar .transcribe-empty,
body.has-tool-sidebar .video-compress-empty {
  min-height: 156px !important;
}

body.has-tool-sidebar .transcribe-options {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px !important;
  align-items: end;
}

body.has-tool-sidebar .transcribe-access {
  grid-column: 1 / -1;
  color: #737373;
  font-size: 12px;
  font-weight: 500;
}

body.has-tool-sidebar .compress-settings-panel { gap: 18px !important; }

body.has-tool-sidebar .compress-preset-row {
  grid-template-columns: minmax(220px, 340px) minmax(0, 1fr);
  align-items: center;
}

body.has-tool-sidebar .compress-option-grid { gap: 14px !important; }

body.has-tool-sidebar .compress-option {
  min-height: 150px;
  padding: 18px !important;
}

body.has-tool-sidebar .converter-empty {
  align-content: center;
  grid-template-columns: 1fr !important;
  gap: 6px !important;
}

body.has-tool-sidebar .converter-empty strong,
body.has-tool-sidebar .converter-empty span {
  display: block;
  width: 100%;
  max-width: 520px;
  text-align: center;
}

.tool-sidebar-nav { overflow-anchor: none; }

@media (max-width: 900px) {
  .tool-access-gate { top: 128px; right: 14px; left: 14px; padding: 22px; }
  .tool-access-gate-card { padding: 28px 22px; }
  .tool-access-actions { flex-direction: column; }
  body.has-tool-sidebar .transcribe-options,
  body.has-tool-sidebar .compress-option-grid { grid-template-columns: 1fr; }
  body.has-tool-sidebar .compress-preset-row { grid-template-columns: 1fr; }
}

/* Falah CRM visual system -------------------------------------------------- */
body.has-tool-sidebar {
  --crm-accent: #0a84ff;
  --crm-accent-hover: #0070e0;
  --crm-accent-soft: #eff6ff;
  --crm-ink: #171717;
  --crm-muted: #737373;
  --crm-soft: #a3a3a3;
  --crm-line: rgba(229, 229, 229, 0.82);
  --crm-surface: #ffffff;
  --crm-canvas: #fafafa;
  --crm-radius: 14px;
  --crm-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.04);
  padding-left: 240px;
  background: var(--crm-canvas) !important;
  color: var(--crm-ink) !important;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  -webkit-font-smoothing: antialiased;
}

body.has-tool-sidebar main,
body.has-tool-sidebar .shell {
  width: min(1440px, calc(100% - 64px)) !important;
  padding: 38px 0 72px !important;
}

body.has-tool-sidebar main > header,
body.has-tool-sidebar .topbar {
  min-height: 68px;
  margin-bottom: 26px !important;
  padding-bottom: 22px !important;
  border-bottom-color: var(--crm-line) !important;
}

body.has-tool-sidebar main > header h1,
body.has-tool-sidebar .topbar h1 {
  color: var(--crm-ink) !important;
  font-size: 28px !important;
  font-weight: 650 !important;
  line-height: 1.15 !important;
  letter-spacing: -0.035em !important;
}

body.has-tool-sidebar .intro {
  max-width: 780px;
  margin-top: 5px !important;
  color: var(--crm-muted) !important;
  font-size: 13px !important;
  line-height: 1.55 !important;
  font-weight: 450 !important;
  letter-spacing: 0 !important;
}

.tool-sidebar {
  border-right-color: var(--crm-line);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: none;
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
}

.tool-sidebar-brand {
  height: 66px;
  flex-basis: 66px;
  padding: 0 20px;
}

.tool-sidebar-logo {
  width: 30px;
  height: 30px;
  flex-basis: 30px;
}

.tool-sidebar-brand a > span:last-child {
  font-size: 15px;
  letter-spacing: -0.025em;
}

.tool-sidebar-brand strong { font-weight: 650; }
.tool-sidebar-brand em { color: var(--crm-accent); font-weight: 550; }

.tool-sidebar-nav {
  padding: 6px 12px 20px;
  scrollbar-color: #d4d4d4 transparent;
}

.tool-sidebar-group + .tool-sidebar-group { margin-top: 20px; }

.tool-sidebar-group-label {
  margin: 0 12px 7px;
  color: var(--crm-soft);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.tool-sidebar-link {
  min-height: 43px;
  gap: 10px;
  border-radius: 12px;
  color: #66666d;
  padding: 6px 9px;
}

.tool-sidebar-link:hover {
  background: #f5f5f5;
  color: var(--crm-ink);
}

.tool-sidebar-link.is-active {
  background: var(--crm-accent-soft);
  color: #0070e0;
}

.tool-sidebar-glyph {
  width: 28px;
  height: 28px;
  flex-basis: 28px;
  border-color: #e5e5e5;
  border-radius: 8px;
  color: #737373;
  font-size: 8px;
}

.tool-sidebar-link.is-active .tool-sidebar-glyph {
  border-color: #bfdbfe;
  color: var(--crm-accent);
}

.tool-sidebar-link-copy strong {
  font-size: 12.5px;
  font-weight: 600;
}

.tool-sidebar-link-copy small {
  color: #a3a3a3;
  font-size: 8.5px;
}

.tool-sidebar-footer {
  border-top-color: var(--crm-line);
  padding: 12px;
}

.tool-sidebar-account {
  border-radius: 12px;
  padding: 7px;
}

.tool-sidebar-account:hover { background: #f5f5f5; }

.tool-sidebar-login,
.tool-sidebar-logout {
  min-height: 40px;
  border-color: #e5e5e5;
  border-radius: 12px;
  font-size: 11px;
}

body.has-tool-sidebar .tool,
body.has-tool-sidebar .panel,
body.has-tool-sidebar .result,
body.has-tool-sidebar .converter-shell,
body.has-tool-sidebar .transcribe-flow,
body.has-tool-sidebar .video-compress-flow,
body.has-tool-sidebar .overview,
body.has-tool-sidebar .doc-panel,
body.has-tool-sidebar .sidebar,
body.has-tool-sidebar .endpoint,
body.has-tool-sidebar .profile-card,
body.has-tool-sidebar .legal-card {
  border: 1px solid var(--crm-line) !important;
  border-radius: var(--crm-radius) !important;
  background: var(--crm-surface) !important;
  box-shadow: var(--crm-shadow) !important;
}

body.has-tool-sidebar .panel,
body.has-tool-sidebar .result,
body.has-tool-sidebar .overview,
body.has-tool-sidebar .doc-panel {
  padding: 22px !important;
}

body.has-tool-sidebar .workspace,
body.has-tool-sidebar .grid,
body.has-tool-sidebar .layout {
  gap: 16px !important;
}

body.has-tool-sidebar input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
body.has-tool-sidebar select,
body.has-tool-sidebar textarea {
  border: 1px solid #e5e5e5 !important;
  border-radius: 12px !important;
  background: #fff !important;
  color: var(--crm-ink) !important;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.015) !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  letter-spacing: 0 !important;
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

body.has-tool-sidebar input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
body.has-tool-sidebar select {
  min-height: 42px !important;
  padding-left: 13px !important;
  padding-right: 13px !important;
}

body.has-tool-sidebar input:focus,
body.has-tool-sidebar select:focus,
body.has-tool-sidebar textarea:focus {
  outline: 0 !important;
  border-color: rgba(10, 132, 255, 0.62) !important;
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.12) !important;
}

body.has-tool-sidebar label {
  color: #525252 !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  letter-spacing: 0 !important;
}

body.has-tool-sidebar button,
body.has-tool-sidebar .download,
body.has-tool-sidebar .primary,
body.has-tool-sidebar .primary-button,
body.has-tool-sidebar .ghost-button,
body.has-tool-sidebar .copy-button,
body.has-tool-sidebar .back-link,
body.has-tool-sidebar .back-button,
body.has-tool-sidebar .converter-add,
body.has-tool-sidebar .pick {
  min-height: 40px !important;
  border-radius: 12px !important;
  padding: 0 15px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  letter-spacing: 0 !important;
}

body.has-tool-sidebar button:not(.ghost-button):not(.copy-button):not(.icon-button):not(.remove-button):not(.format-trigger):not(.logo-dropzone):not(.logo-add-variant):not(.logo-variant-edit):not(.logo-variant-remove):not(.variant-close):not(.variant-cancel):not(.converter-empty):not([data-tool-mode]),
body.has-tool-sidebar .primary,
body.has-tool-sidebar .primary-button,
body.has-tool-sidebar .pick {
  background: var(--crm-accent) !important;
  color: #fff !important;
  box-shadow: 0 1px 2px rgba(0, 80, 180, 0.16) !important;
}

body.has-tool-sidebar button:not(.ghost-button):not(.copy-button):not(.icon-button):not(.remove-button):not(.format-trigger):not(.logo-dropzone):not(.logo-add-variant):not(.logo-variant-edit):not(.logo-variant-remove):not(.variant-close):not(.variant-cancel):not(.converter-empty):not([data-tool-mode]):hover,
body.has-tool-sidebar .primary:hover,
body.has-tool-sidebar .primary-button:hover,
body.has-tool-sidebar .pick:hover {
  background: var(--crm-accent-hover) !important;
  transform: translateY(-1px);
}

body.has-tool-sidebar .ghost-button,
body.has-tool-sidebar .copy-button,
body.has-tool-sidebar .format-trigger,
body.has-tool-sidebar .icon-button {
  border-color: #e5e5e5 !important;
  background: #fff !important;
  color: #404040 !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.035) !important;
}

body.has-tool-sidebar .dropzone,
body.has-tool-sidebar .upload-zone,
body.has-tool-sidebar .empty-state,
body.has-tool-sidebar .file-drop {
  border-color: #d4d4d4 !important;
  border-radius: var(--crm-radius) !important;
  background: #fafafa !important;
}

body.has-tool-sidebar .dropzone:hover,
body.has-tool-sidebar .upload-zone:hover,
body.has-tool-sidebar .file-drop:hover {
  border-color: #93c5fd !important;
  background: #f8fbff !important;
}

.tool-mode-route,
.dashboard-api-hint {
  min-height: 36px;
  border-color: #e5e5e5;
  border-radius: 11px;
  background: #fff;
  color: #737373;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.025);
}

.tool-mode-switch {
  border-color: #e5e5e5;
  border-radius: 12px;
  background: #f5f5f5;
}

.tool-mode-switch button { border-radius: 8px !important; }
.tool-mode-switch button.is-active { color: var(--crm-accent) !important; }

body.has-tool-sidebar.dashboard-page .tools { gap: 30px !important; }

.overview-group {
  gap: 13px;
  padding-bottom: 28px;
  border-bottom-color: var(--crm-line);
}

.overview-group-head h2 {
  color: var(--crm-ink) !important;
  font-size: 14px;
  font-weight: 650 !important;
  letter-spacing: -0.02em !important;
}

.overview-group-head > span { color: var(--crm-soft); font-size: 10px; }

.overview-group-grid {
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 14px;
}

body.has-tool-sidebar .tool {
  min-height: 164px !important;
  align-content: start;
  gap: 10px !important;
  padding: 20px !important;
}

body.has-tool-sidebar .tool:hover {
  border-color: #d4d4d4 !important;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.06) !important;
}

body.has-tool-sidebar .tool strong {
  color: var(--crm-ink) !important;
  font-size: 16px !important;
  font-weight: 650 !important;
  letter-spacing: -0.025em !important;
}

body.has-tool-sidebar .tool span {
  color: var(--crm-muted) !important;
  font-size: 12px !important;
  line-height: 1.55 !important;
}

.dashboard-page .tool-card-marker {
  border-color: #dbeafe;
  border-radius: 8px;
  background: #eff6ff;
  color: var(--crm-accent);
}

body.has-tool-sidebar pre,
body.has-tool-sidebar code:not(.tool-mode-route) {
  border-radius: 12px !important;
}

body.has-tool-sidebar table {
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
}

body.has-tool-sidebar th {
  background: #fafafa !important;
  color: #737373 !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

@media (max-width: 900px) {
  body.has-tool-sidebar { padding-left: 0; }
  body.has-tool-sidebar main,
  body.has-tool-sidebar .shell {
    width: min(100% - 28px, 760px) !important;
    padding-top: 72px !important;
  }

  body.has-tool-sidebar main > header h1,
  body.has-tool-sidebar .topbar h1 { font-size: 25px !important; }

  .tool-sidebar { width: min(280px, calc(100vw - 36px)); }
}

/* Exact reference proportions and surface hierarchy ---------------------- */
body.has-tool-sidebar main,
body.has-tool-sidebar .shell {
  width: min(1152px, calc(100vw - 240px)) !important;
  margin: 0 auto !important;
  padding: 32px 40px 64px !important;
}

body.has-tool-sidebar main > header,
body.has-tool-sidebar .topbar {
  min-height: 56px;
  margin: 0 0 24px !important;
  padding: 0 !important;
  border-bottom: 0 !important;
}

body.has-tool-sidebar main > header h1,
body.has-tool-sidebar .topbar h1 {
  font-size: 24px !important;
  font-weight: 600 !important;
  line-height: 32px !important;
  letter-spacing: -0.025em !important;
}

body.has-tool-sidebar .intro {
  margin-top: 4px !important;
  font-size: 14px !important;
  line-height: 20px !important;
  font-weight: 400 !important;
}

body.has-tool-sidebar .panel,
body.has-tool-sidebar .result,
body.has-tool-sidebar .converter-shell,
body.has-tool-sidebar .transcribe-flow,
body.has-tool-sidebar .video-compress-flow,
body.has-tool-sidebar .overview,
body.has-tool-sidebar .doc-panel,
body.has-tool-sidebar .endpoint,
body.has-tool-sidebar .profile-card,
body.has-tool-sidebar .legal-card,
body.has-tool-sidebar .tool {
  border-color: rgba(229, 229, 229, 0.7) !important;
  border-radius: 18px !important;
  background: #fff !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.04) !important;
}

body.has-tool-sidebar .workspace,
body.has-tool-sidebar .layout {
  gap: 16px !important;
}

body.has-tool-sidebar .panel,
body.has-tool-sidebar .result {
  padding: 24px !important;
}

body.has-tool-sidebar .dropzone,
body.has-tool-sidebar .upload-zone,
body.has-tool-sidebar .file-drop,
body.has-tool-sidebar .empty-state {
  min-height: 168px;
  border-radius: 14px !important;
  background: #fff !important;
}

body.has-tool-sidebar .actions {
  gap: 12px !important;
  margin-top: 20px !important;
}

body.has-tool-sidebar button,
body.has-tool-sidebar .download,
body.has-tool-sidebar .primary,
body.has-tool-sidebar .primary-button,
body.has-tool-sidebar .ghost-button,
body.has-tool-sidebar .copy-button,
body.has-tool-sidebar .converter-add,
body.has-tool-sidebar .pick {
  min-height: 40px !important;
  border-radius: 12px !important;
  padding: 0 16px !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  line-height: 20px !important;
}

.tool-mode-route {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.tool-mode-switch {
  min-height: 40px;
  border: 0;
  border-radius: 12px;
  background: #f5f5f5;
  padding: 4px;
}

.tool-mode-switch button {
  min-height: 32px !important;
  border-radius: 9px !important;
  font-size: 13px !important;
  font-weight: 500 !important;
}

.tool-mode-switch button.is-active {
  color: #171717 !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08) !important;
}

.tool-api-view {
  display: block;
  overflow: hidden;
  border: 1px solid rgba(229, 229, 229, 0.7);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.04);
}

.tool-api-view[hidden] { display: none !important; }

.tool-api-frame-head {
  min-height: 88px;
  padding: 22px 24px;
  border: 0;
  border-bottom: 1px solid rgba(229, 229, 229, 0.7);
  border-radius: 0;
  background: #fff;
  box-shadow: none;
}

.tool-api-frame-head span {
  color: #737373;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.tool-api-frame-head strong {
  margin-top: 4px;
  color: #262626;
  font-size: 16px;
  font-weight: 600;
}

.tool-api-frame-head p {
  color: #737373 !important;
  font-size: 13px;
  line-height: 20px;
}

.tool-api-view iframe { background: #fff; }

html.api-embed main {
  padding: 0 !important;
}

html.api-embed .doc-panel {
  overflow: visible !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: #fff !important;
  box-shadow: none !important;
}

html.api-embed .doc-head {
  padding: 24px !important;
  border-bottom: 1px solid rgba(229, 229, 229, 0.7) !important;
}

html.api-embed .doc-body {
  gap: 20px !important;
  padding: 24px !important;
}

html.api-embed .meta-grid {
  gap: 12px !important;
}

html.api-embed .meta-card {
  border: 0 !important;
  border-radius: 12px !important;
  background: #fafafa !important;
  box-shadow: none !important;
  padding: 14px !important;
}

html.api-embed .sub-panel,
html.api-embed .code-panel {
  border: 1px solid rgba(229, 229, 229, 0.7) !important;
  border-radius: 14px !important;
  background: #fff !important;
  box-shadow: none !important;
}

html.api-embed .sub-head,
html.api-embed .code-head {
  min-height: 52px !important;
  border-bottom-color: rgba(229, 229, 229, 0.7) !important;
}

html.api-embed pre {
  min-height: 220px;
  border: 0 !important;
  border-radius: 0 !important;
  background: #171717 !important;
  box-shadow: none !important;
}

html.api-embed .hint {
  border-left-color: #0a84ff !important;
  background: #eff6ff !important;
  color: #075fb7 !important;
}

body.has-tool-sidebar.dashboard-page .tools { gap: 32px !important; }

.overview-group-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

body.has-tool-sidebar .tool {
  min-height: 184px !important;
  padding: 24px !important;
}

@media (max-width: 1180px) {
  body.has-tool-sidebar main,
  body.has-tool-sidebar .shell {
    width: calc(100vw - 240px) !important;
    padding-right: 32px !important;
    padding-left: 32px !important;
  }

  .overview-group-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  body.has-tool-sidebar main,
  body.has-tool-sidebar .shell {
    width: 100% !important;
    padding: 72px 14px 48px !important;
  }

  .overview-group-grid { grid-template-columns: 1fr; }
  .tool-api-frame-head { align-items: flex-start; }
}

/* Tool-specific surface cleanup ------------------------------------------ */
body.has-tool-sidebar .logo-builder,
body.has-tool-sidebar .converter-shell,
body.has-tool-sidebar .video-compress-flow,
body.has-tool-sidebar .transcribe-flow {
  overflow: hidden !important;
  border: 1px solid rgba(229, 229, 229, 0.7) !important;
  border-radius: 18px !important;
  background: #fff !important;
  box-shadow: var(--crm-shadow) !important;
}

/* Logo exporter */
body.has-tool-sidebar .logo-export-page {
  width: 100% !important;
  max-width: none !important;
  padding-right: 40px !important;
  padding-left: 40px !important;
}

body.has-tool-sidebar .logo-source-panel,
body.has-tool-sidebar .logo-variants-panel {
  padding: 24px !important;
}

body.has-tool-sidebar .logo-source-panel {
  background: #fff !important;
}

body.has-tool-sidebar button.logo-dropzone {
  display: grid !important;
  min-height: 176px !important;
  border: 1px dashed #d4d4d4 !important;
  border-radius: 14px !important;
  background: #fafafa !important;
  color: #262626 !important;
  box-shadow: none !important;
  padding: 24px !important;
}

body.has-tool-sidebar button.logo-dropzone:hover,
body.has-tool-sidebar button.logo-dropzone.is-over {
  border-color: #93c5fd !important;
  background: #f8fbff !important;
  transform: none !important;
}

body.has-tool-sidebar .logo-add-icon {
  border-color: #d4d4d4;
  border-radius: 10px;
  background: #fff;
  color: #0a84ff;
}

body.has-tool-sidebar button.logo-add-variant,
body.has-tool-sidebar button.logo-variant-edit,
body.has-tool-sidebar button.logo-variant-remove,
body.has-tool-sidebar button.variant-close,
body.has-tool-sidebar button.variant-cancel {
  border: 1px solid #e5e5e5 !important;
  background: #fff !important;
  color: #404040 !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.035) !important;
}

body.has-tool-sidebar button.logo-variant-remove {
  color: #b42318 !important;
}

body.has-tool-sidebar .logo-variant-row {
  min-height: 74px;
  border-color: #e5e5e5;
  border-radius: 12px;
  padding: 10px 12px;
}

body.has-tool-sidebar button.logo-export-button,
body.has-tool-sidebar button.variant-save {
  background: #0a84ff !important;
  border-color: #0a84ff !important;
  color: #fff !important;
}

/* File converter */
body.has-tool-sidebar.converter-page .panel {
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

body.has-tool-sidebar .converter-toolbar {
  min-height: 72px;
  border: 0 !important;
  border-bottom: 1px solid rgba(229, 229, 229, 0.7) !important;
  border-radius: 0 !important;
  background: #fff !important;
  padding: 14px 18px !important;
}

body.has-tool-sidebar .converter-add {
  min-height: 42px;
  border-color: #e5e5e5;
  border-radius: 12px;
  color: #262626;
  font-size: 13px;
  font-weight: 600;
  padding: 0 14px;
}

body.has-tool-sidebar .converter-add-mark {
  width: 24px;
  height: 24px;
  border-width: 1.5px;
  border-radius: 7px;
  color: #0a84ff;
}

body.has-tool-sidebar .converter-help {
  color: #737373;
  font-size: 12px;
  font-weight: 500;
}

body.has-tool-sidebar .converter-card {
  border: 0 !important;
  border-radius: 0 !important;
}

body.has-tool-sidebar button.converter-empty {
  display: grid !important;
  width: calc(100% - 36px) !important;
  min-height: 220px !important;
  margin: 18px !important;
  border: 1px dashed #d4d4d4 !important;
  border-radius: 14px !important;
  background: #fafafa !important;
  color: #737373 !important;
  box-shadow: none !important;
  padding: 32px !important;
}

body.has-tool-sidebar button.converter-empty:hover,
body.has-tool-sidebar .converter-card.is-over button.converter-empty {
  border-color: #93c5fd !important;
  background: #f8fbff !important;
  transform: none !important;
}

body.has-tool-sidebar button.converter-empty strong {
  color: #262626 !important;
  font-size: 17px !important;
  font-weight: 600 !important;
}

body.has-tool-sidebar button.converter-empty span {
  color: #737373 !important;
  font-size: 13px !important;
  font-weight: 400 !important;
}

body.has-tool-sidebar .converter-controls {
  border-color: rgba(229, 229, 229, 0.7) !important;
  background: #fafafa !important;
  padding: 16px 18px !important;
}

/* Transcription and video compression */
body.has-tool-sidebar.video-compress-page .panel,
body.has-tool-sidebar.transcription-page .panel {
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

body.has-tool-sidebar .video-compress-flow,
body.has-tool-sidebar .transcribe-flow {
  gap: 0 !important;
}

body.has-tool-sidebar .video-compress-upload,
body.has-tool-sidebar .transcribe-upload {
  border: 0 !important;
  border-bottom: 1px solid rgba(229, 229, 229, 0.7) !important;
  border-radius: 0 !important;
  background: #fff !important;
  padding: 22px 24px !important;
}

body.has-tool-sidebar .video-compress-list,
body.has-tool-sidebar .transcribe-list {
  padding: 0 24px;
}

body.has-tool-sidebar .video-compress-empty,
body.has-tool-sidebar .transcribe-empty {
  min-height: 190px;
  border: 0 !important;
  border-bottom: 1px solid rgba(229, 229, 229, 0.7) !important;
  border-radius: 0 !important;
  color: #737373;
  font-size: 14px;
  font-weight: 500;
}

body.has-tool-sidebar .compress-settings-panel,
body.has-tool-sidebar .transcribe-options {
  border: 0 !important;
  border-radius: 0 !important;
  background: #fff !important;
  box-shadow: none !important;
  padding: 22px 24px !important;
}

body.has-tool-sidebar .compress-option {
  border-color: #e5e5e5 !important;
  border-radius: 14px !important;
  background: #fafafa !important;
  box-shadow: none !important;
}

body.has-tool-sidebar .video-compress-add,
body.has-tool-sidebar .transcribe-add {
  min-height: 42px;
  border-radius: 12px;
  background: #171717;
  font-size: 13px;
  font-weight: 600;
}

body.has-tool-sidebar .video-compress-hint,
body.has-tool-sidebar .transcribe-hint,
body.has-tool-sidebar .compress-note {
  color: #737373;
  font-size: 12px;
  font-weight: 500;
}

@media (max-width: 900px) {
  body.has-tool-sidebar .logo-export-page {
    padding-right: 14px !important;
    padding-left: 14px !important;
  }
}

/* Final workflow sizing (kept last to override legacy inline tool CSS) */
body.has-tool-sidebar .transcribe-upload,
body.has-tool-sidebar .video-compress-upload {
  min-height: 116px !important;
  gap: 12px !important;
}

body.has-tool-sidebar .transcribe-empty,
body.has-tool-sidebar .video-compress-empty {
  min-height: 156px !important;
}

body.has-tool-sidebar .transcribe-options {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px !important;
  align-items: end;
}

body.has-tool-sidebar .transcribe-access {
  grid-column: 1 / -1;
  color: #737373;
  font-size: 12px;
  font-weight: 500;
}

body.has-tool-sidebar .compress-settings-panel { gap: 18px !important; }

body.has-tool-sidebar .compress-preset-row {
  grid-template-columns: minmax(220px, 340px) minmax(0, 1fr);
  align-items: center;
}

body.has-tool-sidebar .compress-option-grid { gap: 14px !important; }

body.has-tool-sidebar .compress-option {
  min-height: 150px;
  padding: 18px !important;
}

body.has-tool-sidebar button.converter-empty {
  align-content: center;
  grid-template-columns: 1fr !important;
  gap: 6px !important;
}

body.has-tool-sidebar button.converter-empty strong,
body.has-tool-sidebar button.converter-empty span {
  display: block;
  width: 100%;
  max-width: 520px;
  margin-inline: auto;
  text-align: center;
}

@media (max-width: 900px) {
  body.has-tool-sidebar .transcribe-options,
  body.has-tool-sidebar .compress-option-grid,
  body.has-tool-sidebar .compress-preset-row {
    grid-template-columns: 1fr;
  }
}

/* Final component polish: one radius, one shadow, readable actions -------- */
body.has-tool-sidebar .converter-toolbar,
body.has-tool-sidebar .converter-card,
body.has-tool-sidebar .converter-controls,
body.has-tool-sidebar .transcribe-upload,
body.has-tool-sidebar .transcribe-list,
body.has-tool-sidebar .transcribe-empty,
body.has-tool-sidebar .transcribe-options,
body.has-tool-sidebar .video-compress-upload,
body.has-tool-sidebar .video-compress-list,
body.has-tool-sidebar .video-compress-empty,
body.has-tool-sidebar .compress-settings-panel {
  box-shadow: none !important;
}

body.has-tool-sidebar .converter-card,
body.has-tool-sidebar .converter-controls {
  border-radius: 0 !important;
}

body.has-tool-sidebar .converter-card {
  background: #fff !important;
}

body.has-tool-sidebar .converter-controls {
  border: 0 !important;
  border-top: 1px solid rgba(229, 229, 229, .75) !important;
  background: #fafafa !important;
}

body.has-tool-sidebar label.converter-add,
body.has-tool-sidebar label.transcribe-add,
body.has-tool-sidebar label.video-compress-add {
  min-height: 42px !important;
  border: 1px solid #e5e5e5 !important;
  border-radius: 12px !important;
  background: #fff !important;
  color: #262626 !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .035) !important;
  padding: 0 14px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
}

body.has-tool-sidebar label.converter-add:hover,
body.has-tool-sidebar label.transcribe-add:hover,
body.has-tool-sidebar label.video-compress-add:hover {
  border-color: #bfdbfe !important;
  background: #f8fbff !important;
}

body.has-tool-sidebar .converter-add-mark,
body.has-tool-sidebar .transcribe-add-mark,
body.has-tool-sidebar .video-compress-add-mark {
  color: #0a84ff !important;
}

body.has-tool-sidebar #run,
body.has-tool-sidebar button.logo-export-button,
body.has-tool-sidebar button.variant-save {
  min-height: 42px !important;
  border: 1px solid #0a84ff !important;
  border-radius: 12px !important;
  background: #0a84ff !important;
  color: #fff !important;
  box-shadow: 0 1px 2px rgba(0, 80, 180, .16) !important;
  padding: 0 16px !important;
}

body.has-tool-sidebar #run:hover,
body.has-tool-sidebar button.logo-export-button:hover,
body.has-tool-sidebar button.variant-save:hover {
  border-color: #0070e0 !important;
  background: #0070e0 !important;
}

body.has-tool-sidebar .transcribe-empty,
body.has-tool-sidebar .video-compress-empty {
  background: #fafafa !important;
  padding: 24px !important;
}

body.has-tool-sidebar .transcribe-access {
  min-height: 42px;
  padding: 0 24px 22px !important;
  line-height: 20px;
}

body.has-tool-sidebar.transcription-page .actions,
body.has-tool-sidebar.video-compress-page .actions {
  margin-top: 16px !important;
  padding: 0 !important;
}

body.has-tool-sidebar.converter-page .actions {
  min-height: 72px;
  margin-top: 16px !important;
  border: 1px solid rgba(229, 229, 229, .8) !important;
  border-radius: 18px !important;
  background: #fff !important;
  box-shadow: var(--crm-shadow) !important;
  padding: 14px 16px !important;
}

body.has-tool-sidebar .compress-option {
  box-shadow: none !important;
}
