:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --page-bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f3f5f8;
  --text: #17181c;
  --muted: #667085;
  --line: #e3e7ee;
  --accent: #e5322d;
  --accent-2: #b42318;
  --accent-3: #f97316;
  --accent-4: #2563eb;
  --ok: #157f3b;
  --bad: #b42318;
  --shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 18px 45px rgba(15, 23, 42, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--page-bg);
  color: var(--text);
  font-family: "DM Sans", "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
  scroll-behavior: smooth;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

a,
button,
input,
select,
textarea {
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 28%, transparent);
  outline-offset: 2px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 68px;
  padding: 10px clamp(12px, 3vw, 24px);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(16px);
  box-shadow: 0 1px 18px rgba(16, 32, 39, 0.06);
}

.brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  color: inherit;
  text-decoration: none;
  border-radius: 10px;
}

.eyebrow {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}

.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: 9px;
  object-fit: cover;
  box-shadow: none;
}

.site-links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
}

.site-links a {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 800;
}

.site-links a:hover,
.site-links a.active {
  background: var(--surface-2);
  color: var(--accent);
}

.site-links a.active {
  box-shadow: inset 0 -2px 0 var(--accent);
}

.top-nav {
  display: flex;
  align-items: stretch;
  gap: 0;
  min-height: 48px;
  margin-left: 20px;
  margin-right: auto;
}

.top-nav > a,
.top-mega-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 48px;
  padding: 0 18px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #12151b;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
}

.top-nav > a:hover,
.top-nav > a.active,
.top-mega-toggle:hover,
.top-mega-toggle.active,
.top-mega-toggle[aria-expanded="true"] {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 7%, transparent);
}

.top-nav > a.active::after,
.top-mega-toggle.active::after,
.top-mega-toggle[aria-expanded="true"]::after {
  content: "";
  position: absolute;
  right: 16px;
  bottom: 0;
  left: 16px;
  height: 3px;
  border-radius: 999px 999px 0 0;
  background: var(--accent);
}

.top-mega-toggle svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.3;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.18s ease;
}

.top-mega-toggle[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.top-mega-menu {
  position: absolute;
  top: calc(100% + 12px);
  right: 10px;
  left: 10px;
  z-index: 60;
  border: 1px solid color-mix(in srgb, var(--line) 72%, white);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 16px 44px rgba(15, 23, 42, 0.14);
}

.top-mega-menu[hidden] {
  display: none;
}

.top-mega-menu::before {
  content: "";
  position: absolute;
  top: -7px;
  left: min(60vw, 810px);
  width: 14px;
  height: 14px;
  border-top: 1px solid color-mix(in srgb, var(--line) 72%, white);
  border-left: 1px solid color-mix(in srgb, var(--line) 72%, white);
  background: var(--surface);
  transform: rotate(45deg);
}

.top-mega-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 32px 0;
}

.top-mega-head strong,
.top-mega-head span {
  display: block;
}

.top-mega-head strong {
  color: var(--text);
  font-size: 1rem;
  font-weight: 900;
}

.top-mega-head span {
  color: var(--muted);
  font-size: 12px;
}

.top-mega-inner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 24px;
  max-height: min(68vh, 620px);
  overflow: auto;
  padding: 24px 32px 30px;
}

.top-mega-column {
  display: grid;
  align-content: start;
  gap: 16px;
  min-width: 0;
}

.top-mega-column h3 {
  margin: 0;
  color: #71757f;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.top-mega-list {
  display: grid;
  gap: 12px;
}

.top-mega-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 32px;
  color: #1f232b;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.25;
  text-decoration: none;
}

.top-mega-item:hover,
.top-mega-item.active {
  color: #e5322d;
}

.top-mega-item span {
  overflow-wrap: anywhere;
}

.tool-icon.mini {
  width: 28px;
  height: 28px;
    border-radius: 8px;
  background: color-mix(in srgb, currentColor 13%, white);
  color: currentColor;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 24%, transparent);
}

.tool-icon.mini svg {
  width: 17px;
  height: 17px;
  stroke-width: 2.2;
}

.sidebar {
  display: none !important;
  position: fixed;
  inset: 68px auto 0 0;
  z-index: 10;
  width: 292px;
  overflow: auto;
  border-right: 1px solid var(--line);
  background: var(--surface);
  padding: 14px 14px 18px;
}

.sidebar-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: grid;
  gap: 8px;
  margin: -14px -14px 12px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  backdrop-filter: blur(10px);
}

.sidebar-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sidebar-close {
  display: none;
}

.sidebar-backdrop {
  display: none !important;
}

.sidebar-head label {
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.sidebar-head input {
  min-height: 38px;
  border-radius: 10px;
}

#toolNav {
  display: grid;
  gap: 10px;
}

.nav-family-menu,
.nav-group-menu {
  display: grid;
  gap: 6px;
}

.nav-family-menu > summary,
.nav-group-menu summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 46px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface-2) 48%, var(--surface));
  cursor: pointer;
  list-style: none;
}

.nav-family-menu > summary {
  min-height: 58px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 10%, var(--surface)), var(--surface));
  border-color: color-mix(in srgb, var(--accent) 20%, var(--line));
}

.nav-family-menu > summary > span:not(.tool-icon) {
  min-width: 0;
  flex: 1 1 auto;
}

.nav-family-menu > summary:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.07);
}

.nav-family-groups {
  display: grid;
  gap: 8px;
  padding-left: 10px;
}

.nav-family-groups .nav-group-menu {
  border-left: 1px solid var(--line);
  padding-left: 9px;
}

.nav-family-groups .nav-group-menu summary {
  min-height: 42px;
  border-radius: 10px;
  background: transparent;
}

.nav-family-menu[open] > summary {
  color: var(--accent);
}

.nav-family-menu > summary::-webkit-details-marker,
.nav-group-menu summary::-webkit-details-marker {
  display: none;
}

.nav-family-menu summary strong,
.nav-group-menu summary strong {
  display: block;
  font-size: 0.92rem;
}

.nav-family-menu summary small,
.nav-group-menu summary small {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.nav-family-menu summary b,
.nav-group-menu summary b {
  display: inline-grid;
  min-width: 28px;
  min-height: 24px;
  place-items: center;
  border-radius: 999px;
  background: var(--surface);
  color: var(--accent);
  font-size: 12px;
}

.nav-group-items {
  display: grid;
  gap: 5px;
  padding: 4px 0 2px 10px;
  border-left: 1px solid var(--line);
  margin-left: 13px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  text-align: left;
  text-decoration: none;
}

.nav-item > span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.nav-item strong,
.nav-item small {
  overflow-wrap: anywhere;
}

.nav-item.active,
.nav-item:hover {
  border-color: var(--line);
  background: var(--surface-2);
}

.nav-item.active {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
  color: var(--accent);
  box-shadow: inset 3px 0 0 var(--accent);
}

.nav-item .tool-icon {
  flex: 0 0 auto;
}

.nav-empty {
  padding: 10px;
}

.workspace {
  margin-left: 0;
  padding: clamp(16px, 2.4vw, 28px);
  max-width: none;
}

.tool-finder-landing {
  display: none;
}

body.finder-mode .sidebar,
body.finder-mode .sidebar-backdrop,
body.finder-mode .upload-band,
body.finder-mode .status-strip,
body.finder-mode .content-grid,
body.finder-mode .results-panel {
  display: none;
}

body.finder-mode .workspace {
  display: grid;
  min-height: calc(100vh - 68px);
  max-width: none;
  margin-left: 0;
  padding: clamp(34px, 8vw, 96px) clamp(16px, 5vw, 72px);
  place-items: start center;
}

body.finder-mode .menu-toggle {
  display: none;
}

body.finder-mode .tool-finder-landing {
  display: grid;
  width: min(980px, 100%);
  gap: 20px;
  text-align: left;
}

.finder-shell {
  display: grid;
  width: 100%;
  gap: 22px;
}

.finder-search {
  gap: 12px;
  color: var(--text);
  font-size: clamp(1.35rem, 3vw, 2.4rem);
  font-weight: 900;
  text-align: center;
}

.finder-search input {
  min-height: 68px;
  border: 2px solid color-mix(in srgb, var(--accent) 18%, var(--line));
  border-radius: 16px;
  padding: 16px 20px;
  background:
    linear-gradient(white, white) padding-box,
    linear-gradient(90deg, color-mix(in srgb, var(--accent) 55%, var(--line)), var(--line)) border-box;
  font-size: 1.06rem;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
}

.finder-results {
  width: 100%;
  padding-top: 4px;
  text-align: left;
}

.finder-results-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  padding-top: 4px;
}

.finder-results-head h2 {
  margin: 0;
  font-size: 1.02rem;
}

.finder-results-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.finder-empty {
  grid-column: 1 / -1;
  margin: 0;
  text-align: center;
}

.upload-band {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  min-height: 156px;
  padding: clamp(22px, 3vw, 34px);
  border: 1px solid color-mix(in srgb, var(--accent) 16%, var(--line));
  border-radius: 14px;
  background:
    radial-gradient(circle at 18% 40%, rgba(229, 50, 45, 0.16), transparent 24%),
    radial-gradient(circle at 78% 34%, rgba(37, 99, 235, 0.14), transparent 25%),
    radial-gradient(circle at 52% 92%, rgba(16, 185, 129, 0.12), transparent 28%),
    linear-gradient(135deg, #fff6f6, #f7fbff 55%, #f8fff9),
    var(--surface);
  box-shadow: var(--shadow);
  color: var(--text);
  overflow: hidden;
}

.upload-band.dragover {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 2px var(--accent);
}

.upload-art {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.upload-art span {
  position: absolute;
  width: 78px;
  height: 78px;
  border-radius: 18px;
  opacity: 0.38;
  transform: rotate(14deg);
}

.upload-art span:nth-child(1) {
  top: 22px;
  left: 10%;
  background: color-mix(in srgb, var(--accent) 28%, white);
}

.upload-art span:nth-child(2) {
  right: 18%;
  bottom: 16px;
  background: color-mix(in srgb, var(--accent-2) 24%, white);
}

.upload-art span:nth-child(3) {
  top: 18px;
  right: 7%;
  background: color-mix(in srgb, var(--accent-4) 24%, white);
}

.upload-band .primary-button {
  position: relative;
  z-index: 1;
  min-height: 46px;
  min-width: 148px;
  border-color: var(--accent);
  background: var(--accent);
  color: white;
  box-shadow: 0 10px 24px rgba(229, 50, 45, 0.18);
}

.upload-band .primary-button:hover {
  transform: translateY(-1px);
}

body.selected-tool-mode .upload-band {
  min-height: 128px;
  padding: 22px 28px;
  box-shadow: var(--shadow);
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, max-content)) 1fr;
  gap: 12px;
  align-items: center;
  margin: 14px 0;
}

.status-strip > div {
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.metric {
  margin-right: 4px;
  color: var(--accent);
  font-size: 22px;
  font-weight: 800;
}

.progress-shell {
  overflow: hidden;
  padding: 0 !important;
}

.progress-shell span {
  display: block;
  width: 0%;
  height: 100%;
  min-height: 44px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.24s ease;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.72fr) minmax(560px, 1.28fr);
  gap: 16px;
  align-items: start;
}

.tool-panel {
  grid-column: 1 / -1;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 54px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-2) 34%, transparent);
}

.panel h2,
.panel h3 {
  margin: 0;
}

.file-list,
.preview-surface,
#toolBody,
.results {
  padding: 16px;
}

.file-list {
  display: grid;
  gap: 8px;
  max-height: 560px;
  overflow: auto;
}

.file-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  width: 100%;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  color: inherit;
  text-align: left;
}

.file-select {
  display: grid;
  gap: 4px;
  min-width: 0;
  min-height: 76px;
  padding: 12px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.file-select strong {
  overflow-wrap: anywhere;
}

.file-remove {
  align-self: start;
  min-width: 30px;
  min-height: 30px;
  margin: 8px 8px 0 0;
  border-radius: 8px;
  color: var(--bad);
  font-weight: 800;
}

.file-card.active {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}

.file-card:hover {
  border-color: color-mix(in srgb, var(--accent) 34%, var(--line));
  transform: translateY(-1px);
}

.file-meta,
.hint,
.result-meta {
  color: var(--muted);
  font-size: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  width: max-content;
  min-height: 22px;
  padding: 3px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.tool-icon {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: color-mix(in srgb, currentColor 11%, var(--surface));
  color: var(--accent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 18%, transparent);
}

.tool-icon svg {
  width: 21px;
  height: 21px;
}

.tool-icon.small {
  width: 30px;
  height: 30px;
  border-radius: 8px;
}

.tool-icon.small svg {
  width: 17px;
  height: 17px;
}

.tool-icon.large {
  width: 48px;
  height: 48px;
  border-radius: 12px;
}

.tool-icon.large svg {
  width: 25px;
  height: 25px;
}

.tone-pdf {
  color: #e5322d;
}

.tone-image {
  color: #475467;
}

.tone-audio {
  color: #667085;
}

.tone-convert {
  color: #475467;
}

.tone-security {
  color: #667085;
}

.tone-data {
  color: #475467;
}

.tone-utility {
  color: #667085;
}

.tone-document {
  color: #475467;
}

.preview-surface {
  min-height: 420px;
  max-height: 640px;
  overflow: auto;
  background:
    linear-gradient(45deg, color-mix(in srgb, var(--line) 45%, transparent) 25%, transparent 25%),
    linear-gradient(-45deg, color-mix(in srgb, var(--line) 45%, transparent) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, color-mix(in srgb, var(--line) 45%, transparent) 75%),
    linear-gradient(-45deg, transparent 75%, color-mix(in srgb, var(--line) 45%, transparent) 75%);
  background-color: var(--surface);
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  background-size: 20px 20px;
  border-radius: 0 0 12px 12px;
}

.preview-surface img,
.preview-surface canvas {
  max-width: 100%;
  height: auto;
}

.audio-preview {
  display: grid;
  gap: 12px;
}

.audio-preview audio {
  width: 100%;
}

.preview-surface pre,
.code-box,
textarea {
  width: 100%;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-2) 70%, transparent);
  color: inherit;
  padding: 12px;
}

.preview-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.featured-tool-grid {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.dense-tool-grid {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.tool-card {
  display: grid;
  align-content: start;
  gap: 9px;
  min-height: 116px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: inherit;
  text-align: left;
  text-decoration: none;
}

.featured-tool-card {
  min-height: 118px;
}

.tool-card:hover {
  border-color: color-mix(in srgb, var(--accent) 36%, var(--line));
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  transform: translateY(-2px);
}

.tool-card strong {
  font-size: 1rem;
  line-height: 1.25;
}

.form-grid {
  display: grid;
  gap: 12px;
}

.dashboard-note {
  display: grid;
  gap: 3px;
  padding: 14px 16px;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line));
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 7%, var(--surface));
}

.dashboard-note span {
  color: var(--muted);
  font-size: 13px;
}

.tool-usage-guide {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 7%, var(--surface));
}

.tool-usage-guide h3 {
  margin: 2px 0 4px;
}

.usage-steps {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: 13px;
}

.dashboard-family-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.family-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 112px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, var(--surface), color-mix(in srgb, var(--surface-2) 48%, var(--surface)));
  color: inherit;
  text-decoration: none;
}

.family-card:hover {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.09);
  transform: translateY(-2px);
}

.family-card strong {
  display: block;
  margin-bottom: 3px;
  font-size: 1rem;
}

.family-card small,
.family-card b {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.family-card b {
  grid-column: 2;
  font-weight: 800;
}

.tool-family-section {
  display: grid;
  gap: 14px;
  padding-top: 12px;
  scroll-margin-top: 90px;
}

.tool-family-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.tool-family-head h3 {
  margin: 2px 0 0;
}

.dashboard-group-grid {
  display: grid;
  gap: 18px;
}

.dashboard-group-card {
  display: grid;
  gap: 10px;
}

.dashboard-group-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.dashboard-group-head h4 {
  margin: 2px 0 0;
  font-size: 1rem;
}

.dashboard-group-head > span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.converter-summary {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line));
  border-radius: 12px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 8%, var(--surface)), var(--surface));
}

.converter-summary h3 {
  margin: 2px 0 4px;
}

.conversion-flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.conversion-flow span {
  min-height: 44px;
  display: grid;
  place-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  text-align: center;
  font-weight: 800;
}

.conversion-flow b {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.tool-category-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.category-pill {
  display: grid;
  gap: 2px;
  min-height: 68px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: inherit;
  text-decoration: none;
}

.category-pill:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

.category-pill span {
  color: var(--muted);
  font-size: 12px;
}

.tool-category-section {
  display: grid;
  gap: 12px;
  padding-top: 8px;
  scroll-margin-top: 90px;
}

.tool-category-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  padding-top: 4px;
  border-top: 1px solid var(--line);
}

.tool-category-head h3 {
  margin-top: 2px;
}

.tool-category-head > span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.compact-tool-card {
  min-height: 92px;
}

.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.three-col {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.four-col {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.image-tool-canvas {
  max-width: 100%;
  min-height: 220px;
  object-fit: contain;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

input,
select,
textarea {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  padding: 8px 10px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 13%, transparent);
  outline: none;
}

input[type="color"] {
  padding: 2px;
}

input[type="range"] {
  padding: 0;
}

textarea {
  min-height: 150px;
  resize: vertical;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.primary-button,
.secondary-button,
.ghost-button,
.text-button,
.icon-button {
  min-height: 38px;
  border-radius: 10px;
  border: 1px solid var(--line);
  padding: 8px 12px;
  background: var(--surface);
  color: var(--text);
}

.primary-button {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
  font-weight: 700;
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover,
.icon-button:hover {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
}

.secondary-button {
  background: var(--surface-2);
}

.ghost-button,
.text-button,
.icon-button {
  background: transparent;
}

.text-button {
  min-height: auto;
  padding: 4px 7px;
  border-color: transparent;
  color: var(--accent);
}

.icon-button {
  display: inline-grid;
  min-width: 34px;
  padding: 6px;
  place-items: center;
}

.icon-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.results {
  display: grid;
  gap: 8px;
}

.result-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface-2) 54%, transparent);
}

.result-card a {
  color: var(--accent);
  font-weight: 700;
}

.empty-note {
  color: var(--muted);
}

.table-wrap {
  max-width: 100%;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
}

th,
td {
  min-width: 92px;
  padding: 8px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

td[contenteditable="true"] {
  background: color-mix(in srgb, var(--accent) 7%, transparent);
}

.canvas-stage {
  display: grid;
  place-items: center;
  min-height: 260px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.editor-surface {
  min-height: 260px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  outline: none;
}

.diff-added {
  background: color-mix(in srgb, #22c55e 24%, transparent);
}

.diff-removed {
  background: color-mix(in srgb, #ef4444 22%, transparent);
  text-decoration: line-through;
}

.diff-equal {
  color: var(--muted);
}

.diff-side-by-side {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.diff-panel {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.diff-panel pre {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

dialog {
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.44);
}

.dialog-card {
  width: min(480px, calc(100vw - 24px));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  max-width: min(420px, calc(100vw - 36px));
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--text);
  opacity: 0;
  transform: translateY(12px);
  transition: 0.2s ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1180px) {
  .content-grid {
    grid-template-columns: 1fr 1fr;
  }

  .tool-panel {
    grid-column: 1 / -1;
  }

  .top-nav > a,
  .top-mega-toggle {
    padding-inline: 11px;
    font-size: 12px;
  }

  .top-mega-inner {
    grid-template-columns: repeat(3, minmax(170px, 1fr));
  }
}

@media (max-width: 860px) {
  body.sidebar-open {
    overflow: hidden;
  }

  .topbar {
    gap: 8px;
    min-height: 62px;
  }

  .site-links,
  .top-nav {
    display: none;
  }

  .menu-toggle {
    display: inline-grid;
    min-width: 42px;
    font-weight: 800;
  }

  .sidebar {
    inset: 62px auto 0 0;
    z-index: 31;
    width: min(320px, 86vw);
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: var(--shadow-lg);
    padding-bottom: 88px;
  }

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

  .sidebar-close {
    display: inline-grid;
    min-width: 34px;
    min-height: 34px;
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 62px 0 0;
    z-index: 30;
    display: block;
    background: rgba(15, 23, 42, 0.48);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
  }

  .sidebar-backdrop.open {
    opacity: 1;
    pointer-events: auto;
  }

  .workspace {
    margin-left: 0;
    padding: 10px;
  }

  body.finder-mode .workspace {
    min-height: calc(100vh - 62px);
    padding: 18px 12px;
  }

  body.finder-mode .tool-finder-landing {
    gap: 16px;
  }

  .finder-search input {
    min-height: 52px;
  }

  .upload-band,
  .status-strip,
  .content-grid,
  .two-col,
  .three-col,
  .four-col {
    grid-template-columns: 1fr;
  }

  .upload-band {
    gap: 14px;
    align-items: center;
    min-height: 118px;
    padding: 22px;
  }

  .dashboard-family-grid,
  .featured-tool-grid,
  .dense-tool-grid,
  .tool-grid {
    grid-template-columns: 1fr;
  }

  .family-card {
    min-height: 96px;
  }

  .tool-card {
    min-height: 98px;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
  }

  .tool-card strong,
  .tool-card .hint {
    grid-column: 2;
  }

  .tool-card .tool-icon {
    grid-row: 1 / span 2;
  }

  .dashboard-group-head,
  .tool-family-head {
    align-items: start;
  }

  .dashboard-group-head {
    flex-direction: column;
  }

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

  .conversion-flow {
    grid-template-columns: 1fr;
  }

  .content-grid {
    gap: 12px;
  }

  .preview-surface {
    min-height: 260px;
    max-height: 420px;
  }

  .file-list {
    max-height: 280px;
  }
}

@media (min-width: 861px) {
  .menu-toggle {
    display: none !important;
  }
}

.menu-toggle {
  display: none !important;
}

@media (max-width: 1180px) and (min-width: 861px) {
  .site-links a {
    padding-inline: 8px;
    font-size: 0.82rem;
  }

}
