:root {
  color-scheme: light;
  --sidebar: #1f2022;
  --sidebar-active: #3a3b3d;
  --page: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #f8fafb;
  --line: #dce2e6;
  --line-strong: #c3cdd4;
  --text: #172026;
  --muted: #65727c;
  --accent: #1677d2;
  --accent-2: #0f9f8a;
  --accent-3: #d96d3b;
  --shadow: 0 16px 42px rgba(21, 32, 38, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--page);
  overflow-x: hidden;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
  transition: grid-template-columns 180ms ease;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 16px 0;
  color: #d9dcdf;
  background: var(--sidebar);
}

.menu-scrim {
  display: none;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 18px;
  height: 68px;
  padding: 0 24px;
}

.brand-logo {
  color: #27a5ff;
  font-size: 2.1rem;
  font-weight: 800;
  line-height: 1;
}

.brand-logo:hover {
  color: #5bbcff;
}

.icon-button {
  display: grid;
  gap: 5px;
  width: 34px;
  min-height: 34px;
  padding: 5px;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.icon-button span {
  display: block;
  height: 3px;
  border-radius: 999px;
  background: #979a9d;
}

.side-nav {
  display: grid;
  gap: 10px;
  margin-top: 24px;
}

.side-link {
  display: grid;
  grid-template-columns: 32px 1fr;
  align-items: center;
  gap: 14px;
  min-height: 54px;
  padding: 0 28px;
  color: #d6d8da;
  font-size: 1.02rem;
  font-weight: 700;
}

.side-link[data-generator-source] {
  grid-template-columns: 32px 1fr auto;
}

.side-link:hover,
.side-link.is-active,
.side-link.is-filter-active {
  background: var(--sidebar-active);
}

.nav-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: #a9abad;
  font-size: 1.35rem;
  font-weight: 800;
}

.main-view {
  min-width: 0;
  padding: 20px 28px 34px;
}

body.is-sidebar-collapsed .app-layout {
  grid-template-columns: 86px minmax(0, 1fr);
}

body.is-sidebar-collapsed .brand-row {
  justify-content: center;
  padding: 0;
}

body.is-sidebar-collapsed .brand-logo,
body.is-sidebar-collapsed .side-link > span:not(.nav-icon) {
  display: none;
}

body.is-sidebar-collapsed .side-link {
  grid-template-columns: 1fr;
  justify-items: center;
  padding: 0;
}

body.is-sidebar-collapsed .side-link[data-generator-source] {
  grid-template-columns: 1fr;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  margin-bottom: 20px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(680px, 100%);
  min-height: 46px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface);
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.catalog-search {
  width: min(680px, 100%);
  margin-bottom: 16px;
}

.ghost-button,
.primary-button {
  min-height: 42px;
  border-radius: 8px;
  font-weight: 800;
  cursor: pointer;
}

.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border: 1px solid var(--line-strong);
  color: var(--accent);
  background: var(--surface);
}

.nav-button {
  flex: 0 0 auto;
}

.hero-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
  padding: 22px 24px;
  border-radius: 8px;
  color: #ffffff;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.18), transparent 44%),
    #1f5f96;
  overflow: hidden;
}

.eyebrow,
.lead,
h1,
h2,
p {
  margin: 0;
}

.eyebrow {
  color: currentColor;
  opacity: 0.74;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin-top: 4px;
  font-size: clamp(1.6rem, 2.4vw, 2.55rem);
  line-height: 1.15;
}

.lead {
  max-width: 68ch;
  margin-top: 10px;
  color: rgba(255, 255, 255, 0.84);
  font-size: 0.96rem;
  line-height: 1.7;
}

.hero-stats {
  display: flex;
  gap: 10px;
  flex: 0 0 auto;
}

.hero-stats span {
  display: grid;
  min-width: 104px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 0.78rem;
}

.hero-stats strong {
  font-size: 1.2rem;
}

.not-found-hero {
  align-items: flex-start;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.16), transparent 42%), #2a4f78;
}

.not-found-stats {
  display: grid;
  align-content: start;
  max-width: 260px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.82rem;
  line-height: 1.55;
}

.not-found-stats strong {
  color: #ffffff;
  font-size: 1.22rem;
}

.not-found-panel {
  padding: 16px;
}

.not-found-message {
  margin-bottom: 10px;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.7;
}

.not-found-path {
  margin-bottom: 14px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface-2);
  font-family:
    ui-monospace, Menlo, Monaco, Consolas, "Courier New", monospace;
  word-break: break-all;
  font-size: 0.84rem;
  line-height: 1.5;
}

.not-found-panel .output-row {
  margin-top: 6px;
  gap: 10px;
}

.not-found-panel .output-row a {
  min-width: 140px;
}

.intent-section {
  margin-bottom: 30px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.section-head h2 {
  font-size: 1.35rem;
  line-height: 1.2;
}

.section-head a {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.section-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.filter-reset-button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--text);
  background: var(--surface);
  font-size: 0.88rem;
  font-weight: 900;
  cursor: pointer;
}

.filter-reset-button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.intent-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 6px;
  overflow: visible;
  scrollbar-width: none;
}

.intent-tags::-webkit-scrollbar,
.side-nav::-webkit-scrollbar {
  display: none;
}

.intent-tag {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  min-height: 52px;
  padding: 0 20px;
  border: 0;
  border-radius: 8px;
  color: #ffffff;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}

.intent-tag.is-disabled {
  opacity: 0.66;
  cursor: not-allowed;
}

.intent-tag:nth-child(6n + 1) {
  background: #8176c8;
}

.intent-tag:nth-child(6n + 2) {
  background: #8cbd6d;
}

.intent-tag:nth-child(6n + 3) {
  background: #c77c72;
}

.intent-tag:nth-child(6n + 4) {
  background: #c06c96;
}

.intent-tag:nth-child(6n + 5) {
  background: #bea963;
}

.intent-tag:nth-child(6n) {
  background: #70bfa2;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 24px;
  align-items: start;
}

.home-content {
  grid-template-columns: 1fr;
}

.catalog-section {
  min-width: 0;
}

.converter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}

.converter-card,
.mini-card,
.work-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 26px rgba(23, 32, 38, 0.06);
}

.converter-card {
  display: grid;
  min-height: 198px;
  padding: 0;
  overflow: hidden;
  text-align: left;
  cursor: pointer;
}

.converter-card.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(22, 119, 210, 0.14);
}

.converter-card.is-filter-match {
  border-color: rgba(22, 119, 210, 0.56);
  box-shadow: 0 0 0 3px rgba(22, 119, 210, 0.12);
}

.converter-card.is-filter-muted {
  opacity: 0.42;
  filter: grayscale(1) saturate(0.18);
}

.converter-card.is-filter-muted:hover {
  opacity: 0.62;
}

.converter-card.is-disabled {
  opacity: 0.82;
  cursor: not-allowed;
}

.converter-card.is-disabled .card-art {
  background: #9aa6ad !important;
  filter: saturate(0.55);
}

.converter-card.is-disabled .card-body h3,
.converter-card.is-disabled .card-body p {
  color: #7b8790;
}

.card-art {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  min-height: 106px;
  padding: 14px;
  color: #ffffff;
}

.card-art strong {
  font-size: 2.05rem;
  line-height: 1;
}

.card-chip {
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  font-size: 0.74rem;
  font-weight: 900;
}

.converter-card:nth-child(4n + 1) .card-art {
  background: #1677d2;
}

.converter-card:nth-child(4n + 2) .card-art {
  background: #0f9f8a;
}

.converter-card:nth-child(4n + 3) .card-art {
  background: #be6d95;
}

.converter-card:nth-child(4n) .card-art {
  background: #7a70c4;
}

.card-body {
  padding: 14px;
}

.card-body h3 {
  margin: 0 0 7px;
  font-size: 1.03rem;
}

.card-body p {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

.route-line {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.route-line span {
  padding: 4px 7px;
  border-radius: 999px;
  background: var(--surface-2);
}

.lower-head {
  margin-top: 30px;
}

.mini-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}

.mini-card {
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: center;
  gap: 10px;
  min-height: 76px;
  padding: 12px;
}

.mini-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  color: #ffffff;
  background: var(--accent-3);
  font-weight: 900;
}

.mini-card:nth-child(2n) .mini-icon {
  background: var(--accent-2);
}

.mini-card strong,
.mini-card span {
  display: block;
}

.mini-card span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
}

.work-panel {
  position: sticky;
  top: 20px;
  padding: 18px;
}

.converter-work-grid {
  grid-template-columns: minmax(0, 1fr) 360px;
}

.tool-detail {
  min-width: 0;
  position: sticky;
  top: 20px;
}

.main-work-panel {
  position: static;
}

.spec-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 26px rgba(23, 32, 38, 0.06);
}

.wide-flow {
  max-width: 640px;
  margin-top: 18px;
}

.conversion-summary {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1.7;
}

.large-route {
  margin-top: 18px;
}

.large-route span {
  font-size: 0.88rem;
}

.upload-layout {
  display: grid;
  grid-template-columns: minmax(320px, 1.35fr) minmax(260px, 0.8fr);
  gap: 16px;
  align-items: stretch;
  margin-bottom: 16px;
}

.main-work-panel .drop-zone,
.main-work-panel .option-box {
  min-height: 206px;
  margin-bottom: 0;
}

.main-work-panel .option-box {
  align-content: center;
}

.main-work-panel:not(.has-files) .upload-layout {
  grid-template-columns: minmax(0, 1fr);
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.panel-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 8px;
  color: #ffffff;
  background: var(--accent);
  font-size: 0.9rem;
  font-weight: 900;
}

.panel-title .eyebrow {
  color: var(--muted);
}

.flow-spec {
  display: grid;
  grid-template-columns: 1fr 28px 1fr;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.flow-box {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.flow-box span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
}

.flow-box strong {
  display: block;
  overflow: hidden;
  margin-top: 3px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.flow-mark {
  color: var(--accent);
  font-size: 1.25rem;
  font-weight: 900;
  text-align: center;
}

.option-box {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  transition:
    opacity 180ms ease,
    filter 180ms ease,
    transform 180ms ease;
}

.option-row,
.color-option,
.output-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.option-row label,
.color-option span,
.output-row span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.option-box input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.number-option {
  width: 86px;
  min-height: 34px;
  padding: 0 8px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--text);
  background: #ffffff;
  font-weight: 900;
  text-align: right;
}

.model-controls {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}

.model-control {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.model-control input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.model-control-label {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 900;
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.segmented-control label {
  min-width: 0;
}

.segmented-control input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented-control span {
  display: grid;
  place-items: center;
  min-height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #ffffff;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 900;
  cursor: pointer;
}

.segmented-control input:checked + span {
  border-color: var(--accent);
  color: #ffffff;
  background: var(--accent);
}

.color-option input {
  width: 42px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: transparent;
}

.language-menu {
  position: relative;
  flex: 0 0 auto;
}

.language-button {
  display: grid;
  place-items: center;
  width: 42px;
  min-height: 42px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--text);
  background: var(--surface);
  font-size: 1rem;
  font-weight: 900;
  cursor: pointer;
}

.language-button:hover,
.language-button[aria-expanded="true"] {
  border-color: var(--accent);
  color: var(--accent);
}

.language-button:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(22, 119, 210, 0.16);
}

.language-options {
  position: absolute;
  z-index: 30;
  top: calc(100% + 8px);
  right: 0;
  display: grid;
  min-width: 144px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.language-options[hidden] {
  display: none;
}

.language-options a,
.language-options span {
  padding: 9px 10px;
  border-radius: 6px;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 800;
}

.language-options span {
  color: var(--muted);
  background: var(--surface-2);
}

.language-options a:hover {
  background: var(--surface-2);
}

.drop-zone {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 132px;
  margin-bottom: 14px;
  padding: 26px 20px;
  border: 2px dashed #5aa6e6;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(237, 246, 255, 0.92)),
    #edf6ff;
  color: var(--text);
  cursor: pointer;
  text-align: center;
  box-shadow: 0 18px 42px rgba(22, 119, 210, 0.16);
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease,
    background 180ms ease;
  animation: upload-pulse 2.8s ease-in-out infinite;
}

.drop-zone.is-dragging {
  border-color: var(--accent);
  background: #e3f2ff;
  box-shadow: 0 22px 52px rgba(22, 119, 210, 0.24);
  transform: translateY(-2px);
}

.drop-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.upload-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin-bottom: 8px;
  border: 1px solid rgba(22, 119, 210, 0.18);
  border-radius: 50%;
  color: #ffffff;
  background: var(--accent);
  box-shadow: 0 10px 24px rgba(22, 119, 210, 0.24);
  font-size: 2.15rem;
  line-height: 1;
}

.drop-zone small {
  margin-top: 10px;
  color: var(--muted);
}

.upload-kicker {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 900;
}

.drop-zone > span:not(.upload-icon):not(.upload-safe) {
  font-weight: 900;
}

.main-work-panel .drop-zone .upload-title {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin-top: 6px;
  padding: 0 20px;
  border-radius: 8px;
  color: #ffffff;
  background: var(--accent);
  box-shadow: 0 10px 22px rgba(22, 119, 210, 0.22);
}

.upload-safe {
  margin-top: 12px;
  color: #4f626f;
  font-size: 0.82rem;
  font-weight: 800;
}

.conversion-stage {
  transition:
    opacity 180ms ease,
    filter 180ms ease;
}

.main-work-panel:not(.has-files) .option-box,
.main-work-panel:not(.has-files) .model-controls,
.main-work-panel:not(.has-files) .model-result,
.main-work-panel:not(.has-files) .conversion-stage {
  display: none;
}

.main-work-panel.has-files .drop-zone {
  animation: none;
  box-shadow: 0 10px 26px rgba(23, 32, 38, 0.08);
}

@keyframes upload-pulse {
  0%,
  100% {
    box-shadow: 0 18px 42px rgba(22, 119, 210, 0.14);
  }

  50% {
    box-shadow: 0 24px 58px rgba(22, 119, 210, 0.26);
  }
}

@media (prefers-reduced-motion: reduce) {
  .drop-zone {
    animation: none;
  }
}

.preview-box {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 3 / 2;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(45deg, #e7edf1 25%, transparent 25%),
    linear-gradient(-45deg, #e7edf1 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e7edf1 75%),
    linear-gradient(-45deg, transparent 75%, #e7edf1 75%),
    #f8fbfc;
  background-position:
    0 0,
    0 10px,
    10px -10px,
    -10px 0;
  background-size: 20px 20px;
  overflow: hidden;
}

.preview-box.large-preview {
  aspect-ratio: 2 / 1;
}

#previewCanvas {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.preview-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.58);
  font-weight: 800;
}

.preview-empty.is-hidden {
  display: none;
}

.output-row {
  margin-bottom: 12px;
}

.output-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.output-row > div {
  min-width: 0;
}

.output-row strong {
  display: block;
  max-width: min(58vw, 620px);
  margin-top: 2px;
  overflow-wrap: anywhere;
}

.conversion-progress {
  position: relative;
  height: 8px;
  margin: -2px 0 14px;
  overflow: hidden;
  border-radius: 999px;
  background: #dce7ee;
  opacity: 0;
  transform: translateY(-2px);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.conversion-progress.is-active,
.conversion-progress.is-complete {
  opacity: 1;
  transform: translateY(0);
}

.conversion-progress-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #35b4a8);
  transition: width 900ms cubic-bezier(0.18, 0.72, 0.18, 1);
}

.conversion-progress.is-complete .conversion-progress-fill {
  width: 100%;
  transition: width 180ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

.primary-button {
  min-width: 92px;
  padding: 0 16px;
  border: 0;
  color: #ffffff;
  background: var(--accent);
}

.primary-button:disabled {
  color: #8ea1ad;
  background: #dce5eb;
  cursor: not-allowed;
}

.file-list {
  display: grid;
  gap: 8px;
}

.model-result {
  margin-top: 14px;
}

.model-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 8px;
}

.model-stat {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.model-stat span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
}

.model-stat strong {
  display: block;
  margin-top: 3px;
  overflow-wrap: anywhere;
  font-size: 0.95rem;
}

.model-view-card {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #f5f8fa;
}

.model-view-card canvas {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  min-height: 260px;
  cursor: grab;
}

.model-view-card canvas:active {
  cursor: grabbing;
}

.empty-state,
.file-item {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.empty-state {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.84rem;
}

.file-item {
  display: grid;
  grid-template-columns: 38px 1fr auto;
  align-items: center;
  gap: 9px;
  padding: 7px;
  text-align: left;
  cursor: pointer;
}

.file-item.is-active {
  border-color: var(--accent);
  background: #edf6ff;
}

.file-thumb {
  width: 38px;
  height: 38px;
  border-radius: 6px;
  object-fit: cover;
}

.file-thumb-icon {
  display: grid;
  place-items: center;
  color: #ffffff;
  background: var(--accent);
  font-size: 0.68rem;
  font-weight: 900;
}

.file-name {
  display: block;
  overflow: hidden;
  font-size: 0.84rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-detail {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 0.72rem;
}

.file-status {
  max-width: 180px;
  overflow: hidden;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-remove {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface);
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 900;
}

.handoff-modal {
  position: fixed;
  z-index: 120;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(13, 24, 33, 0.42);
}

.handoff-modal[hidden] {
  display: none;
}

.handoff-dialog {
  width: min(980px, 100%);
  max-height: min(760px, 88vh);
  padding: 18px;
  border-radius: 8px;
  background: var(--page);
  box-shadow: var(--shadow);
  overflow: auto;
}

.handoff-grid {
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
}

.handoff-grid .converter-card {
  width: 100%;
}

.side-count {
  justify-self: end;
  min-width: 26px;
  padding: 2px 7px;
  border-radius: 999px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.16);
  font-size: 0.72rem;
  text-align: center;
}

@media (max-width: 1180px) {
  .app-layout {
    grid-template-columns: 86px minmax(0, 1fr);
  }

  .brand-row {
    justify-content: center;
    padding: 0;
  }

  .brand-logo,
  .side-link > span:not(.nav-icon) {
    display: none;
  }

  .side-link {
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 0;
  }

  .side-link[data-generator-source] {
    grid-template-columns: 1fr;
  }

  .content-grid {
    grid-template-columns: 1fr;
  }

  .work-panel {
    position: static;
  }
}

@media (max-width: 760px) {
  body.is-menu-open {
    overflow: hidden;
  }

  .app-layout {
    display: block;
  }

  .sidebar {
    position: sticky;
    z-index: 80;
    top: 0;
    height: auto;
    padding: 0;
  }

  .brand-row {
    position: relative;
    z-index: 92;
    justify-content: flex-start;
    height: 58px;
    padding: 0 14px;
  }

  .brand-logo {
    display: block;
    font-size: 1.7rem;
  }

  .side-nav {
    position: fixed;
    z-index: 90;
    top: 0;
    bottom: 0;
    left: 0;
    display: grid;
    align-content: start;
    width: min(82vw, 320px);
    padding: 72px 0 18px;
    grid-template-columns: 1fr;
    gap: 4px;
    margin: 0;
    overflow-y: auto;
    background: rgba(31, 32, 34, 0.96);
    box-shadow: 18px 0 42px rgba(13, 24, 33, 0.24);
    transform: translateX(-104%);
    transition:
      transform 180ms ease,
      opacity 180ms ease;
    opacity: 0.98;
  }

  body.is-menu-open .side-nav {
    transform: translateX(0);
  }

  .side-link {
    display: grid;
    grid-template-columns: 34px 1fr;
    justify-items: stretch;
    min-height: 52px;
    padding: 0 22px;
    font-size: 0.98rem;
  }

  .side-link[data-generator-source] {
    grid-template-columns: 34px 1fr auto;
  }

  .side-link > span:not(.nav-icon) {
    display: block;
  }

  .menu-scrim {
    position: fixed;
    z-index: 70;
    inset: 0;
    display: block;
    border: 0;
    background: rgba(13, 24, 33, 0.38);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
  }

  body.is-menu-open .menu-scrim {
    opacity: 1;
    pointer-events: auto;
  }

  .main-view {
    padding: 10px 12px 26px;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .nav-button {
    width: 100%;
  }

  .language-menu {
    align-self: flex-end;
  }

  .hero-band {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 12px;
    padding: 14px;
  }

  .tool-hero .lead {
    display: none;
  }

  .hero-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .intent-section {
    margin-bottom: 34px;
  }

  .intent-tags {
    display: grid;
    grid-template-columns: 1fr 1fr;
    overflow: visible;
  }

  .intent-tag {
    justify-content: center;
    min-height: 38px;
    padding: 0 10px;
    font-size: 0.82rem;
    text-align: center;
    white-space: normal;
  }

  .intent-tag:nth-child(n + 7) {
    display: none;
  }

  .converter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .converter-card {
    min-height: 184px;
  }

  .card-art strong {
    font-size: 1.55rem;
  }

  .card-body {
    padding: 12px;
  }

  .card-body p {
    font-size: 0.8rem;
  }

  .mini-grid {
    grid-template-columns: 1fr;
  }

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

  .flow-mark {
    transform: rotate(90deg);
  }

  .conversion-summary {
    margin-top: 8px;
    font-size: 0.82rem;
  }

  .converter-work-grid {
    grid-template-columns: 1fr;
  }

  .tool-detail {
    position: static;
    order: 3;
  }

  .upload-layout {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .main-work-panel {
    order: 1;
    padding: 14px;
  }

  .main-work-panel .section-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .main-work-panel .drop-zone {
    min-height: 230px;
  }

  .main-work-panel .option-box {
    min-height: auto;
  }

  .preview-box.large-preview {
    aspect-ratio: 4 / 3;
  }

  .upload-icon {
    width: 68px;
    height: 68px;
  }

  .main-work-panel .drop-zone .upload-title {
    width: min(100%, 280px);
  }
}

.admin-login-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.admin-login-panel {
  width: min(440px, 100%);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.admin-login-panel h1 {
  margin: 6px 0 18px;
}

.admin-form {
  display: grid;
  gap: 14px;
}

.admin-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 900;
}

.admin-form input,
.admin-settings-form input,
.admin-settings-form select,
.admin-table textarea,
.admin-export {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--text);
  background: #ffffff;
}

.admin-form input {
  min-height: 42px;
  padding: 0 12px;
}

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

.admin-settings-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 900;
}

.admin-settings-form .admin-checkbox {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
}

.admin-settings-form .admin-checkbox input {
  width: 18px;
  min-height: 18px;
}

.admin-settings-form input,
.admin-settings-form select {
  min-height: 42px;
  padding: 0 12px;
}

.admin-settings-form p {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1.6;
}

.admin-alert {
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 1px solid #efb2a0;
  border-radius: 8px;
  color: #8c371c;
  background: #fff3ef;
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1.55;
}

.admin-hero {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.16), transparent 42%),
    #2d596c;
}

.admin-user {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 900;
}

.admin-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.admin-stat {
  display: grid;
  grid-template-columns: 1fr;
  gap: 5px;
}

.admin-stat span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.admin-stat strong {
  font-size: 1.55rem;
  overflow-wrap: anywhere;
}

.admin-grid-two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 20px;
}

.admin-chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 20px;
}

.admin-chart-card {
  min-height: 320px;
  padding: 16px;
}

.admin-chart-card.wide {
  grid-column: span 2;
}

.admin-chart-card canvas {
  display: block;
  width: 100%;
  height: 280px;
}

.admin-panel {
  position: static;
}

.admin-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 38px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.admin-bar span {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.admin-bar strong {
  color: var(--accent);
}

.admin-table-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
  font-size: 0.84rem;
}

.admin-table th,
.admin-table td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.admin-table th {
  color: var(--muted);
  background: var(--surface-2);
  font-size: 0.76rem;
  font-weight: 900;
}

.admin-table td {
  overflow-wrap: anywhere;
}

.admin-table textarea {
  min-height: 70px;
  padding: 8px;
  resize: vertical;
}

.admin-search {
  margin-bottom: 14px;
}

.admin-export {
  min-height: 170px;
  margin-top: 14px;
  padding: 12px;
  font-family: ui-monospace, Menlo, Monaco, Consolas, "Courier New", monospace;
}

.ascii-compare-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 14px;
}

.ascii-source-shell,
.ascii-output-shell {
  position: relative;
  background: #0f1720;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  min-height: 420px;
  overflow: auto;
}

.ascii-source-shell {
  display: grid;
  place-items: center;
  background:
    linear-gradient(45deg, #e7edf1 25%, transparent 25%),
    linear-gradient(-45deg, #e7edf1 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e7edf1 75%),
    linear-gradient(-45deg, transparent 75%, #e7edf1 75%),
    #f8fbfc;
  background-position:
    0 0,
    0 10px,
    10px -10px,
    -10px 0;
  background-size: 20px 20px;
}

.ascii-source-preview {
  display: block;
  max-width: 100%;
  max-height: 420px;
  object-fit: contain;
}

.ascii-output {
  color: #f7faf7;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 7px;
  line-height: 1;
  margin: 0;
  padding: 16px;
  white-space: pre;
}

@media (max-width: 900px) {
  .ascii-compare-grid {
    grid-template-columns: 1fr;
  }

  .admin-grid-two,
  .admin-chart-grid {
    grid-template-columns: 1fr;
  }

  .admin-chart-card.wide {
    grid-column: auto;
  }
}

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