:root {
  --bg: #f7f7f5;
  --panel: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --primary: #0f172a;
  --primary-dark: #020617;
  --border: #e5e7eb;
  --danger: #b42318;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Avenir Next", "Helvetica Neue", "SF Pro Text", "PingFang SC", sans-serif;
  background: linear-gradient(180deg, #fbfbfa 0%, var(--bg) 100%);
  color: var(--text);
  -webkit-text-size-adjust: 100%;
}

.container {
  max-width: min(98vw, 1720px);
  margin: 0 auto;
  padding: 14px 12px 22px;
}

.hero,
.tool,
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
}

.hero {
  padding: 16px;
}

.hero p {
  color: var(--muted);
}

.home-hero {
  padding: 28px;
}

.home-subtitle {
  margin: 10px 0 4px;
  font-size: 19px;
  font-weight: 500;
  color: #1f2937;
}

.home-subtitle-cn {
  margin: 0 0 16px;
  font-size: 14px;
}

.home-search-wrap {
  max-width: 860px;
}

.home-topbar {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.home-brand-title h1 {
  font-size: 19px;
}

.home-search-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 14px;
}

.home-cards {
  margin-top: 0;
}

.home-groups {
  display: grid;
  gap: 12px;
}

.tool-group {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
}

.tool-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 2px 4px 10px;
}

.tool-group-title {
  margin: 0;
  font-size: 16px;
  color: #334155;
}

.cards.home-group-cards {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.admin-topbar {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.admin-top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-top-actions .lang-switch-wrap {
  margin: 0;
}

.admin-panel-intro {
  margin-bottom: 14px;
}

.admin-panel-welcome {
  margin: 0 0 8px;
}

.admin-page-intro {
  margin-bottom: 14px;
}

.admin-page-subtitle {
  margin: 0 0 8px;
}

.admin-page-controls {
  margin-bottom: 0;
}

.admin-page-controls label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #374151;
  font-size: 13px;
}

.admin-quick-links {
  margin-bottom: 14px;
}

.admin-quick-links .card {
  text-decoration: none;
}

.admin-quick-links .card h2 {
  margin-bottom: 6px;
}

.search-label {
  display: block;
  font-size: 13px;
  color: #374151;
  margin-bottom: 6px;
}

.search-meta {
  margin: 8px 0 0;
  font-size: 13px;
}

.brand-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-title h1 {
  margin: 0;
  letter-spacing: 0.2px;
}

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

.brand-home-link {
  display: inline-flex;
  line-height: 0;
  border-radius: 12px;
}

.brand-home-link:focus-visible {
  outline: 2px solid #c7d2fe;
  outline-offset: 2px;
}

.brand-home-title-link {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  line-height: 0;
}

.brand-home-title-link:focus-visible {
  outline: 2px solid #c7d2fe;
  outline-offset: 2px;
  border-radius: 6px;
}

.brand-wordmark {
  height: 26px;
  width: auto;
  display: block;
}

.auth-line {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.lang-switch-wrap {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 12px;
}

.home-top-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin: 0;
  flex-wrap: wrap;
}

.home-top-actions .lang-switch-wrap {
  margin: 0 0 0 auto;
}

.site-footer {
  margin-top: 16px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #ffffff;
}

.site-footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.site-footer-links a {
  font-size: 12px;
  color: #4b5563;
  text-decoration: none;
}

.site-footer-links a:hover {
  color: #111827;
  text-decoration: underline;
}

.topbar-tool-nav {
  position: relative;
}

.topbar-tool-nav::after {
  content: "";
  position: absolute;
  left: 0;
  top: 100%;
  width: 100%;
  height: 10px;
}

.topbar-tool-nav-btn {
  border: 1px solid #dbe3ec;
  background: #ffffff;
  color: #0f172a;
  border-radius: 999px;
  min-height: 30px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
}

.topbar-tool-nav-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.topbar-tool-nav-btn:focus-visible {
  outline: 2px solid #c7d2fe;
  outline-offset: 1px;
}

.topbar-tool-nav-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  left: auto;
  width: min(760px, calc(100vw - 24px));
  max-height: min(68vh, 560px);
  overflow: auto;
  padding: 10px;
  border: 1px solid #dbe3ec;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.14);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  z-index: 50;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.topbar-tool-nav:hover .topbar-tool-nav-menu,
.topbar-tool-nav:focus-within .topbar-tool-nav-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.topbar-tool-group {
  border: 1px solid #eef2f7;
  border-radius: 10px;
  padding: 8px;
  background: #fcfdff;
}

.topbar-tool-group-title {
  margin: 0 0 6px;
  font-size: 12px;
  color: #64748b;
  font-weight: 600;
}

.topbar-tool-links {
  display: grid;
  gap: 4px;
}

.topbar-tool-link {
  font-size: 12px;
  color: #0f172a;
  text-decoration: none;
  line-height: 1.3;
  padding: 3px 4px;
  border-radius: 6px;
}

.topbar-tool-link:hover {
  background: #eef2ff;
}

.topbar-mini-link {
  font-size: 12px;
  color: #4b5563;
  text-decoration: none;
  padding: 4px 0;
}

.topbar-mini-link:hover {
  color: #111827;
  text-decoration: underline;
}

.home-feedback-entry {
  min-height: 34px;
  padding: 6px 12px;
  border-radius: 999px;
}

.lang-switch {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: #334155;
  background: #ffffff;
  border: 1px solid #dbe3ec;
  border-radius: 999px;
  padding: 3px 6px 3px 8px;
}

.lang-switch label {
  margin: 0;
  white-space: nowrap;
}

.lang-switch select {
  width: auto;
  min-width: 102px;
  margin: 0;
  min-height: 28px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid #dbe3ec;
  background: #ffffff;
  font-size: 12px;
  color: #0f172a;
}

.lang-switch select:focus {
  outline: 2px solid #c7d2fe;
  outline-offset: 1px;
}

.home-topbar .btn,
.admin-topbar .btn {
  min-height: 34px;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 13px;
}

.cards {
  margin-top: 18px;
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.card {
  padding: 18px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.card:hover {
  transform: translateY(-1px);
  border-color: #d1d5db;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.card h2 {
  margin: 0 0 8px;
  font-size: 20px;
}

.card p {
  margin: 0 0 12px;
  color: var(--muted);
}

.tag {
  display: inline-block;
  border-radius: 999px;
  border: 1px solid var(--border);
  padding: 5px 11px;
  font-size: 12px;
}

.tool-meta-line {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.tag-muted {
  background: #f9fafb;
  color: #4b5563;
}

.page-head {
  margin: 2px 0 12px;
  padding: 0 2px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.page-head a {
  color: var(--primary-dark);
  text-decoration: none;
  font-size: 14px;
}

.page-head h1 {
  margin: 0 0 2px;
  font-size: 20px;
  line-height: 1.3;
  font-weight: 650;
}

.tool-desc-data {
  display: none;
}

.tool-desc-inline {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.tool-desc-help-btn {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: help;
}

.tool-desc-help-btn:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

.tool-desc-help-btn:focus-visible {
  outline: 2px solid #c7d2fe;
  outline-offset: 1px;
}

.tool-desc-tooltip {
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  z-index: 30;
  width: max-content;
  max-width: min(520px, 74vw);
  padding: 9px 11px;
  border: 1px solid #dbe3ec;
  border-radius: 10px;
  background: #ffffff;
  color: #334155;
  font-size: 12px;
  line-height: 1.55;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.1);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-3px);
  pointer-events: none;
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.tool-desc-inline:hover .tool-desc-tooltip,
.tool-desc-inline:focus-within .tool-desc-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.tool {
  padding: 14px;
}

.colorbook-controls {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(180px, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

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

.colorbook-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #ffffff;
  padding: 10px;
}

.colorbook-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.colorbook-card-title {
  margin: 0;
  font-size: 14px;
  font-weight: 650;
  color: #1f2937;
}

.colorbook-copy-btn {
  min-height: 26px;
  padding: 4px 8px;
  font-size: 12px;
}

.colorbook-swatches {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.colorbook-swatch {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  padding: 8px 4px;
  min-height: 56px;
  font-family: "Consolas", "Menlo", monospace;
  font-size: 11px;
  letter-spacing: 0.15px;
}

.colorbook-swatch:hover {
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.12) inset;
}

.legal-doc h2 {
  margin-top: 16px;
  margin-bottom: 8px;
  font-size: 17px;
}

.legal-doc p {
  margin: 0 0 10px;
  line-height: 1.62;
  color: #374151;
}

.tool-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.tool-grid-equal {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.tool-grid > * {
  min-width: 0;
}

.tool-right {
  min-height: 0;
}

.feedback-section h3 {
  margin: 0 0 10px;
  font-size: 18px;
}

.compact-textarea {
  min-height: 130px;
  height: 130px;
}

textarea,
input[type="text"],
input[type="password"],
input[type="number"],
select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  font: inherit;
  margin-top: 6px;
  margin-bottom: 12px;
}

input[type="file"] {
  width: 100%;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  background: linear-gradient(180deg, #fbfdff 0%, #f8fafc 100%);
  color: #334155;
  font: inherit;
  font-size: 13px;
  line-height: 1.3;
  padding: 8px;
  margin-top: 6px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

input[type="file"]:hover {
  border-color: #94a3b8;
  background: #f8fbff;
}

input[type="file"]:focus,
input[type="file"]:focus-visible {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
}

input[type="file"]::file-selector-button {
  border: 1px solid #111827;
  background: #111827;
  color: #ffffff;
  border-radius: 8px;
  padding: 6px 12px;
  margin-right: 10px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.08s ease;
}

input[type="file"]::file-selector-button:hover {
  background: #0b1220;
  border-color: #0b1220;
}

input[type="file"]::file-selector-button:active {
  transform: translateY(1px);
}

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

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

.actions select {
  width: auto;
  min-width: 190px;
  margin: 0;
}

.json-format-options {
  align-items: center;
  margin-top: -2px;
}

.json-format-options > label {
  margin: 0;
  color: #334155;
  font-size: 13px;
}

.json-format-options select {
  min-width: 96px;
}

.json-option-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
}

.json-option-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
}

.btn {
  border: none;
  background: #111827;
  color: #fff;
  padding: 9px 12px;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

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

.btn-secondary {
  background: #374151;
}

.btn-secondary:hover {
  background: #222d3c;
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  background: #eef2f7;
  border-color: #d1d5db;
  color: #0f172a;
}

.msg {
  margin: 8px 0 0;
  color: var(--muted);
  min-height: 20px;
}

.msg-error {
  color: var(--danger);
}

.json-msg {
  margin: 8px 0 0;
  min-height: 0;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #334155;
}

.json-msg:empty {
  display: none;
}

.json-msg.msg-error {
  border-color: #fecaca;
  background: #fff1f2;
}

.hidden {
  display: none !important;
}

.search-empty {
  margin-top: 12px;
  color: #6b7280;
}

.admin-hero {
  margin-bottom: 16px;
}

.stats-cards {
  margin-bottom: 14px;
}

.admin-nav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 14px;
}

.admin-nav a {
  text-decoration: none;
  color: #1f2937;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
}

.admin-nav a.active {
  border-color: #111827;
  background: #eef2ff;
  color: #111827;
}

.kpi-value {
  margin: 0;
  font-size: 30px;
  font-weight: 700;
  color: #111827;
}

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

.stats-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

.stats-table th,
.stats-table td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid #eef2f7;
  font-size: 13px;
}

.stats-table th {
  color: #6b7280;
  font-weight: 600;
  background: #fafafa;
  position: sticky;
  top: 0;
}

.daily-bars {
  display: block;
  color: #6b7280;
  font-size: 13px;
}

.daily-bars.daily-line-chart {
  overflow-x: auto;
  padding: 6px 2px 2px;
}

.daily-line-svg {
  display: block;
  width: 100%;
  min-width: 420px;
}

.daily-line-plot {
  fill: #f8fafc;
  stroke: #e2e8f0;
  stroke-width: 1;
}

.daily-line-grid {
  stroke: #e5e7eb;
  stroke-width: 0.8;
}

.daily-line-y-label,
.daily-line-x-label {
  fill: #64748b;
  font-size: 10px;
}

.daily-line-area {
  fill: rgba(37, 99, 235, 0.12);
}

.daily-line-path {
  fill: none;
  stroke: #2563eb;
  stroke-width: 1.2;
}

.daily-line-dot {
  fill: #ffffff;
  stroke: #2563eb;
  stroke-width: 1.2;
}

.daily-bars.daily-chart {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 2px 2px;
  min-height: 210px;
}

.daily-col {
  flex: 0 0 30px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 6px;
  align-items: end;
}

.daily-col-value {
  text-align: center;
  font-size: 11px;
  color: #4b5563;
  line-height: 1;
}

.daily-col-track {
  height: 150px;
  background: #f1f5f9;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}

.daily-col-bar {
  width: 100%;
  min-height: 4px;
  background: linear-gradient(180deg, #60a5fa, #2563eb);
}

.daily-col-date {
  text-align: center;
  font-size: 11px;
  color: #64748b;
  letter-spacing: 0.1px;
}

.stats-pagination {
  margin-top: 10px;
  align-items: center;
}

.stats-page-info {
  margin: 0;
  color: #4b5563;
  font-size: 13px;
}

.auth-box {
  max-width: 420px;
}

.tab-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.tab-btn {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  min-height: 40px;
}

.tab-btn.active {
  background: #e9f4f3;
  border-color: var(--primary);
  color: var(--primary-dark);
}

.tab-panel {
  display: none;
  min-height: 0;
}

.tab-panel.active {
  display: block;
  min-width: 0;
}

.json-tree {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  background: #fbfdff;
  height: clamp(360px, 68vh, 760px);
  overflow-y: auto;
  overflow-x: hidden;
  margin-bottom: 6px;
  max-width: 100%;
}

#json-input {
  font-family: "Consolas", "Menlo", "Monaco", monospace;
  font-size: 14px;
  line-height: 1.52;
  color: #0f172a;
  caret-color: #0f172a;
}

#json-input::placeholder {
  color: #94a3b8;
}

.code-output {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f8fafc;
  height: clamp(360px, 68vh, 760px);
  overflow-y: auto;
  overflow-x: auto;
  padding: 12px;
  margin: 0;
  font-family: "Consolas", "Menlo", monospace;
  font-size: 13px;
  line-height: 1.45;
  white-space: pre;
  max-width: 100%;
  width: 100%;
}

.code-output.myip-mini {
  height: auto;
  min-height: 72px;
  white-space: pre-wrap;
}

.ws-page {
  overflow-x: hidden;
  overflow-y: auto;
}

.ws-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 10px 10px 10px;
}

.ws-page .page-head {
  margin: 0 0 8px;
}

.ws-workspace {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 10px;
}

.ws-tip {
  margin: 0 0 8px;
  color: #475569;
  font-size: 13px;
}

.ws-layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr);
  gap: 10px;
}

.ws-left-col {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
}

.ws-panel {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #ffffff;
  padding: 10px;
  min-height: 0;
}

.ws-params input[type="text"] {
  margin-bottom: 10px;
}

.ws-actions {
  margin-bottom: 0;
  align-items: center;
}

.ws-state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  line-height: 1;
  font-weight: 600;
  border-radius: 999px;
  border: 1px solid #dbe3ec;
  background: #eef2f7;
  color: #334155;
  vertical-align: middle;
}

.ws-state-disconnected {
  background: #f1f5f9;
  color: #475569;
  border-color: #d0d9e4;
}

.ws-state-connecting {
  background: #fff7ed;
  color: #c2410c;
  border-color: #fdba74;
}

.ws-state-connected {
  background: #ecfdf3;
  color: #027a48;
  border-color: #86efac;
}

.ws-state-closing {
  background: #fef3c7;
  color: #92400e;
  border-color: #fcd34d;
}

.ws-output-panel,
.ws-log-panel {
  display: flex;
  flex-direction: column;
}

.ws-send-input {
  min-height: 108px;
  height: 108px;
  resize: none;
  margin-bottom: 8px;
}

.ws-output {
  flex: 1;
  min-height: 0;
  height: auto;
  overflow: hidden;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.ws-log {
  flex: 1;
  min-height: 0;
  height: auto;
  white-space: normal;
  overflow-x: hidden;
  overflow-y: auto;
  scroll-behavior: smooth;
}

.ws-log-line {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 2px 0;
}

.ws-log-meta {
  color: #64748b;
  font-family: "Consolas", "Menlo", monospace;
  font-size: 12px;
  flex: 0 0 auto;
}

.ws-log-text {
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: pre-wrap;
}

.ws-log-out .ws-log-text {
  color: #1d4ed8;
}

.ws-log-error .ws-log-text {
  color: #b42318;
}

.ws-hints {
  margin-top: 8px;
  border-top: 1px dashed #e2e8f0;
  padding-top: 8px;
}

.ws-hints summary {
  cursor: pointer;
  color: #334155;
  font-size: 12px;
  user-select: none;
}

.ws-hints ul {
  margin: 8px 0 0;
  padding-left: 18px;
  color: #334155;
  line-height: 1.5;
  font-size: 12px;
}

.json-node {
  font-family: "Consolas", "Menlo", monospace;
  font-size: 14px;
  line-height: 1.5;
  overflow-wrap: normal;
  word-break: normal;
}

.json-node-line {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}

.json-node details {
  margin: 3px 0;
}

.json-node summary {
  cursor: pointer;
  user-select: none;
}

.json-node-delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #fecaca;
  background: #fff1f2;
  color: #b42318;
  border-radius: 999px;
  padding: 0 6px;
  font-size: 11px;
  line-height: 18px;
  height: 18px;
  cursor: pointer;
  visibility: hidden;
}

.json-node-line:hover .json-node-delete,
.json-node summary:hover .json-node-delete {
  visibility: visible;
}

.json-node summary .json-node-delete {
  margin-left: 8px;
}

.json-node-delete:hover {
  background: #ffe4e6;
}

.json-children {
  border-left: 1px dashed var(--border);
  margin-left: 10px;
  padding-left: 12px;
}

.json-key {
  color: #005db5;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
  flex: 0 0 auto;
}

.json-meta,
.json-string,
.json-number,
.json-boolean,
.json-null {
  overflow-wrap: anywhere;
  word-break: break-word;
  flex: 1 1 auto;
  min-width: 0;
}

.json-meta {
  color: #5e7083;
}

.json-string {
  color: #0f766e;
}

.json-number {
  color: #8a3ffc;
}

.json-boolean {
  color: #b45309;
}

.json-null {
  color: #6b7280;
}

.dep-state {
  display: inline-block;
  min-width: 44px;
  text-align: center;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
}

.ws-state.dep-state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  line-height: 1.2;
}

.dep-ok {
  background: #ecfdf3;
  color: #027a48;
  border: 1px solid #abefc6;
}

.dep-bad {
  background: #fef3f2;
  color: #b42318;
  border: 1px solid #fecdca;
}

@media (max-width: 1200px) {
  .ws-page {
    overflow: auto;
  }

  .ws-container {
    height: auto;
    min-height: 100vh;
  }

  .ws-layout {
    grid-template-columns: 1fr;
  }

  .ws-left-col {
    grid-template-rows: auto auto;
  }

  .ws-log {
    min-height: 260px;
  }

  .ws-output {
    min-height: 180px;
  }
}

@media (max-width: 1360px) {
  .cards.home-group-cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .colorbook-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1024px) {
  .cards.home-group-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .colorbook-controls {
    grid-template-columns: 1fr;
  }

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

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

  .container {
    padding: 10px 8px 18px;
  }

  textarea {
    min-height: 260px;
  }

  .compact-textarea {
    min-height: 140px;
    height: 140px;
  }

  .json-tree {
    height: 320px;
  }

  .code-output {
    height: 320px;
  }

  .hero,
  .tool,
  .card {
    border-radius: 12px;
  }

  .hero {
    padding: 16px;
  }

  .home-subtitle {
    font-size: 17px;
  }

  .home-topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .admin-topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .home-top-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .topbar-tool-nav-menu {
    width: min(560px, calc(100vw - 16px));
    grid-template-columns: 1fr;
  }

  .admin-top-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .home-brand-title h1 {
    font-size: 18px;
  }

  .brand-wordmark {
    height: 26px;
  }

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

  .stats-table {
    min-width: 520px;
  }

  .daily-col {
    flex-basis: 26px;
  }

  .page-head h1 {
    margin: 0;
    font-size: 18px;
  }

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

  .actions {
    gap: 8px;
  }

  .actions .btn,
  .tab-actions .tab-btn {
    width: 100%;
    text-align: center;
  }

  .actions select {
    width: 100%;
    min-width: 0;
  }

  textarea,
  input[type="text"],
  input[type="password"],
  input[type="number"],
  input[type="file"],
  select {
    font-size: 16px;
  }
}

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

  .json-tree,
  .code-output {
    height: 360px;
    max-height: 60vh;
  }
}
