/* File: assets/style.css | Purpose: Align tool cards and editors with responsive muted/dark themes. */

/* SECTION: Self-hosted fonts (SIL Open Font License). No remote font requests. */
@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("fonts/plus-jakarta-sans.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/jetbrains-mono.woff2") format("woff2");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

/* SECTION: Design tokens. Muted, low-glare light palette: no pure white surfaces. */
:root {
  color-scheme: light;
  --font: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
  --bg: #cbd4e2;
  --side: #d3dcea;
  --surface: #dce3ed;
  --surface2: #cdd7e5;
  --border: #afbdd0;
  --border-strong: #94a6bf;
  --text: #152238;
  --muted: #3d4e66;
  --accent: #4654c8;
  --accent-strong: #3541a8;
  --accent-soft: #c6ccef;
  --success: #12634e;
  --danger: #b93a4b;
  --c: var(--accent);
  --radius: 14px;
  --shadow: 0 10px 30px rgba(40, 52, 80, 0.1);
  --shadow-sm: 0 2px 6px rgba(40, 52, 80, 0.06);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button,
input,
textarea,
select {
  font: inherit;
}
button {
  cursor: pointer;
}
a {
  color: inherit;
  text-decoration: none;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
.file-label:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
::selection {
  background: #c9cff5;
}
.hidden {
  display: none !important;
}

/* SECTION: App shell and sidebar. */
.shell {
  display: flex;
  min-height: 100vh;
}
.sidebar {
  width: 252px;
  background: var(--side);
  border-right: 1px solid var(--border);
  padding: 24px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: auto;
  flex-shrink: 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 10px 26px;
}
.brand img {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  box-shadow: 0 6px 16px rgba(70, 84, 200, 0.25);
}
.brand strong {
  font-size: 20px;
  font-weight: 800;
  display: block;
  letter-spacing: -0.6px;
}
.brand small {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  line-height: 1.4;
  color: var(--accent-strong);
  font-weight: 700;
}
.sidebar-title {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.6px;
  margin: 18px 12px 8px;
}
.nav {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  background: transparent;
  color: var(--muted);
  width: 100%;
  text-align: left;
  border-radius: 10px;
  padding: 8px 10px;
  margin: 2px 0;
  font-size: 14px;
  font-weight: 600;
  transition:
    background 0.15s,
    color 0.15s,
    transform 0.15s;
}
.nav:hover {
  background: var(--surface2);
  color: var(--text);
  transform: translateX(2px);
}
.nav.active {
  background: var(--accent-soft);
  color: var(--accent-strong);
}
.nav-icon {
  display: grid;
  place-items: center;
  flex: 0 0 26px;
  height: 26px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1;
  color: var(--c);
  background: color-mix(in srgb, var(--c) 16%, transparent);
}
.nav-dot {
  flex: 0 0 10px;
  height: 10px;
  margin: 0 8px;
  border-radius: 50%;
  background: var(--c);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 20%, transparent);
}
.sidebar-bottom {
  /* Separate publisher credit from category navigation in both appearances. */
  margin-top: auto;
  border-top: 1px solid var(--border-strong);
  padding: 22px 10px 0;
  display: grid;
  gap: 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.sidebar-bottom a {
  color: var(--accent-strong);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.sidebar-bottom a:hover {
  color: var(--accent);
}

/* SECTION: Top bar. */
.main {
  flex: 1;
  min-width: 0;
}
.topbar {
  height: 68px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 36px;
  gap: 16px;
}
.breadcrumbs {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}
.breadcrumbs strong {
  color: var(--text);
}
.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.privacy {
  color: var(--success);
  background: #beded2;
  border-radius: 20px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 700;
  margin-right: 6px;
}
.outline {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 13px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition:
    border-color 0.15s,
    background 0.15s,
    transform 0.1s;
}
.outline:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.outline:active,
.primary:active,
.chip:active {
  transform: scale(0.97);
}
.icon-button {
  background: transparent;
  border: 0;
  color: var(--text);
  font-size: 20px;
  display: none;
}
.small {
  padding: 6px 10px;
}

/* SECTION: Hero. */
main {
  max-width: 1400px;
  margin: auto;
  padding: 32px 40px 60px;
}
.hero {
  background:
    radial-gradient(ellipse at 92% 0, #acd5cc 0, transparent 48%),
    linear-gradient(120deg, #c1c9ee, #bfcfe6 58%, #cec4e6);
  border: 1px solid #9faed4;
  border-radius: 20px;
  padding: 40px 42px;
  position: relative;
  overflow: hidden;
}
.hero:after {
  content: "{ }";
  position: absolute;
  right: 7%;
  top: 6%;
  font-family: var(--mono);
  font-size: 170px;
  font-weight: 800;
  color: rgba(70, 84, 200, 0.09);
  transform: rotate(-12deg);
  pointer-events: none;
}
.eyebrow {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2px;
  color: color-mix(in srgb, var(--c) 65%, #000);
}
.hero h1 {
  font-size: clamp(29px, 3.4vw, 46px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -1.4px;
  margin: 14px 0;
}
.hero h1 em {
  font-style: normal;
  background: linear-gradient(100deg, #3541a8, #603ba8 45%, #086657);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p {
  color: #31435d;
  font-size: 14px;
  max-width: 570px;
  line-height: 1.7;
  margin: 0;
}
.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
  color: #31435d;
  font-size: 13px;
  font-weight: 600;
}
.hero-stats span {
  background: rgba(214, 224, 239, 0.78);
  border: 1px solid #a7b6d1;
  border-radius: 12px;
  padding: 9px 14px;
}
.hero-stats strong {
  color: var(--accent-strong);
  font-size: 16px;
  font-weight: 800;
  margin-right: 6px;
  font-variant-numeric: tabular-nums;
}

/* SECTION: Toolbar, search and category chips. */
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin: 32px 0 20px;
}
.toolbar h2 {
  font-size: 23px;
  font-weight: 800;
  letter-spacing: -0.6px;
  margin: 0 0 4px;
}
.toolbar p {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}
.searchbox {
  width: min(100%, 350px);
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  color: var(--muted);
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
.searchbox:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(70, 84, 200, 0.14);
}
.searchbox input {
  flex: 1;
  min-width: 0;
  padding: 12px 0;
  background: transparent;
  border: 0;
  outline: none;
  color: var(--text);
  font-size: 13px;
}
.searchbox kbd {
  font-family: var(--mono);
  font-size: 11px;
  border: 1px solid var(--border);
  background: var(--surface2);
  padding: 2px 7px;
  border-radius: 5px;
}
.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 17px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  border-radius: 25px;
  padding: 7px 13px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition:
    background 0.15s,
    color 0.15s,
    border-color 0.15s,
    transform 0.1s;
}
.chip:before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c);
}
.chip:hover {
  border-color: var(--c);
  color: var(--text);
}
.chip.active {
  background: color-mix(in srgb, var(--c) 15%, var(--surface));
  color: color-mix(in srgb, var(--c) 70%, #000);
  border-color: color-mix(in srgb, var(--c) 55%, var(--surface));
}

/* SECTION: Tool cards use category tint and a shared title/description/footer structure. */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.tool-card {
  position: relative;
  overflow: hidden;
  min-width: 0;
  text-align: left;
  background: linear-gradient(
    145deg,
    color-mix(in srgb, var(--c) 12%, var(--surface)),
    var(--surface)
  );
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  min-height: 151px;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transition:
    transform 0.18s,
    border-color 0.18s,
    box-shadow 0.18s;
}
.tool-card:before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    220px circle at var(--mx, 50%) var(--my, 0%),
    color-mix(in srgb, var(--c) 16%, transparent),
    transparent 70%
  );
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
}
.tool-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  box-shadow: 0 12px 26px color-mix(in srgb, var(--c) 16%, transparent);
}
.tool-card:hover:before {
  opacity: 1;
}
.tool-card > * {
  position: relative;
}
.card-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--c), color-mix(in srgb, var(--c) 68%, #fff));
  color: #fff;
  font-weight: 800;
  font-size: 18px;
  line-height: 1;
  margin-bottom: 14px;
  box-shadow: 0 6px 14px color-mix(in srgb, var(--c) 32%, transparent);
  transition: transform 0.2s;
}
.card-icon.long {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: -0.3px;
}
.tool-card:hover .card-icon {
  transform: scale(1.08) rotate(-4deg);
}
.tool-card strong {
  font-size: 15px;
  font-weight: 700;
  display: block;
}
.tool-card p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  margin: 8px 0 0;
}
.card-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 14px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}
.card-meta span:first-child {
  color: color-mix(in srgb, var(--c) 75%, #000);
}

/* SECTION: Tool workbench panel. */
.tool-panel {
  margin-top: 25px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 26px;
  box-shadow: var(--shadow);
  scroll-margin-top: 88px;
}
.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  border-bottom: 1px solid var(--border);
  padding-bottom: 19px;
}
.panel-head h2 {
  margin: 8px 0;
  font-size: 23px;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.panel-head p {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}
.panel-actions {
  display: flex;
  gap: 8px;
}
.workbench {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  padding-top: 21px;
}
.editor-side {
  min-width: 0;
}
.editor-side label {
  display: block;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 10px;
}
.editor-side textarea {
  width: 100%;
  min-height: 240px;
  resize: vertical;
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  font: 14px/1.65 var(--mono);
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
.editor-side textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(70, 84, 200, 0.12);
  outline: none;
}
.editor-actions,
.output-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.output-heading {
  justify-content: space-between;
  margin: 0 0 10px;
}
.output-heading label {
  margin: 0;
}
.output-heading > div {
  display: flex;
  gap: 7px;
}
.primary {
  background: linear-gradient(120deg, #4654c8, #7a5ad6);
  border: 0;
  border-radius: 10px;
  padding: 11px 16px;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 6px 16px rgba(70, 84, 200, 0.28);
  transition:
    filter 0.15s,
    transform 0.1s,
    box-shadow 0.15s;
}
.primary:hover {
  filter: brightness(1.08);
  box-shadow: 0 8px 20px rgba(70, 84, 200, 0.36);
}
#result-status {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  margin-top: 12px;
  min-height: 18px;
}
#result-status.ok {
  color: var(--success);
}
#result-status.error {
  color: var(--danger);
}
.control {
  margin: 12px 0;
  display: grid;
  gap: 6px;
}
.control label {
  margin: 0;
}
.control input,
.control select {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  color: var(--text);
  font: 14px var(--mono);
}
.empty {
  text-align: center;
  color: var(--muted);
  padding: 45px;
}

/* SECTION: Footer and toast. */
footer {
  background: color-mix(in srgb, var(--accent) 6%, var(--bg));
  text-align: center;
  border-top: 1px solid var(--border);
  padding: 22px;
  color: var(--muted);
  font-size: 13px;
}
footer a {
  color: var(--accent);
  font-weight: 700;
}
#toast {
  position: fixed;
  bottom: 25px;
  right: 25px;
  z-index: 30;
  background: #263247;
  color: #f1f3f8;
  border-radius: 12px;
  padding: 12px 18px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px) scale(0.96);
  pointer-events: none;
  transition:
    opacity 0.22s,
    transform 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.3);
}
#toast.show {
  opacity: 1;
  transform: none;
}

/* SECTION: Dedicated tool pages and clear return navigation. */
.tool-card {
  display: flex;
  flex-direction: column;
}
.tool-view .hero,
.tool-view .toolbar,
.tool-view .chips,
.tool-view .tool-grid,
.tool-view .empty {
  display: none !important;
}
.tool-view .tool-panel {
  margin-top: 0;
  min-height: 65vh;
}
.tool-view .editor-side textarea {
  min-height: 340px;
}
.back-to-tools {
  color: var(--accent-strong);
  border-color: var(--accent);
  white-space: nowrap;
}
.breadcrumbs {
  min-width: 0;
  overflow-wrap: anywhere;
}
.panel-actions {
  flex-wrap: wrap;
}
textarea::placeholder,
input::placeholder {
  color: var(--muted);
  opacity: 1;
}

/* SECTION: Responsive breakpoints. */
@media (max-width: 1150px) {
  .tool-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .sidebar {
    width: 224px;
  }
  main {
    padding: 28px;
  }
  .topbar {
    padding: 0 28px;
  }
}
@media (max-width: 850px) {
  .sidebar {
    position: fixed;
    left: -270px;
    z-index: 20;
    transition: left 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: var(--shadow);
  }
  .sidebar.open {
    left: 0;
  }
  .icon-button {
    display: block;
  }
  .tool-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .privacy {
    display: none;
  }
  .workbench {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 550px) {
  main {
    padding: 18px 14px 35px;
  }
  .topbar {
    padding: 0 14px;
    height: 60px;
  }
  .top-actions .outline,
  .top-actions .file-label {
    display: none;
  }
  .hero {
    padding: 28px 22px;
  }
  .hero h1 {
    letter-spacing: -0.9px;
  }
  .hero:after {
    font-size: 110px;
  }
  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }
  .searchbox {
    width: 100%;
  }
  .tool-grid {
    gap: 10px;
  }
  .tool-card {
    padding: 14px;
    min-height: 148px;
  }
  .panel-head {
    flex-direction: column;
  }
  .tool-panel {
    padding: 17px;
    scroll-margin-top: 72px;
  }
  .breadcrumbs {
    font-size: 13px;
  }
}
@media (max-width: 360px) {
  .tool-grid {
    grid-template-columns: 1fr;
  }
}

/* SECTION: Honor the OS reduced-motion preference (app.js also skips its animations). */
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* SECTION: Full workbench, personal appearance and responsive navigation. */
.main {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
main {
  flex: 1;
  width: 100%;
  min-width: 0;
}
footer {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px 40px;
  margin-top: auto;
  line-height: 1.8;
  padding: 25px 30px;
}
.sidebar-bottom {
  line-height: 1.8;
}
.tool-panel,
.panel-head > div,
.editor-side,
.code-editor {
  min-width: 0;
}
#panel-title:focus {
  outline: none;
}
.tool-card p {
  line-height: 1.7;
}
.tool-card {
  min-height: 205px;
}
.brand small {
  white-space: nowrap;
}
.workbench-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.workbench-toolbar label {
  display: flex;
  align-items: center;
  gap: 7px;
}
.workbench-toolbar select {
  width: auto;
}
input:not([type="checkbox"]):not([type="file"]),
select {
  min-width: 0;
  max-width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 10px;
  color: var(--text);
}
input[type="checkbox"] {
  accent-color: var(--accent);
  width: 17px;
  height: 17px;
  vertical-align: middle;
}
#file-info {
  font-size: 12px;
  color: var(--muted);
}
.code-editor {
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  overflow: hidden;
  width: 100%;
  background: var(--surface2);
}
.code-editor:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.cm-editor {
  height: 340px;
}
.cm-editor.cm-focused {
  outline: none;
}
.cm-scroller {
  overflow: auto;
}
.cm-search {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 8px !important;
  font-size: 13px;
}
.cm-search input {
  max-width: 180px !important;
}
.cm-search button {
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 4px 7px;
}
.control .code-editor .cm-editor {
  height: 190px;
}
#extra-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  gap: 12px;
}
.control {
  grid-column: 1/-1;
}
.option-field {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  font-size: 13px;
  font-weight: 600;
}
.control input,
.control select {
  font-size: 14px;
}
.send-output {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
  font-size: 13px;
}
.send-output select {
  flex: 1;
  min-width: 150px;
}
#special-controls:not(:empty) {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
#special-controls p {
  color: var(--muted);
  font-size: 13px;
}
#special-controls h3 {
  font-size: 16px;
  margin: 0 0 8px;
}
.parameter-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
  margin-bottom: 8px;
}
#special-controls > button {
  margin: 8px 8px 0 0;
}
.chain-step {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  border: 1px solid var(--border);
  padding: 12px;
  border-radius: 10px;
  margin-bottom: 12px;
  background: var(--surface2);
}
.chain-step > select {
  flex: 1;
  min-width: 150px;
}
.option-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  gap: 12px;
  width: 100%;
}
.file-picker {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  font-size: 13px;
}
.dragging .code-editor {
  outline: 3px dashed var(--accent);
}
#rich-results {
  border-top: 1px solid var(--border);
  margin-top: 24px;
  padding-top: 16px;
}
#rich-results h3 {
  font-size: 17px;
}
#rich-results p {
  font-size: 13px;
  color: var(--muted);
}
#rich-results > input {
  width: min(100%, 500px);
  margin-bottom: 14px;
}
.diff-view {
  max-width: 100%;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.cm-mergeView {
  max-width: 100%;
  background: var(--surface2);
}
.cm-mergeView > .cm-mergeViewEditors > .cm-mergeViewEditor {
  min-width: 0;
}
.tree-node {
  margin: 8px 0 8px 14px;
  font: 13px/1.8 var(--mono);
  overflow-wrap: anywhere;
}
.tree-node summary {
  cursor: pointer;
}
.tree-node button {
  margin-left: 12px;
  font-size: 11px;
  padding: 3px 7px;
}
.json-tree {
  max-height: 600px;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--border);
  background: var(--surface2);
  border-radius: 10px;
}
.match-preview {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 400px;
  overflow: auto;
  background: var(--surface2);
  padding: 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font: 14px/1.8 var(--mono);
}
mark {
  background: #e9c872;
  color: #302812;
  border-radius: 3px;
}
#history-panel {
  margin-top: 24px;
  font-size: 13px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}
#history-panel summary {
  cursor: pointer;
  font-weight: 700;
}
#history-list {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
button:disabled {
  cursor: wait;
  opacity: 0.65;
}
#result-status.error {
  padding: 12px;
  border: 1px solid var(--danger);
  border-radius: 8px;
  overflow-wrap: anywhere;
}
.top-actions kbd {
  margin-left: 6px;
  font: 11px var(--mono);
  opacity: 0.8;
}
dialog {
  width: min(650px, calc(100vw - 28px));
  max-height: 85vh;
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  background: var(--surface);
  color: var(--text);
  padding: 24px;
  box-shadow: 0 24px 80px #101c3540;
}
dialog::backdrop {
  background: #111c356b;
  backdrop-filter: blur(4px);
}
.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}
.dialog-head h2 {
  font-size: 22px;
  margin: 0;
}
#command-query {
  width: 100%;
}
#command-results {
  display: grid;
  gap: 5px;
  max-height: 50vh;
  overflow: auto;
  margin-top: 16px;
}
#command-results a {
  display: block;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
}
#command-results a:hover,
#command-results a:focus-visible {
  background: var(--accent-soft);
  color: var(--accent-strong);
}
#settings-dialog > label {
  display: block;
  margin: 16px 0;
  font-size: 14px;
  font-weight: 600;
}
#settings-dialog select {
  display: block;
  width: 100%;
  margin-top: 8px;
}
#settings-dialog p {
  font-size: 13px;
  color: var(--muted);
}
#settings-dialog > button {
  margin: 5px;
}
[data-density="compact"] .tool-card {
  padding: 14px;
  min-height: 180px;
}
[data-density="compact"] .tool-grid {
  gap: 10px;
}
[data-density="compact"] .card-icon {
  width: 34px;
  height: 34px;
  margin-bottom: 9px;
}
[data-density="compact"] .nav {
  padding-top: 5px;
  padding-bottom: 5px;
}
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #172235;
  --side: #1b2940;
  --surface: #24334a;
  --surface2: #1b293d;
  --border: #3a4c65;
  --border-strong: #536984;
  --text: #e5edf8;
  --muted: #b2c2d8;
  --accent: #9aa7ff;
  --accent-strong: #bac3ff;
  --accent-soft: #35446b;
  --success: #71d2b4;
  --danger: #ffa0af;
  --shadow: 0 10px 30px #07102044;
  --shadow-sm: 0 2px 6px #07102033;
}
[data-theme="dark"] .hero {
  background:
    radial-gradient(ellipse at 92% 0, #254f51 0, transparent 55%),
    linear-gradient(120deg, #303b66, #263c53 58%, #40375d);
  border-color: #4c5c80;
}
[data-theme="dark"] .hero p,
[data-theme="dark"] .hero-stats {
  color: var(--muted);
}
[data-theme="dark"] .hero h1 em {
  background: linear-gradient(100deg, #b6bfff, #c5a9ef 45%, #7fe0cf);
  background-clip: text;
  -webkit-background-clip: text;
}
[data-theme="dark"] .hero-stats span {
  background: #26394dcc;
  border-color: #506078;
}
[data-theme="dark"] .privacy {
  background: #24493f;
}
[data-theme="dark"] .eyebrow,
[data-theme="dark"] .card-meta span:first-child {
  color: color-mix(in srgb, var(--c) 40%, #fff);
}
[data-theme="dark"] .chip.active {
  color: var(--text);
}
[data-theme="dark"] .primary {
  color: #fff;
  background: linear-gradient(120deg, #4958bc, #6f4ead);
}
[data-theme="dark"] ::selection {
  background: #46598a;
}
@media (max-width: 1150px) {
  .privacy {
    display: none;
  }
  .topbar {
    padding: 0 22px;
  }
  .top-actions {
    gap: 7px;
  }
  .top-actions kbd {
    display: none;
  }
}
@media (max-width: 850px) {
  .topbar {
    gap: 12px;
  }
  .breadcrumbs {
    flex: 1;
    font-size: 12px;
  }
  .tool-view .editor-side textarea {
    min-height: 260px;
  }
  .panel-head {
    flex-direction: column;
  }
  .panel-actions {
    width: 100%;
  }
  .back-to-tools {
    margin-left: auto;
  }
  .workbench-toolbar {
    gap: 10px;
  }
}
@media (max-width: 550px) {
  .topbar {
    padding: 0 12px;
  }
  .top-actions #command-open,
  .top-actions #settings-open {
    display: block;
    font-size: 12px;
    padding: 7px 9px;
  }
  .breadcrumbs {
    font-size: 11px;
  }
  .workbench {
    grid-template-columns: minmax(0, 1fr);
  }
  .workbench-toolbar {
    align-items: flex-start;
  }
  #file-info {
    width: 100%;
  }
  .parameter-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  .parameter-row button {
    grid-column: 1/-1;
    justify-self: end;
  }
  .cm-editor {
    height: 300px;
  }
  footer {
    flex-direction: column;
    gap: 8px;
    padding: 24px 18px;
  }
  .tree-node {
    margin-left: 8px;
  }
  .panel-head h2 {
    overflow-wrap: anywhere;
    font-size: 22px;
  }
  .tool-card {
    padding: 14px;
  }
  .tool-card strong {
    font-size: 14px;
  }
  .tool-card p {
    font-size: 12px;
  }
  dialog {
    padding: 18px;
  }
  .send-output {
    align-items: stretch;
  }
  .top-actions {
    flex-shrink: 0;
  }
}

.searchbox input {
  border: 0 !important;
  background: transparent !important;
  border-radius: 0 !important;
}

.code-editor[hidden] {
  display: none;
}
[aria-invalid="true"] {
  outline: 2px solid var(--danger);
  outline-offset: 2px;
}

/* SECTION: Consistent card anatomy aligns names, descriptions and category footers. */
.tool-card {
  height: 100%;
}
.tool-card .card-icon {
  flex: 0 0 auto;
}
.tool-card strong {
  min-height: 3em;
  line-height: 1.5;
}
.tool-card p {
  flex: 1;
  margin-bottom: 0;
}
.card-meta {
  margin-top: auto;
  padding-top: 16px;
  align-items: center;
  min-height: 2.5em;
}

/* SECTION: Options span the page; headings, editors and buttons share fixed rows. */
:root {
  --editor-height: 340px;
}
#extra-controls:empty {
  display: none;
}
#extra-controls:not(:empty) {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
#extra-controls .control,
#extra-controls .option-field {
  margin: 0;
}
.workbench {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}
.editor-side {
  display: flex;
  flex-direction: column;
}
.editor-heading {
  display: flex;
  align-items: center;
  min-height: 32px;
  margin-bottom: 10px;
}
.editor-heading label {
  margin: 0;
  line-height: 1.6;
}
.code-editor .cm-editor {
  height: var(--editor-height);
}
.input-placeholder {
  height: calc(var(--editor-height) + 2px);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface2);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  color: var(--muted);
}
.input-placeholder p {
  max-width: 260px;
  margin: 8px 0 0;
  font-size: 13px;
}
.editor-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-height: 42px;
  margin: 12px 0 0;
}
.editor-actions button {
  min-height: 42px;
}
.output-actions {
  justify-content: flex-start;
}
.workbench-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 560px);
  align-items: start;
  gap: 18px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.workbench-footer #result-status {
  margin: 0;
  min-width: 0;
  align-self: center;
}
.send-output {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin: 0;
  min-width: 0;
}
.send-output label {
  white-space: nowrap;
}
.send-output select {
  min-width: 0;
  width: 100%;
  height: 42px;
}
.send-output button {
  min-height: 42px;
  white-space: nowrap;
}
@media (max-width: 1150px) {
  .workbench-footer {
    grid-template-columns: minmax(0, 1fr);
  }
  .send-output {
    width: min(100%, 560px);
    justify-self: end;
  }
}
@media (max-width: 850px) {
  .workbench {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }
  .editor-heading {
    min-height: 28px;
  }
}
@media (max-width: 550px) {
  :root {
    --editor-height: 300px;
  }
  .send-output {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .send-output label {
    grid-column: 1/-1;
  }
  .editor-actions {
    gap: 7px;
  }
  .editor-actions button {
    padding: 9px 11px;
  }
  .tool-card strong {
    min-height: 3em;
  }
}
/* SECTION: Compact catalogue tiles retain shared title, description and footer rows. */
.tool-grid {
  gap: 12px;
}
.tool-card,
[data-density="compact"] .tool-card {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  grid-template-rows: minmax(42px, auto) 1fr auto;
  column-gap: 10px;
  row-gap: 8px;
  padding: 14px;
  min-height: 164px;
}
.tool-card .card-icon,
[data-density="compact"] .card-icon {
  width: 32px;
  height: 32px;
  margin: 0;
  border-radius: 9px;
  font-size: 15px;
}
.tool-card .card-icon.long {
  font-size: 10px;
}
.tool-card strong {
  min-height: 0;
  font-size: 14px;
  line-height: 1.5;
}
.tool-card p {
  grid-column: 1 / -1;
  margin: 0;
  line-height: 1.6;
}
.tool-card .card-meta {
  grid-column: 1 / -1;
  min-height: 21px;
  padding-top: 4px;
  margin: 0;
  font-size: 12px;
}
[data-density="compact"] .tool-card {
  padding: 11px;
  min-height: 150px;
  row-gap: 6px;
}
@media (max-width: 550px) {
  .tool-card,
  [data-density="compact"] .tool-card {
    grid-template-columns: 28px minmax(0, 1fr);
    column-gap: 7px;
    padding: 11px;
  }
  .tool-card .card-icon,
  [data-density="compact"] .card-icon {
    width: 28px;
    height: 28px;
  }
  .tool-card strong {
    font-size: 13px;
  }
}
/* #End of File | #assets/style.css | #Signed: PandaDev LLC */
