:root {
  --bg: #f3f5ff;
  --bg-strong: #e6ecff;
  --surface: #ffffff;
  --surface-soft: #f8faff;
  --text: #182033;
  --text-muted: #51607f;
  --border: #d5def3;
  --primary: #1659d6;
  --primary-strong: #0f44ab;
  --accent: #00a47a;
  --danger: #bf2445;
  --shadow: 0 16px 32px rgba(27, 53, 113, 0.11);
  --radius: 16px;
}

body[data-theme="dark"] {
  --bg: #0f1628;
  --bg-strong: #1a2643;
  --surface: #1a2339;
  --surface-soft: #202c47;
  --text: #edf2ff;
  --text-muted: #b2c0e4;
  --border: #2f3f66;
  --primary: #5d9dff;
  --primary-strong: #82b5ff;
  --accent: #2fd3a2;
  --danger: #ff6f8c;
  --shadow: 0 16px 28px rgba(0, 0, 0, 0.36);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: Manrope, "Noto Sans TC", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 10%, rgba(22, 89, 214, 0.16), transparent 26%),
    radial-gradient(circle at 88% 12%, rgba(0, 164, 122, 0.12), transparent 24%),
    linear-gradient(180deg, var(--bg), var(--bg-strong));
  line-height: 1.6;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--border);
  background: color-mix(in oklab, var(--surface) 90%, transparent);
  backdrop-filter: blur(9px);
}

.topbar {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0.4px;
  color: var(--text);
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.36);
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.top-nav a {
  font-size: 0.93rem;
  font-weight: 600;
}

.lang-toggle {
  min-width: 54px;
}

.layout-shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: 22px 18px 34px;
}

.hero {
  background: linear-gradient(140deg, color-mix(in oklab, var(--surface) 86%, var(--primary) 14%), var(--surface));
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}

.hero h1 {
  margin: 0;
  line-height: 1.2;
}

.hero p {
  margin: 10px 0 0;
  color: var(--text-muted);
}

.tool-page {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.panel {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  min-width: 0;
}

.panel h2 {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 1.05rem;
}

.lead {
  margin: 4px 0 0;
  color: var(--text-muted);
}

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

.field + .field {
  margin-top: 14px;
}

.range-field {
  gap: 6px;
}

.range-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.range-value {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 66px;
  padding: 2px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in oklab, var(--surface-soft) 80%, var(--primary) 20%);
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.4;
  white-space: nowrap;
}

.range-field input[type="range"] {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  height: 28px;
}

label {
  font-weight: 700;
  font-size: 0.93rem;
}

input[type="text"],
input[type="number"],
input[type="search"],
input[type="range"],
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--text);
  padding: 11px 12px;
  font: inherit;
}

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

textarea[readonly] {
  opacity: 0.95;
}

.hint {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.hint.status-idle {
  color: var(--text-muted);
}

.hint.status-valid {
  color: var(--accent);
  font-weight: 800;
}

.hint.status-invalid {
  color: var(--danger);
  font-weight: 800;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn {
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 14px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}

.btn:hover {
  transform: translateY(-1px);
  border-color: color-mix(in oklab, var(--primary) 56%, var(--border));
}

.btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.btn:disabled {
  opacity: 0.58;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: transparent;
}

.btn-primary:hover {
  background: var(--primary-strong);
}

.btn-danger {
  color: #fff;
  background: var(--danger);
  border-color: transparent;
}

.btn-theme {
  width: auto;
  min-width: 72px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

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

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

.category-group + .category-group {
  margin-top: 28px;
}

.category-heading {
  margin: 0 0 12px;
  font-size: 1.18rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: linear-gradient(
    140deg,
    color-mix(in oklab, var(--surface-soft) 76%, var(--primary) 24%),
    var(--surface-soft)
  );
}

.category-count {
  min-width: 28px;
  text-align: center;
  border-radius: 999px;
  border: 1px solid var(--border);
  padding: 2px 8px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.tool-inline-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 0;
}

.tool-inline-item {
  display: inline-flex;
  align-items: center;
  color: var(--primary);
  font-weight: 700;
}

.tool-inline-item + .tool-inline-item::before {
  content: "|";
  color: var(--text-muted);
  margin: 0 9px;
}

.tool-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-soft);
  padding: 14px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tool-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.tool-card.is-clickable {
  cursor: pointer;
}

.tool-card.is-clickable:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

.tool-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.tool-card h3 {
  margin: 0 0 4px;
  font-size: 1rem;
}

.tool-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.fav-btn {
  min-width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: color-mix(in oklab, var(--primary) 72%, var(--text));
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.fav-btn:hover {
  border-color: color-mix(in oklab, var(--primary) 56%, var(--border));
}

.search-block {
  gap: 10px;
}

.search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 12px;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
}

.chip.is-active {
  border-color: transparent;
  background: var(--primary);
  color: #fff;
}

.tag {
  display: inline-block;
  margin-top: 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 9px;
  color: var(--text-muted);
}

.drop-zone {
  border: 2px dashed color-mix(in oklab, var(--primary) 30%, var(--border));
  border-radius: 14px;
  padding: 20px;
  text-align: center;
  background: var(--surface-soft);
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.drop-zone.is-dragging {
  border-color: var(--primary);
  background: color-mix(in oklab, var(--surface-soft) 84%, var(--primary) 16%);
}

.drop-zone strong {
  display: block;
  margin-bottom: 5px;
}

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

.preview-box {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: var(--surface-soft);
}

.preview-box img,
.preview-box canvas {
  width: 100%;
  max-height: 300px;
  object-fit: contain;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: #fff;
}

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

.gallery-panel {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-soft);
  padding: 10px;
}

.gallery-panel h3 {
  margin: 0 0 8px;
  font-size: 0.95rem;
}

.thumb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
  max-height: 290px;
  overflow: auto;
}

.thumb-grid.thumb-grid-single-large {
  grid-template-columns: minmax(0, 1fr);
  max-height: none;
}

.thumb-grid.thumb-grid-single-large .thumb-item {
  padding: 10px;
}

.thumb-grid.thumb-grid-single-large .thumb-item img {
  aspect-ratio: auto;
  height: min(56vh, 520px);
  object-fit: contain;
}

.thumb-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  padding: 6px;
  cursor: pointer;
  text-align: left;
}

.thumb-item:hover {
  border-color: color-mix(in oklab, var(--primary) 56%, var(--border));
}

.thumb-item img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  display: block;
}

.thumb-item span {
  display: block;
  margin-top: 4px;
  font-size: 0.72rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.thumb-empty {
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.82rem;
  padding: 14px 10px;
  text-align: center;
}

.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(6, 10, 20, 0.82);
  display: grid;
  place-items: center;
  padding: 16px;
}

.image-lightbox[hidden] {
  display: none;
}

.image-lightbox-panel {
  width: min(96vw, 980px);
  max-height: 92vh;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 8px;
}

.image-lightbox-head {
  display: flex;
  justify-content: flex-end;
}

.image-lightbox-close {
  min-width: 44px;
  height: 36px;
}

.image-lightbox-image {
  width: 100%;
  max-height: 76vh;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
}

.image-lightbox-caption {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.86rem;
  text-align: center;
}

.kv {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  font-size: 0.9rem;
}

.kv span {
  color: var(--text-muted);
}

.tree-view-container {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-soft);
  padding: 10px;
  min-height: 120px;
  max-height: 520px;
  overflow: auto;
}

.sql-highlight-output {
  margin: 0;
  min-height: 170px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: color-mix(in oklab, var(--surface-soft) 84%, var(--bg) 16%);
  padding: 12px;
  font: 0.9rem/1.58 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
}

.sql-token.sql-keyword {
  color: #1e63d4;
  font-weight: 800;
}

.sql-token.sql-string {
  color: #0d9063;
}

.sql-token.sql-comment {
  color: #7f8aa7;
  font-style: italic;
}

.sql-token.sql-number {
  color: #b96500;
}

.sql-token.sql-punc {
  color: color-mix(in oklab, var(--text) 64%, var(--primary));
}

.json-graph-wrap {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: color-mix(in oklab, var(--surface-soft) 88%, var(--bg) 12%);
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 260px;
  height: 560px;
  overflow: auto;
  overscroll-behavior: contain;
  touch-action: pan-x pan-y;
  contain: inline-size;
}

.json-graph-inner {
  position: relative;
  min-width: 100%;
  min-height: 100%;
}

.json-graph-stage {
  position: relative;
  transform-origin: top left;
  will-change: transform;
}

.json-graph-svg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.json-graph-edge {
  fill: none;
  stroke: color-mix(in oklab, var(--primary) 64%, var(--border));
  stroke-width: 1.8;
  stroke-linecap: round;
}

.json-graph-node-layer {
  position: absolute;
  inset: 0;
}

.json-graph-node {
  position: absolute;
  border: 1px solid color-mix(in oklab, var(--primary) 34%, var(--border));
  border-radius: 10px;
  background: color-mix(in oklab, var(--surface) 90%, var(--primary) 10%);
  box-shadow: 0 6px 16px rgba(14, 34, 76, 0.16);
  padding: 8px 10px;
  display: grid;
  gap: 6px;
}

.json-graph-node.is-branch {
  cursor: pointer;
}

.json-graph-node.is-branch:hover {
  border-color: color-mix(in oklab, var(--primary) 62%, var(--border));
}

.json-graph-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.json-graph-tools {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.json-graph-copy-path,
.json-graph-toggle {
  width: 24px;
  height: 24px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: color-mix(in oklab, var(--surface-soft) 82%, var(--primary) 18%);
  color: var(--primary);
  font: 700 0.8rem/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.json-graph-copy-path:hover,
.json-graph-toggle:hover {
  border-color: color-mix(in oklab, var(--primary) 65%, var(--border));
}

.json-graph-title {
  margin: 0;
  color: var(--primary);
  font: 700 0.84rem/1.3 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.json-graph-lines {
  display: grid;
  gap: 3px;
}

.json-graph-line {
  margin: 0;
  color: var(--text);
  font: 0.79rem/1.32 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  word-break: break-word;
}

.graph-control-row {
  display: grid;
  grid-template-columns: auto auto minmax(120px, 1fr) auto auto auto;
  align-items: center;
  gap: 8px;
  margin: 2px 0 6px;
}

.graph-control-row label {
  white-space: nowrap;
}

.graph-zoom-btn {
  min-width: 48px;
}

.graph-control-row input[type="range"] {
  width: 100%;
}

.json-tree-branch + .json-tree-branch,
.json-tree-branch + .json-tree-leaf,
.json-tree-leaf + .json-tree-branch,
.json-tree-leaf + .json-tree-leaf {
  margin-top: 4px;
}

.json-tree-summary,
.json-tree-leaf {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88rem;
  line-height: 1.45;
}

.json-tree-summary {
  cursor: pointer;
}

.json-tree-summary:hover,
.json-tree-leaf:hover {
  background: color-mix(in oklab, var(--surface-soft) 78%, var(--primary) 22%);
}

.json-tree-children {
  margin-left: 18px;
  border-left: 1px dashed color-mix(in oklab, var(--border) 78%, transparent);
  padding-left: 10px;
}

.json-tree-key {
  color: color-mix(in oklab, var(--primary) 72%, var(--text));
  font-weight: 700;
}

.json-tree-sep {
  color: var(--text-muted);
}

.json-tree-size,
.json-tree-type {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 0.73rem;
  color: var(--text-muted);
}

.json-tree-copy-path {
  margin-left: auto;
  width: 24px;
  height: 24px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: color-mix(in oklab, var(--surface-soft) 82%, var(--primary) 18%);
  color: var(--primary);
  font: 700 0.8rem/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.json-tree-copy-path:hover {
  border-color: color-mix(in oklab, var(--primary) 62%, var(--border));
}

.json-tree-value.is-string {
  color: #0f8b5f;
}

.json-tree-value.is-number {
  color: #ae6a00;
}

.json-tree-value.is-boolean,
.json-tree-value.is-null {
  color: #9f1d6f;
}

.json-tree-empty {
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.84rem;
  padding: 3px 0;
}

.diff-output {
  min-height: 190px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-soft);
  padding: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.diff-line {
  border-radius: 8px;
  padding: 3px 8px;
}

.diff-line-title {
  font-weight: 800;
  color: var(--primary);
  background: color-mix(in oklab, var(--primary) 12%, var(--surface-soft));
}

.diff-line-summary {
  color: color-mix(in oklab, var(--accent) 62%, var(--text));
  background: color-mix(in oklab, var(--accent) 10%, var(--surface-soft));
}

.diff-line-add {
  color: color-mix(in oklab, var(--accent) 66%, var(--text));
  background: color-mix(in oklab, var(--accent) 12%, var(--surface-soft));
}

.diff-line-remove {
  color: color-mix(in oklab, var(--danger) 74%, var(--text));
  background: color-mix(in oklab, var(--danger) 12%, var(--surface-soft));
}

.diff-line-change {
  color: color-mix(in oklab, var(--primary) 62%, var(--text));
  background: color-mix(in oklab, var(--primary) 12%, var(--surface-soft));
}

.diff-line-empty {
  color: var(--text-muted);
}

.diff-inline {
  font-weight: 800;
  color: var(--danger);
}

.diff-gap {
  height: 8px;
}

.json-error-wrap {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-soft);
  padding: 10px;
}

.json-error-title {
  margin: 0 0 8px;
  font-weight: 700;
  color: var(--text-muted);
}

.json-error-preview {
  max-height: 260px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}

.json-error-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 6px 8px;
  border-bottom: 1px solid color-mix(in oklab, var(--border) 70%, transparent);
}

.json-error-row:last-child {
  border-bottom: 0;
}

.json-error-row.is-error {
  background: color-mix(in oklab, var(--danger) 12%, var(--surface));
  box-shadow: inset 3px 0 0 var(--danger);
}

.json-error-ln {
  display: inline-flex;
  justify-content: flex-end;
  color: var(--text-muted);
  font: 700 0.82rem/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.json-error-code {
  margin: 0;
  font: 0.86rem/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

#uc-inputs {
  display: grid;
  gap: 10px;
}

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

.uc-result-item {
  border: 1px solid var(--border);
  background: var(--surface-soft);
  border-radius: 12px;
  padding: 10px;
}

.uc-result-label {
  color: var(--text-muted);
  font-size: 0.82rem;
  margin-bottom: 4px;
}

.uc-result-value {
  font-weight: 700;
  word-break: break-word;
}

.uc-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface-soft);
}

.uc-table th,
.uc-table td {
  border-bottom: 1px solid var(--border);
  padding: 8px 10px;
  text-align: left;
  font-size: 0.9rem;
}

.uc-table th {
  background: color-mix(in oklab, var(--primary) 14%, var(--surface-soft));
}

.uc-table tr:last-child td {
  border-bottom: 0;
}

.link-list {
  margin: 0;
  padding-left: 17px;
}

.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 22px;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 18px 36px;
  color: var(--text-muted);
}

.toast-stack {
  position: fixed;
  right: 14px;
  bottom: 14px;
  display: grid;
  gap: 8px;
  z-index: 50;
}

.toast {
  border-radius: 12px;
  padding: 10px 12px;
  min-width: 220px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
  font-weight: 600;
}

.toast.error {
  border-color: color-mix(in oklab, var(--danger) 40%, var(--border));
}

.toast.success {
  border-color: color-mix(in oklab, var(--accent) 45%, var(--border));
}

@media (max-width: 760px) {
  .topbar {
    flex-wrap: wrap;
    justify-content: center;
  }

  .top-nav {
    justify-content: center;
  }

  .layout-shell {
    padding-top: 14px;
  }

  .panel {
    padding: 14px;
  }

  .row,
  .preview-grid,
  .batch-gallery {
    grid-template-columns: 1fr;
  }

  .search-row {
    grid-template-columns: 1fr;
  }

  .thumb-grid {
    max-height: 250px;
  }

  .json-graph-wrap {
    height: 430px;
    min-height: 220px;
  }

  .graph-control-row {
    grid-template-columns: 1fr 1fr;
  }

  .graph-control-row label,
  .graph-control-row .hint {
    grid-column: 1 / -1;
  }

  .btn {
    width: 100%;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .top-nav .btn {
    width: auto;
  }

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