:root {
  color-scheme: dark;
  --bg: #070f12;
  --bg-deep: #050b0d;
  --panel: #0d171a;
  --panel-2: #101d20;
  --panel-3: #142327;
  --line: #28373b;
  --line-soft: rgba(154, 181, 178, 0.14);
  --text: #edf2ec;
  --muted: #91a09f;
  --muted-2: #667674;
  --lime: #b7ff1a;
  --lime-soft: rgba(183, 255, 26, 0.1);
  --coral: #ff653c;
  --blue: #72c7ff;
  --green: #65d691;
  --violet: #9a95ff;
  --mint: #56d7c8;
  --amber: #f5c952;
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 13px;
  --shadow: 0 24px 72px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: "Noto Sans SC", "Microsoft YaHei UI", "PingFang SC", sans-serif;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a,
label {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-frame {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 238px minmax(0, 1fr);
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  width: 238px;
  display: flex;
  flex-direction: column;
  padding: 29px 20px 24px;
  border-right: 1px solid var(--line);
  background: #091215;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 0 10px;
  color: var(--lime);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.brand-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(183, 255, 26, 0.3);
  border-radius: 11px;
  background: var(--lime-soft);
  font-size: 21px;
}

.main-nav {
  display: grid;
  gap: 7px;
  margin-top: 38px;
}

.nav-item {
  width: 100%;
  min-height: 49px;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  text-align: left;
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease;
}

.nav-item i {
  font-size: 20px;
}

.nav-item:hover,
.nav-item.active {
  color: var(--text);
  background: var(--panel-3);
}

.nav-item.active {
  border-color: rgba(183, 255, 26, 0.32);
  color: var(--lime);
}

.server-pill,
.runtime-status {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(10, 22, 24, 0.78);
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.sidebar .server-pill {
  margin-top: auto;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 12px rgba(183, 255, 26, 0.72);
}

.status-dot.mock {
  background: var(--amber);
  box-shadow: 0 0 12px rgba(245, 201, 82, 0.62);
}

.mobile-header,
.mobile-tabs {
  display: none;
}

.main-content {
  grid-column: 2;
  min-width: 0;
}

.page-view {
  width: min(1460px, 100%);
  margin: 0 auto;
  padding: 54px clamp(32px, 5vw, 80px) 76px;
}

.home-header,
.tool-header,
.section-heading,
.card-heading,
.tool-card-top,
.card-action,
.field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.home-header {
  align-items: flex-start;
}

.page-kicker {
  display: block;
  color: var(--lime);
  font: 700 10px/1.4 Consolas, "SFMono-Regular", monospace;
  letter-spacing: 0.16em;
}

.home-header h1 {
  margin: 12px 0 8px;
  font-size: clamp(36px, 4.3vw, 64px);
  line-height: 1.08;
  letter-spacing: -0.045em;
}

.home-header p,
.tool-title p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
}

.command-search {
  width: min(760px, 100%);
  min-height: 62px;
  display: grid;
  grid-template-columns: 25px 1fr auto;
  align-items: center;
  gap: 13px;
  margin-top: 38px;
  padding: 0 18px;
  border: 1px solid #3b4e52;
  border-radius: 16px;
  background: #142326;
  box-shadow: 0 12px 44px rgba(0, 0, 0, 0.2);
}

.command-search:focus-within {
  border-color: var(--lime);
  box-shadow: 0 0 0 4px rgba(183, 255, 26, 0.07);
}

.command-search > i {
  color: var(--muted);
  font-size: 22px;
}

.command-search input {
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 14px;
}

.command-search input::placeholder {
  color: #7f908e;
}

kbd {
  padding: 6px 8px;
  border: 1px solid #4c5b5f;
  border-radius: 7px;
  background: #1d2e31;
  color: var(--muted);
  font: 11px Consolas, monospace;
}

.dashboard-section {
  margin-top: 48px;
}

.section-heading > div,
.card-heading > div {
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-heading h2,
.card-heading h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: -0.01em;
}

.section-index,
.card-heading > div > span {
  color: var(--lime);
  font: 700 9px Consolas, monospace;
}

.text-button,
.history-button,
.result-actions button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
}

.text-button {
  border-color: transparent;
  background: transparent;
}

.text-button:hover,
.history-button:hover,
.result-actions button:hover {
  color: var(--text);
  border-color: #506165;
}

.recent-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 17px;
}

.recent-card {
  min-width: 0;
  min-height: 75px;
  display: grid;
  grid-template-columns: 40px 1fr 18px;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.recent-card:hover {
  transform: translateY(-2px);
  border-color: #4b5e61;
  background: var(--panel-2);
}

.recent-card > i {
  color: var(--muted-2);
}

.recent-card strong,
.recent-card small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-card strong {
  font-size: 12px;
}

.recent-card small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
}

.muted-card {
  opacity: 0.72;
}

.mini-icon,
.large-icon,
.title-icon,
.empty-icon {
  display: grid;
  place-items: center;
  border: 1px solid currentColor;
  background: color-mix(in srgb, currentColor 9%, transparent);
}

.mini-icon {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  font-size: 21px;
}

.large-icon {
  width: 54px;
  height: 54px;
  border-radius: 15px;
  font-size: 29px;
}

.lime {
  color: var(--lime);
}

.blue {
  color: var(--blue);
}

.green {
  color: var(--green);
}

.violet {
  color: var(--violet);
}

.mint {
  color: var(--mint);
}

.amber {
  color: var(--amber);
}

.tool-count {
  color: var(--muted);
  font-size: 11px;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-flow: dense;
  gap: 14px;
  margin-top: 18px;
}

.tool-card {
  grid-column: span 2;
  min-height: 248px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  overflow: hidden;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.tool-card:hover {
  transform: translateY(-4px);
  border-color: #506368;
  background: var(--panel-2);
}

.tool-card.featured {
  grid-column: span 3;
  grid-row: span 2;
  min-height: 426px;
  border-color: rgba(183, 255, 26, 0.72);
  background: #0c181a;
  box-shadow: 0 0 0 1px rgba(183, 255, 26, 0.08), var(--shadow);
}

.tool-badge {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border: 1px solid rgba(183, 255, 26, 0.28);
  border-radius: 999px;
  background: var(--lime-soft);
  color: var(--lime);
  font-size: 9px;
}

.tool-badge.future {
  border-color: var(--line);
  background: var(--panel-3);
  color: var(--muted);
}

.tool-card h3 {
  margin: 0;
  font-size: 23px;
}

.tool-card p {
  max-width: 320px;
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.75;
}

.waveform-card {
  position: relative;
  height: 120px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 13px 16px;
  border: 1px solid #26383b;
  border-radius: 13px;
  background: #081113;
  overflow: hidden;
}

.waveform-card img {
  position: absolute;
  inset: 10px 8px 22px;
  width: calc(100% - 16px);
  height: calc(100% - 32px);
  object-fit: fill;
}

.waveform-card span {
  position: relative;
  z-index: 1;
  color: var(--muted);
  font: 9px Consolas, monospace;
}

.card-action {
  min-height: 38px;
  padding-top: 13px;
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 11px;
}

.featured .card-action {
  color: var(--lime);
}

.tool-card.compact {
  grid-column: span 1;
  min-height: 164px;
  padding: 16px;
}

.tool-card.compact .large-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  font-size: 23px;
}

.tool-card.compact h3 {
  font-size: 15px;
}

.tool-card.compact p {
  font-size: 10px;
}

.no-search-result {
  min-height: 260px;
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
  color: var(--muted);
}

.no-search-result i {
  color: var(--lime);
  font-size: 44px;
}

.no-search-result strong {
  margin-top: 13px;
}

.no-search-result span {
  margin-top: 6px;
  font-size: 11px;
}

.home-view {
  width: 100%;
  padding-top: 48px;
  padding-right: 32px;
  padding-bottom: 30px;
  padding-left: 60px;
}

.home-header {
  display: block;
}

.home-header h1 {
  margin: 0;
  font-size: clamp(40px, 3vw, 48px);
  line-height: 1.12;
  letter-spacing: -0.045em;
}

.home-view .command-search {
  width: min(950px, 100%);
  min-height: 64px;
  margin-top: 30px;
  border-radius: 14px;
  background: #142326;
}

.home-view .command-search input {
  font-size: 16px;
}

.category-tabs {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
}

.category-tab {
  min-width: 74px;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0a1417;
  color: var(--text);
  cursor: pointer;
  font-size: 15px;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, transform 160ms ease;
}

.category-tab:hover {
  transform: translateY(-1px);
  border-color: #536368;
  background: var(--panel-2);
}

.category-tab.active {
  border-color: var(--lime);
  background: rgba(183, 255, 26, 0.12);
  color: var(--lime);
  box-shadow: inset 0 0 0 1px rgba(183, 255, 26, 0.08);
}

.tool-directory {
  margin-top: 28px;
}

.home-view .tool-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-flow: row;
  gap: 18px;
  margin-top: 0;
}

.nav-tool-card {
  position: relative;
  min-width: 0;
  min-height: 214px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 22px 24px 18px;
  border: 1px solid #314146;
  border-radius: 15px;
  background: #0d181b;
  overflow: hidden;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.nav-tool-card:hover,
.nav-tool-card:focus-within {
  transform: translateY(-3px);
  border-color: #576a6f;
  background: #101d20;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.22);
}

.nav-tool-card.featured {
  border-color: var(--lime);
  box-shadow: inset 0 0 0 1px rgba(183, 255, 26, 0.08), 0 12px 44px rgba(85, 126, 0, 0.08);
}

.nav-tool-card.featured:hover,
.nav-tool-card.featured:focus-within {
  border-color: #d0ff69;
  box-shadow: inset 0 0 0 1px rgba(183, 255, 26, 0.12), 0 18px 52px rgba(111, 168, 0, 0.14);
}

.card-hit-area {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.card-hit-area:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: -5px;
  border-radius: 15px;
}

.nav-card-top,
.nav-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tool-icon {
  font-size: 46px;
  line-height: 1;
}

.favorite-button {
  position: relative;
  z-index: 2;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: #a7b2b2;
  cursor: pointer;
  font-size: 25px;
  transition: color 150ms ease, transform 150ms ease;
}

.favorite-button:hover {
  color: var(--lime);
  transform: scale(1.08);
}

.favorite-button.active {
  color: var(--lime);
}

.nav-card-copy {
  margin-top: 26px;
}

.nav-card-copy h2,
.add-tool-card h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.25;
  letter-spacing: -0.025em;
}

.nav-card-copy p,
.add-tool-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.nav-card-footer {
  margin-top: 15px;
  font-size: 13px;
}

.card-arrow {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid #435258;
  border-radius: 50%;
  color: var(--text);
  font-size: 18px;
  transition: border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.nav-tool-card:hover .card-arrow,
.nav-tool-card:focus-within .card-arrow {
  border-color: var(--lime);
  color: var(--lime);
  transform: translateX(2px);
}

.coral {
  color: var(--coral);
}

.orange {
  color: #ff9c48;
}

.muted-label {
  color: #8ba09e;
}

.add-tool-card {
  align-items: center;
  justify-content: center;
  border-style: dashed;
  border-color: #718083;
  background: #091315;
  text-align: center;
}

.add-tool-card:hover,
.add-tool-card:focus-within {
  border-color: var(--lime);
}

.add-tool-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin-bottom: 16px;
  border: 2px solid var(--lime);
  border-radius: 50%;
  color: var(--lime);
  font-size: 31px;
}

.add-tool-card h2 {
  color: var(--lime);
}

.home-view .no-search-result {
  min-height: 430px;
  margin-top: 0;
}

.tool-view {
  padding-top: 34px;
}

.tool-header {
  min-height: 42px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
}

.breadcrumb a:hover {
  color: var(--lime);
}

.tool-title {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 27px;
}

.title-icon {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  color: var(--lime);
  font-size: 34px;
}

.tool-title h1 {
  margin: 5px 0 5px;
  font-size: 32px;
}

.workflow-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 17px;
  margin-top: 30px;
  padding: 17px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel);
}

.workflow-steps > i {
  color: #50605f;
  font-size: 15px;
}

.workflow-step {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
}

.workflow-step span {
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  border: 1px solid #4a5a5d;
  border-radius: 50%;
  font: 10px Consolas, monospace;
}

.workflow-step.active {
  color: var(--text);
}

.workflow-step.active span {
  border-color: var(--lime);
  background: var(--lime);
  color: var(--bg);
}

.tool-workspace {
  display: grid;
  grid-template-columns: minmax(350px, 0.72fr) minmax(520px, 1.28fr);
  gap: 18px;
  margin-top: 18px;
}

.input-card,
.result-card {
  min-width: 0;
  min-height: 650px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.card-heading {
  min-height: 34px;
  margin-bottom: 22px;
}

.card-heading > span {
  color: var(--muted);
  font: 9px Consolas, monospace;
}

.field-block + .field-block,
.field-row + .field-block {
  margin-top: 18px;
}

.field-label {
  margin-bottom: 8px;
}

.field-label > span {
  font-size: 11px;
  font-weight: 700;
}

.field-label small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 400;
}

.field-label b {
  color: var(--lime);
}

.upload-zone {
  position: relative;
  min-height: 154px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  border: 1px dashed #647477;
  border-radius: var(--radius-md);
  background: #0a1315;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease;
}

.upload-zone:hover,
.upload-zone:focus-visible,
.upload-zone.dragover {
  outline: none;
  border-color: var(--lime);
  background: #0d1b1d;
}

.upload-zone > input,
.file-control > input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.upload-zone > i {
  color: var(--muted);
  font-size: 43px;
}

.upload-zone > strong {
  margin-top: 9px;
  font-size: 12px;
}

.upload-zone > span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 9px;
}

.selected-file {
  position: absolute;
  inset: 9px;
  display: grid;
  grid-template-columns: 42px 1fr 24px;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 10px;
  background: #101f22;
  text-align: left;
}

.selected-file > i:first-child {
  color: var(--lime);
  font-size: 32px;
}

.selected-file > i:last-child {
  color: var(--lime);
  font-size: 20px;
}

.selected-file strong,
.selected-file span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selected-file strong {
  font-size: 11px;
}

.selected-file span {
  margin-top: 5px;
  color: var(--muted);
  font: 9px Consolas, monospace;
}

#audioPreview {
  width: 100%;
  height: 38px;
  margin-top: 8px;
  filter: invert(0.88) hue-rotate(62deg);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 18px;
}

.select-control,
.file-control {
  position: relative;
  min-height: 47px;
  display: grid;
  grid-template-columns: 20px 1fr 18px;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0a1315;
  color: var(--muted);
}

.select-control:focus-within,
.file-control:hover {
  border-color: #596b6f;
}

.select-control select {
  min-width: 0;
  appearance: none;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 11px;
}

.select-control option {
  background: #0a1315;
  color: var(--text);
}

.language-button {
  min-width: 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 11px;
  text-align: left;
}

.language-button:focus-visible {
  color: var(--lime);
}

.language-native-select {
  display: none;
}

.language-caret {
  transition: color 150ms ease, transform 150ms ease;
}

.language-picker.open {
  border-color: var(--lime);
}

.language-picker.open .language-caret {
  color: var(--lime);
  transform: rotate(180deg);
}

.language-menu {
  position: absolute;
  top: calc(100% + 7px);
  right: 0;
  left: 0;
  z-index: 30;
  max-height: 286px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid #3b4d51;
  border-radius: 11px;
  background: #101d20;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.48);
  scrollbar-color: #536367 #101d20;
  scrollbar-width: thin;
}

.language-option {
  width: 100%;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  text-align: left;
}

.language-option:hover,
.language-option:focus-visible {
  outline: 0;
  background: rgba(183, 255, 26, 0.08);
  color: var(--text);
}

.language-option i {
  visibility: hidden;
  color: var(--lime);
  font-size: 15px;
}

.language-option.selected {
  background: rgba(183, 255, 26, 0.11);
  color: var(--lime);
}

.language-option.selected i {
  visibility: visible;
}

.file-control {
  grid-template-columns: 20px 1fr;
  cursor: pointer;
  font-size: 10px;
}

.file-control span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#referenceText {
  width: 100%;
  min-height: 168px;
  resize: vertical;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: 0;
  background: #0a1315;
  color: var(--text);
  font-size: 11px;
  line-height: 1.8;
}

#referenceText:focus {
  border-color: var(--lime);
  box-shadow: 0 0 0 3px rgba(183, 255, 26, 0.06);
}

#referenceText::placeholder {
  color: #667573;
}

.form-message {
  margin-top: 14px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 101, 60, 0.34);
  border-radius: 9px;
  background: rgba(255, 101, 60, 0.08);
  color: #ff9a7e;
  font-size: 10px;
  line-height: 1.6;
}

.primary-button {
  width: 100%;
  min-height: 52px;
  display: grid;
  grid-template-columns: 22px 1fr 22px;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  padding: 0 16px;
  border: 0;
  border-radius: 11px;
  background: var(--lime);
  color: #0a1213;
  cursor: pointer;
  font-weight: 800;
  box-shadow: 0 10px 28px rgba(183, 255, 26, 0.13);
  transition: transform 160ms ease, filter 160ms ease;
}

.primary-button:hover:not(:disabled) {
  transform: translateY(-2px);
  filter: brightness(1.06);
}

.primary-button:disabled {
  opacity: 0.55;
  cursor: wait;
}

.privacy-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 10px 0 0;
  color: var(--muted-2);
  font-size: 9px;
}

.result-actions {
  display: flex;
  gap: 7px;
}

.result-actions .download-button {
  border-color: var(--lime);
  background: var(--lime);
  color: var(--bg);
  font-weight: 700;
}

.empty-result,
.processing-result {
  min-height: 540px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.empty-icon {
  width: 86px;
  height: 86px;
  border-radius: 24px;
  color: var(--lime);
  font-size: 44px;
}

.empty-result strong {
  margin-top: 20px;
  font-size: 17px;
}

.empty-result p,
.processing-result p {
  max-width: 360px;
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.8;
}

.processing-ring {
  width: 98px;
  height: 98px;
  display: grid;
  place-items: center;
  margin-bottom: 22px;
  border: 2px solid var(--line);
  border-top-color: var(--lime);
  border-radius: 50%;
  color: var(--lime);
  font-size: 40px;
  animation: orbit 1.2s linear infinite;
}

.processing-result h3 {
  margin: 8px 0 0;
  font-size: 21px;
}

.result-summary {
  min-height: 76px;
  display: grid;
  grid-template-columns: 92px 102px 1fr;
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
  border: 1px solid rgba(183, 255, 26, 0.3);
  border-radius: 12px;
  background: var(--lime-soft);
}

.result-summary > div:not(:last-child) {
  border-right: 1px solid rgba(183, 255, 26, 0.2);
}

.result-summary small,
.result-summary strong {
  display: block;
}

.result-summary small {
  color: var(--muted);
  font-size: 9px;
}

.result-summary strong {
  margin-top: 3px;
  color: var(--lime);
  font: 700 20px Consolas, monospace;
}

.summary-note {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 10px;
}

.segment-header,
.segment-row {
  display: grid;
  grid-template-columns: 34px 210px minmax(220px, 1fr);
  gap: 12px;
}

.segment-header {
  margin-top: 17px;
  padding: 0 10px 10px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted-2);
  font: 9px Consolas, monospace;
}

.segment-list {
  max-height: 620px;
  overflow-y: auto;
}

.segment-row {
  align-items: center;
  min-height: 72px;
  padding: 10px 10px 10px 0;
  border-bottom: 1px solid var(--line-soft);
}

.segment-row:focus-within {
  background: rgba(183, 255, 26, 0.025);
}

.segment-index {
  color: var(--lime);
  font: 9px Consolas, monospace;
}

.timecode {
  display: grid;
  grid-template-columns: 1fr 10px 1fr;
  align-items: center;
  gap: 6px;
}

.timecode span {
  color: var(--muted-2);
  font-size: 9px;
}

.timecode input {
  min-width: 0;
  height: 30px;
  padding: 0 5px;
  border: 1px solid var(--line);
  border-radius: 7px;
  outline: 0;
  background: #091214;
  color: var(--muted);
  font: 9px Consolas, monospace;
  text-align: center;
}

.timecode input:focus {
  border-color: var(--lime);
  color: var(--text);
}

.segment-text {
  width: 100%;
  min-height: 48px;
  resize: vertical;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 11px;
  line-height: 1.55;
}

.segment-text:focus {
  border-color: var(--line);
  background: #091214;
}

.toast {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 60;
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 16px;
  border: 1px solid #485a5e;
  border-radius: 12px;
  background: #162326;
  color: var(--text);
  box-shadow: var(--shadow);
  font-size: 11px;
}

.toast i {
  color: var(--lime);
  font-size: 18px;
}

@keyframes orbit {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 1180px) {
  .home-view .tool-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .recent-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tool-card,
  .tool-card.featured {
    grid-column: span 3;
  }

  .tool-card.compact {
    grid-column: span 2;
  }

  .tool-workspace {
    grid-template-columns: 1fr;
  }

  .input-card,
  .result-card {
    min-height: auto;
  }

  .empty-result,
  .processing-result {
    min-height: 420px;
  }
}

@media (max-width: 940px) {
  .home-view .tool-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-view .category-tabs {
    overflow-x: auto;
    padding-bottom: 5px;
    scrollbar-width: none;
  }

  .home-view .category-tabs::-webkit-scrollbar {
    display: none;
  }
}

@media (max-width: 760px) {
  body {
    padding-bottom: 72px;
  }

  .app-frame {
    display: block;
  }

  .sidebar {
    display: none;
  }

  .mobile-header {
    position: sticky;
    top: 0;
    z-index: 30;
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 17px;
    border-bottom: 1px solid var(--line);
    background: rgba(7, 15, 18, 0.96);
    backdrop-filter: blur(16px);
  }

  .mobile-header .brand {
    min-height: 42px;
    padding: 0;
    font-size: 14px;
  }

  .mobile-header .brand-icon {
    width: 30px;
    height: 30px;
    font-size: 18px;
  }

  .icon-button {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 0;
    background: transparent;
    font-size: 21px;
  }

  .main-content {
    min-width: 0;
  }

  .page-view {
    padding: 30px 16px 46px;
  }

  .home-view {
    padding: 30px 16px 46px;
  }

  .home-header {
    display: block;
  }

  .home-header h1 {
    font-size: 31px;
    line-height: 1.18;
  }

  .home-view .command-search {
    min-height: 52px;
    margin-top: 24px;
    border-radius: 13px;
  }

  .home-view .command-search kbd {
    display: none;
  }

  .home-view .category-tabs {
    gap: 8px;
    margin-top: 18px;
  }

  .home-view .category-tab {
    min-width: 62px;
    min-height: 40px;
    padding: 0 14px;
    font-size: 12px;
  }

  .dashboard-section {
    margin-top: 36px;
  }

  .recent-row {
    grid-template-columns: repeat(4, 145px);
    overflow-x: auto;
    padding-bottom: 8px;
    scrollbar-width: none;
  }

  .recent-row::-webkit-scrollbar {
    display: none;
  }

  .home-view .tool-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .tool-directory {
    margin-top: 18px;
  }

  .nav-tool-card {
    min-height: 174px;
    padding: 15px 14px 13px;
    border-radius: 14px;
  }

  .tool-icon {
    font-size: 35px;
  }

  .favorite-button {
    width: 30px;
    height: 30px;
    font-size: 21px;
  }

  .nav-card-copy {
    margin-top: 18px;
  }

  .nav-card-copy h2,
  .add-tool-card h2 {
    font-size: 16px;
  }

  .nav-card-copy p,
  .add-tool-card p {
    min-height: 30px;
    margin-top: 6px;
    font-size: 9px;
  }

  .nav-card-footer {
    margin-top: 12px;
    font-size: 10px;
  }

  .card-arrow {
    width: 30px;
    height: 30px;
    font-size: 15px;
  }

  .add-tool-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 12px;
    font-size: 25px;
  }

  .tool-card,
  .tool-card.featured,
  .tool-card.compact {
    grid-column: span 1;
    min-height: 180px;
    padding: 14px;
    border-radius: 15px;
  }

  .tool-card.featured {
    grid-column: span 1;
    grid-row: auto;
    min-height: 180px;
  }

  .tool-card h3 {
    font-size: 16px;
  }

  .tool-card p {
    font-size: 9px;
  }

  .tool-card .card-action,
  .tool-card .waveform-card {
    display: none;
  }

  .tool-card.compact .large-icon,
  .large-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    font-size: 22px;
  }

  .waveform-card {
    height: 86px;
  }

  .mobile-tabs {
    position: fixed;
    inset: auto 0 0;
    z-index: 40;
    height: 68px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border-top: 1px solid var(--line);
    background: rgba(8, 17, 19, 0.97);
    backdrop-filter: blur(18px);
  }

  .mobile-tabs a,
  .mobile-tabs button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 9px;
  }

  .mobile-tabs i {
    font-size: 20px;
  }

  .mobile-tabs .active {
    color: var(--lime);
  }

  .tool-view {
    padding-top: 18px;
  }

  .tool-header {
    display: none;
  }

  .tool-title {
    align-items: flex-start;
    margin-top: 0;
  }

  .title-icon {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    font-size: 29px;
  }

  .tool-title h1 {
    font-size: 25px;
  }

  .tool-title p {
    font-size: 10px;
  }

  .workflow-steps {
    justify-content: space-between;
    gap: 4px;
    padding: 12px 10px;
    overflow: hidden;
  }

  .workflow-step {
    flex-direction: column;
    gap: 4px;
    font-size: 8px;
    text-align: center;
  }

  .workflow-steps > i {
    font-size: 10px;
  }

  .tool-workspace {
    display: block;
  }

  .input-card,
  .result-card {
    padding: 17px;
    border-radius: 16px;
    box-shadow: none;
  }

  .result-card {
    margin-top: 12px;
  }

  .field-row {
    grid-template-columns: 1fr;
  }

  .result-summary {
    grid-template-columns: 1fr 1fr;
  }

  .summary-note {
    grid-column: 1 / -1;
  }

  .segment-header {
    display: none;
  }

  .segment-list {
    max-height: none;
  }

  .segment-row {
    grid-template-columns: 27px 1fr;
    gap: 8px;
    padding: 12px 0;
  }

  .timecode {
    grid-column: 2;
  }

  .segment-text {
    grid-column: 2;
  }

  .result-actions button {
    padding: 0 9px;
  }

  .toast {
    right: 14px;
    bottom: 82px;
    left: 14px;
  }
}

/* Standalone audio-to-subtitle tool */
body.tool-route {
  min-width: 320px;
  padding-bottom: 0;
}

.tool-route .app-frame {
  display: block;
}

.tool-route .sidebar,
.tool-route .mobile-header,
.tool-route .mobile-tabs {
  display: none !important;
}

.tool-route .main-content {
  min-width: 0;
  grid-column: auto;
}

.tool-route .tool-view {
  width: 100%;
  max-width: none;
  padding: 28px 48px 36px;
}

.tool-route .tool-title {
  gap: 18px;
  margin-top: 0;
}

.tool-route .title-icon {
  width: 84px;
  height: 72px;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: 56px;
}

.tool-route .tool-title h1 {
  margin: 0 0 6px;
  font-size: 40px;
  letter-spacing: -0.03em;
}

.tool-route .tool-title p {
  max-width: 760px;
  color: var(--muted);
  font-size: 14px;
}

.tool-route .workflow-steps {
  justify-content: space-between;
  gap: 16px;
  margin-top: 20px;
  padding: 12px 64px;
  border: 0;
  background: transparent;
}

.tool-route .workflow-steps > i {
  flex: 1;
  color: var(--lime);
  font-size: 19px;
  text-align: center;
}

.tool-route .workflow-step {
  flex: none;
  gap: 10px;
  font-size: 13px;
  white-space: nowrap;
}

.tool-route .workflow-step span {
  width: 31px;
  height: 31px;
  font-size: 11px;
}

.tool-route .tool-workspace {
  grid-template-columns: minmax(380px, 0.37fr) minmax(620px, 0.63fr);
  gap: 24px;
  margin-top: 14px;
}

.tool-route .input-card,
.tool-route .result-card {
  min-height: 710px;
  padding: 22px;
  border-radius: 14px;
  box-shadow: none;
}

.tool-route .card-heading {
  min-height: 32px;
  margin-bottom: 18px;
}

.tool-route .card-heading h2 {
  font-size: 17px;
}

.tool-route .card-heading > span,
.tool-route .field-label small {
  font-size: 11px;
}

.tool-route .language-field {
  margin-top: 18px;
}

.tool-route .reference-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.tool-route .reference-heading > label {
  font-size: 11px;
  font-weight: 700;
}

.tool-route .reference-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.tool-route .reference-import {
  position: relative;
  min-height: 30px;
  max-width: 142px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
  font-size: 9px;
}

.tool-route .reference-import:hover {
  border-color: var(--lime);
  color: var(--text);
}

.tool-route .reference-import input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.tool-route .reference-import span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tool-route #referenceText {
  min-height: 210px;
}

.tool-route .primary-button {
  min-height: 54px;
  margin-top: 18px;
}

.tool-route .empty-result,
.tool-route .processing-result {
  min-height: 610px;
}

.tool-route .result-summary {
  grid-template-columns: minmax(160px, 1fr) auto auto;
  gap: 26px;
  padding: 13px 20px;
}

.tool-route .result-summary > div:not(:last-child) {
  border-right: 0;
}

.tool-route .summary-status,
.tool-route .summary-metric {
  display: flex;
  align-items: center;
}

.tool-route .summary-status {
  gap: 9px;
}

.tool-route .summary-status i {
  color: var(--lime);
  font-size: 24px;
}

.tool-route .summary-status strong {
  margin: 0;
  font-family: inherit;
  font-size: 14px;
}

.tool-route .summary-metric {
  gap: 5px;
  padding-left: 22px;
  border-left: 1px solid rgba(183, 255, 26, 0.2);
}

.tool-route .summary-metric strong {
  margin: 0;
  font-size: 19px;
}

.tool-route .summary-metric span {
  color: var(--muted);
  font-size: 9px;
}

.tool-route .segment-header,
.tool-route .segment-row {
  grid-template-columns: 34px 220px minmax(240px, 1fr);
}

.tool-route .segment-list {
  max-height: 525px;
}

.tool-route .segment-row {
  min-height: 58px;
  padding-top: 6px;
  padding-bottom: 6px;
}

.tool-route .segment-text {
  min-height: 44px;
}

@media (max-width: 1180px) {
  .tool-route .tool-view {
    padding-right: 28px;
    padding-left: 28px;
  }

  .tool-route .tool-workspace {
    grid-template-columns: 1fr;
  }

  .tool-route .input-card,
  .tool-route .result-card {
    min-height: auto;
  }

  .tool-route .empty-result,
  .tool-route .processing-result {
    min-height: 430px;
  }
}

@media (max-width: 760px) {
  body.tool-route {
    padding-bottom: 0;
  }

  .tool-route .tool-view {
    padding: 20px 16px 28px;
  }

  .tool-route .tool-title {
    align-items: center;
    gap: 10px;
  }

  .tool-route .title-icon {
    width: 54px;
    height: 54px;
    font-size: 38px;
  }

  .tool-route .tool-title h1 {
    font-size: 28px;
  }

  .tool-route .tool-title p {
    font-size: 10px;
    line-height: 1.6;
  }

  .tool-route .workflow-steps {
    justify-content: flex-start;
    gap: 8px;
    margin-top: 16px;
    padding: 10px 0;
    overflow-x: auto;
  }

  .tool-route .workflow-steps > i {
    flex: none;
    width: 18px;
    font-size: 12px;
  }

  .tool-route .workflow-step {
    flex-direction: row;
    gap: 5px;
    font-size: 9px;
  }

  .tool-route .workflow-step span {
    width: 24px;
    height: 24px;
  }

  .tool-route .tool-workspace {
    margin-top: 12px;
  }

  .tool-route .input-card,
  .tool-route .result-card {
    padding: 17px;
  }

  .tool-route .result-summary {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .tool-route .summary-status {
    grid-column: 1 / -1;
  }

  .tool-route .summary-metric {
    padding-left: 0;
    border-left: 0;
  }

  .tool-route .segment-row {
    grid-template-columns: 27px 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
