:root {
  color-scheme: dark;
  --bg: #080c14;
  --bg-elevated: #0c121d;
  --surface: #101824;
  --surface-2: #141e2d;
  --surface-3: #192638;
  --border: #243247;
  --border-strong: #33465f;
  --text: #edf4ff;
  --text-soft: #a9b7ca;
  --text-muted: #718198;
  --cyan: #45d7ff;
  --blue: #5c8dff;
  --violet: #a779ff;
  --green: #54e3a5;
  --yellow: #f4c95d;
  --red: #ff7185;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--bg);
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 12% -10%, rgba(92, 141, 255, 0.12), transparent 34rem),
    radial-gradient(circle at 94% 12%, rgba(167, 121, 255, 0.09), transparent 30rem),
    var(--bg);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { color: inherit; }

::selection {
  color: #07101b;
  background: rgba(69, 215, 255, 0.78);
}

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

.site-header {
  flex: 0 0 auto;
  border-bottom: 1px solid rgba(36, 50, 71, 0.65);
  background: rgba(8, 12, 20, 0.78);
  backdrop-filter: blur(18px);
}

.site-header-inner {
  display: flex;
  width: min(1220px, calc(100% - 48px));
  min-height: 76px;
  margin: 0 auto;
  align-items: center;
}

.site-brand {
  display: inline-grid;
  gap: 4px;
  border-radius: 8px;
}

.site-brand-name {
  color: var(--text);
  font: 750 17px/1.2 var(--mono);
  letter-spacing: -0.03em;
}

.site-brand-name::first-letter { color: var(--cyan); }
.site-slogan { color: var(--text-muted); font-size: 12px; }

#app { flex: 1 0 auto; }

.site-footer {
  display: flex;
  flex: 0 0 auto;
  width: min(1220px, calc(100% - 48px));
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 auto;
  padding: 18px 0 24px;
  border-top: 1px solid rgba(36, 50, 71, 0.65);
  color: var(--text-muted);
  font: 12px/1.6 var(--mono);
  text-align: center;
}

.site-footer a {
  transition: color 170ms ease;
}

.site-footer a:hover {
  color: var(--cyan);
}

.page {
  width: min(1220px, calc(100% - 48px));
  margin: 0 auto;
  padding: 64px 0 72px;
}

.home-hero { max-width: 760px; margin-bottom: 44px; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 18px;
  color: var(--cyan);
  font: 700 12px/1 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.eyebrow::before {
  width: 25px;
  height: 1px;
  background: currentColor;
  content: "";
}

.home-title {
  max-width: 760px;
  margin: 0;
  font-size: clamp(38px, 6vw, 72px);
  font-weight: 720;
  line-height: 1.04;
  letter-spacing: -0.055em;
}

.gradient-text {
  color: transparent;
  background: linear-gradient(110deg, var(--cyan), var(--blue) 48%, var(--violet));
  -webkit-background-clip: text;
  background-clip: text;
}

.home-copy {
  max-width: 650px;
  margin: 22px 0 0;
  color: var(--text-soft);
  font-size: 17px;
}

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

.tool-card {
  position: relative;
  display: block;
  min-height: 170px;
  padding: 22px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, rgba(20, 30, 45, 0.94), rgba(13, 20, 31, 0.94));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
  transition: transform 170ms ease, border-color 170ms ease, background 170ms ease, box-shadow 170ms ease;
}

.tool-card::after {
  position: absolute;
  right: -50px;
  bottom: -70px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--card-glow, rgba(69, 215, 255, 0.1)), transparent 67%);
  content: "";
  pointer-events: none;
}

.tool-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  background: linear-gradient(145deg, rgba(23, 35, 52, 0.98), rgba(14, 22, 34, 0.98));
  box-shadow: var(--shadow);
}

.tool-card:active { transform: translateY(-1px); }
.tool-card > div { position: relative; z-index: 1; }

.tool-card-icon,
.tool-icon {
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--tool-color, var(--cyan)) 45%, transparent);
  color: var(--tool-color, var(--cyan));
  background: color-mix(in srgb, var(--tool-color, var(--cyan)) 10%, transparent);
  font-family: var(--mono);
  font-weight: 800;
}

.tool-card-icon { width: 43px; height: 43px; border-radius: 12px; font-size: 13px; }
.tool-icon { width: 48px; height: 48px; flex: 0 0 auto; border-radius: 14px; font-size: 14px; }

.tool-card h2 { margin: 20px 0 7px; font-size: 19px; letter-spacing: -0.02em; }
.tool-card p { margin: 0; color: var(--text-muted); font-size: 13px; }

.theme-json { --tool-color: #45d7ff; --card-glow: rgba(69, 215, 255, 0.16); }
.theme-md5 { --tool-color: #a779ff; --card-glow: rgba(167, 121, 255, 0.16); }
.theme-timestamp { --tool-color: #54e3a5; --card-glow: rgba(84, 227, 165, 0.14); }
.theme-unicode { --tool-color: #5c8dff; --card-glow: rgba(92, 141, 255, 0.16); }
.theme-string-lines { --tool-color: #64d98b; --card-glow: rgba(100, 217, 139, 0.15); }
.theme-diff { --tool-color: #ff7185; --card-glow: rgba(255, 113, 133, 0.14); }
.theme-regex { --tool-color: #f4c95d; --card-glow: rgba(244, 201, 93, 0.13); }
.theme-qrcode { --tool-color: #72e0c2; --card-glow: rgba(114, 224, 194, 0.14); }
.theme-cron { --tool-color: #ff9d66; --card-glow: rgba(255, 157, 102, 0.15); }
.theme-image-base64 { --tool-color: #e88cff; --card-glow: rgba(232, 140, 255, 0.15); }

.home-footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-top: 36px;
  padding-top: 22px;
  border-top: 1px solid rgba(36, 50, 71, 0.65);
  color: var(--text-muted);
  font: 12px/1.6 var(--mono);
}

.workspace { width: min(1420px, calc(100% - 40px)); padding-top: 34px; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  color: var(--text-muted);
  font-size: 13px;
  transition: color 160ms ease;
}
.back-link:hover { color: var(--cyan); }

.workspace-head {
  display: flex;
  align-items: center;
  gap: 16px;
}

.workspace-title { margin: 0; font-size: clamp(25px, 3vw, 36px); line-height: 1.18; letter-spacing: -0.035em; }
.workspace-description { margin: 7px 0 0; color: var(--text-muted); font-size: 14px; }

#tool-content { margin-top: 28px; }

.panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: rgba(12, 18, 29, 0.91);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025), var(--shadow);
}

.panel-head {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  font-size: 13px;
  font-weight: 650;
}

.panel-title::before { width: 7px; height: 7px; border-radius: 50%; background: var(--tool-color, var(--cyan)); box-shadow: 0 0 12px color-mix(in srgb, var(--tool-color, var(--cyan)) 65%, transparent); content: ""; }
.panel-actions, .toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.panel-body { padding: 18px; }

.editor-grid,
.two-column,
.qr-layout,
.regex-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}

.editor-pane {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
}

.editor-pane-head {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font: 11px/1 var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.editor,
.text-input,
.select-input,
.datetime-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  background: #0a1019;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.editor:focus,
.text-input:focus,
.select-input:focus,
.datetime-input:focus {
  border-color: rgba(69, 215, 255, 0.55);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(69, 215, 255, 0.08);
}

.editor {
  display: block;
  min-height: 390px;
  padding: 15px;
  resize: vertical;
  border: 0;
  border-radius: 0;
  outline: 0;
  font: 13px/1.68 var(--mono);
  tab-size: 2;
}

.editor.short { min-height: 190px; }
.editor.medium { min-height: 285px; }
.editor[readonly] { color: #c7d5e8; background: #0b111b; }
.editor::placeholder, .text-input::placeholder { color: #4e5f76; }

.numbered-editor {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  min-width: 0;
  background: #0b111b;
}
.numbered-editor .editor { min-width: 0; }
.line-number-gutter {
  height: 390px;
  min-height: 0;
  margin: 0;
  padding: 15px 10px 15px 0;
  overflow: hidden;
  border-right: 1px solid var(--border);
  color: #4e5f76;
  background: #0a1019;
  font: 13px/1.68 var(--mono);
  text-align: right;
  user-select: none;
}

.json-viewer {
  min-height: 390px;
  max-height: 68vh;
  overflow: auto;
  padding: 10px 0;
  color: #c7d5e8;
  background: #0b111b;
  font: 13px/1.68 var(--mono);
  tab-size: 2;
}

.json-placeholder { padding: 5px 15px; color: #4e5f76; }
.json-line {
  display: grid;
  width: max-content;
  min-width: 100%;
  grid-template-columns: 48px 24px minmax(0, 1fr);
  align-items: start;
}
.json-line:hover { background: rgba(255, 255, 255, 0.025); }
.json-line-number {
  padding-right: 11px;
  color: #4e5f76;
  text-align: right;
  user-select: none;
}
.json-fold-toggle {
  width: 20px;
  height: 20px;
  margin-top: 1px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  color: var(--cyan);
  background: transparent;
  cursor: pointer;
  font: 18px/18px var(--mono);
}
.json-fold-toggle:hover, .json-fold-toggle:focus-visible { background: rgba(69, 215, 255, 0.1); outline: 0; }
.json-fold-spacer { width: 20px; }
.json-line-code { padding-right: 16px; white-space: pre; font: inherit; }

.text-input,
.select-input,
.datetime-input { min-height: 42px; padding: 9px 11px; }
.select-input { cursor: pointer; }
.color-input { width: 48px; height: 40px; padding: 4px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #0a1019; cursor: pointer; }

.field { display: grid; gap: 7px; }
.field + .field { margin-top: 14px; }
.field-label { color: var(--text-soft); font-size: 12px; font-weight: 650; }
.field-hint { color: var(--text-muted); font-size: 11px; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid .field + .field { margin-top: 0; }

.btn {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-soft);
  background: var(--surface);
  cursor: pointer;
  font-size: 12px;
  font-weight: 650;
  transition: transform 120ms ease, color 150ms ease, border-color 150ms ease, background 150ms ease;
}

.btn:hover { color: var(--text); border-color: var(--border-strong); background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn.primary { color: #06121b; border-color: transparent; background: linear-gradient(135deg, var(--cyan), #7da5ff); }
.btn.primary:hover { color: #020910; filter: brightness(1.06); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.danger:hover { color: var(--red); border-color: rgba(255, 113, 133, 0.33); background: rgba(255, 113, 133, 0.07); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.options-row {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.options-row .field { min-width: 130px; }

.check-label {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  gap: 8px;
  padding: 0 2px;
  color: var(--text-soft);
  cursor: pointer;
  font-size: 12px;
}

.check-label input { width: 16px; height: 16px; accent-color: var(--cyan); }

.status-line {
  display: flex;
  min-height: 38px;
  align-items: center;
  gap: 8px;
  margin-top: 13px;
  padding: 8px 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  background: rgba(10, 16, 25, 0.72);
  font: 12px/1.5 var(--mono);
}

.status-line.success { color: var(--green); border-color: rgba(84, 227, 165, 0.26); background: rgba(84, 227, 165, 0.05); }
.status-line.error { color: var(--red); border-color: rgba(255, 113, 133, 0.28); background: rgba(255, 113, 133, 0.05); }

.result-card {
  padding: 17px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #0a1019;
}

.result-label { margin: 0 0 8px; color: var(--text-muted); font: 10px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; }
.result-value { margin: 0; overflow-wrap: anywhere; color: var(--text); font: 14px/1.65 var(--mono); }
.result-value.large { color: var(--cyan); font-size: clamp(15px, 2vw, 21px); letter-spacing: 0.03em; }
.result-stack { display: grid; gap: 10px; }

.timestamp-results { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.timestamp-results .result-card:last-child { grid-column: 1 / -1; }

.unicode-actions { display: flex; justify-content: center; gap: 8px; margin: 14px 0; }

.diff-editors { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.diff-output { max-height: 560px; margin-top: 16px; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-md); background: #090f18; }
.diff-table { min-width: 760px; font: 12px/1.55 var(--mono); }
.diff-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); border-bottom: 1px solid rgba(36, 50, 71, 0.62); }
.diff-row:last-child { border-bottom: 0; }
.diff-cell { display: grid; min-width: 0; grid-template-columns: 44px minmax(0, 1fr); }
.diff-cell + .diff-cell { border-left: 1px solid var(--border); }
.diff-line-number { padding: 6px 8px; color: #52627a; background: rgba(16, 24, 36, 0.78); text-align: right; user-select: none; }
.diff-line-content { min-height: 31px; padding: 6px 10px; overflow-wrap: anywhere; white-space: pre-wrap; }
.diff-cell.removed { background: rgba(255, 113, 133, 0.075); }
.diff-cell.added { background: rgba(84, 227, 165, 0.075); }
.diff-cell.empty { background: rgba(113, 129, 152, 0.025); }
.diff-word-removed { color: #ffd1d8; background: rgba(255, 91, 117, 0.3); border-radius: 3px; }
.diff-word-added { color: #c8ffe8; background: rgba(53, 202, 138, 0.28); border-radius: 3px; }
.diff-empty-state { padding: 54px 20px; color: var(--text-muted); text-align: center; }

.flag-list { display: flex; flex-wrap: wrap; gap: 7px; }
.flag-toggle { position: relative; }
.flag-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.flag-toggle span { display: grid; width: 36px; height: 36px; place-items: center; border: 1px solid var(--border); border-radius: 8px; color: var(--text-muted); background: var(--bg-elevated); cursor: pointer; font: 700 12px/1 var(--mono); }
.flag-toggle input:checked + span { color: var(--cyan); border-color: rgba(69, 215, 255, 0.45); background: rgba(69, 215, 255, 0.09); }
.flag-toggle input:focus-visible + span { outline: 2px solid var(--cyan); outline-offset: 2px; }

.regex-summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.match-count { color: var(--cyan); font: 700 13px/1 var(--mono); }
.match-list { display: grid; max-height: 330px; gap: 8px; overflow: auto; }
.match-item { display: grid; grid-template-columns: 62px minmax(0, 1fr); gap: 10px; padding: 10px; border: 1px solid var(--border); border-radius: 8px; background: #0a1019; }
.match-index { color: var(--text-muted); font: 11px/1.6 var(--mono); }
.match-value { overflow-wrap: anywhere; color: var(--green); font: 12px/1.6 var(--mono); }
.capture-list { margin-top: 4px; color: var(--text-muted); font: 11px/1.5 var(--mono); }
.replacement-preview { min-height: 120px; margin: 0; padding: 12px; overflow: auto; border: 1px solid var(--border); border-radius: 8px; color: #cad7e8; background: #0a1019; font: 12px/1.6 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }

.qr-layout { grid-template-columns: minmax(280px, 0.9fr) minmax(320px, 1.1fr); }
.qr-preview-wrap { display: grid; min-height: 470px; place-items: center; padding: 28px; border: 1px solid var(--border); border-radius: var(--radius-md); background:
  linear-gradient(45deg, rgba(255,255,255,.018) 25%, transparent 25%),
  linear-gradient(-45deg, rgba(255,255,255,.018) 25%, transparent 25%),
  linear-gradient(45deg, transparent 75%, rgba(255,255,255,.018) 75%),
  linear-gradient(-45deg, transparent 75%, rgba(255,255,255,.018) 75%),
  #0a1019;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-size: 16px 16px;
}
.qr-preview-wrap canvas { display: block; max-width: min(100%, 420px); height: auto; border-radius: 4px; box-shadow: 0 18px 50px rgba(0,0,0,.36); image-rendering: pixelated; }
.qr-placeholder { max-width: 270px; color: var(--text-muted); text-align: center; }
.color-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.color-field { display: flex; align-items: center; gap: 9px; }
.color-value { font: 11px/1 var(--mono); color: var(--text-muted); }

.cron-expression { min-height: 54px; padding-inline: 15px; font: 700 17px/1 var(--mono); letter-spacing: 0.02em; }
.cron-presets { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.cron-field-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-top: 18px; }
.cron-field-grid div { display: grid; gap: 4px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: rgba(10, 16, 25, 0.72); text-align: center; }
.cron-field-grid strong { color: var(--text-soft); font-size: 12px; }
.cron-field-grid span { color: var(--text-muted); font: 11px/1.4 var(--mono); }
.cron-results { display: grid; grid-template-columns: minmax(240px, .7fr) minmax(360px, 1.3fr); gap: 12px; margin-top: 14px; }
.cron-run-list { display: grid; gap: 8px; }
.cron-run-item { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 10px; align-items: center; padding: 9px 10px; border: 1px solid rgba(36, 50, 71, 0.72); border-radius: 8px; background: rgba(8, 12, 20, 0.5); }
.cron-run-index { color: var(--tool-color); font: 700 11px/1 var(--mono); text-align: center; }
.cron-run-local { color: var(--text-soft); font-size: 12px; }
.cron-run-iso { margin-top: 2px; color: var(--text-muted); font: 10px/1.5 var(--mono); overflow-wrap: anywhere; }
.cron-empty { padding: 18px 8px; color: var(--text-muted); text-align: center; }
.cron-note { margin: 12px 0 0; color: var(--text-muted); font-size: 11px; }

.image-base64-layout { display: grid; grid-template-columns: minmax(300px, .8fr) minmax(420px, 1.2fr); gap: 16px; }
.image-dropzone { display: grid; min-height: 148px; place-items: center; align-content: center; gap: 7px; padding: 20px; border: 1px dashed var(--border-strong); border-radius: var(--radius-md); color: var(--text-soft); background: rgba(10, 16, 25, 0.7); cursor: pointer; text-align: center; transition: color 150ms ease, border-color 150ms ease, background 150ms ease; }
.image-dropzone:hover, .image-dropzone.dragging { color: var(--text); border-color: var(--tool-color); background: color-mix(in srgb, var(--tool-color) 7%, var(--bg-elevated)); }
.image-dropzone-icon { display: grid; width: 44px; height: 44px; place-items: center; border: 1px solid color-mix(in srgb, var(--tool-color) 45%, transparent); border-radius: 12px; color: var(--tool-color); background: color-mix(in srgb, var(--tool-color) 10%, transparent); font: 800 11px/1 var(--mono); }
.image-dropzone strong { font-size: 14px; }
.image-dropzone > span:last-child { color: var(--text-muted); font-size: 11px; }
.image-preview { display: grid; min-height: 300px; margin-top: 12px; place-items: center; padding: 16px; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-md); color: var(--text-muted); background:
  linear-gradient(45deg, rgba(255,255,255,.025) 25%, transparent 25%),
  linear-gradient(-45deg, rgba(255,255,255,.025) 25%, transparent 25%),
  linear-gradient(45deg, transparent 75%, rgba(255,255,255,.025) 75%),
  linear-gradient(-45deg, transparent 75%, rgba(255,255,255,.025) 75%), #0a1019;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  background-size: 20px 20px;
}
.image-preview img { display: block; max-width: 100%; max-height: 360px; object-fit: contain; }
.image-stats { min-height: 20px; margin-top: 8px; color: var(--text-muted); font: 10px/1.5 var(--mono); text-align: center; overflow-wrap: anywhere; }

.page.legal-page { width: min(880px, calc(100% - 48px)); }
.legal-card { overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-lg); background: rgba(12, 18, 29, 0.91); box-shadow: var(--shadow); }
.legal-header { padding: 34px 38px 30px; border-bottom: 1px solid var(--border); }
.legal-header h1 { margin: 0; font-size: clamp(30px, 5vw, 44px); line-height: 1.15; letter-spacing: -0.045em; }
.legal-header p { margin: 14px 0 0; color: var(--text-soft); font-size: 15px; }
.legal-header span { display: block; margin-top: 12px; color: var(--text-muted); font: 11px/1.5 var(--mono); }
.legal-content { padding: 10px 38px 34px; }
.legal-section { padding-top: 25px; }
.legal-section + .legal-section { margin-top: 25px; border-top: 1px solid rgba(36, 50, 71, 0.65); }
.legal-section h2 { margin: 0 0 11px; font-size: 17px; letter-spacing: -0.02em; }
.legal-section p, .legal-section li { color: var(--text-soft); font-size: 14px; line-height: 1.85; }
.legal-section p { margin: 8px 0 0; }
.legal-section ul { margin: 10px 0 0; padding-left: 22px; }
.legal-section li + li { margin-top: 5px; }

.toast {
  position: fixed;
  z-index: 100;
  right: 22px;
  bottom: 22px;
  max-width: min(390px, calc(100% - 32px));
  padding: 11px 14px;
  transform: translateY(20px);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  opacity: 0;
  color: var(--text);
  background: rgba(16, 24, 36, 0.96);
  box-shadow: var(--shadow);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
  font-size: 13px;
}
.toast.visible { transform: translateY(0); opacity: 1; }
.toast.error { color: #ffd0d7; border-color: rgba(255, 113, 133, 0.35); }

.noscript { margin: 40px auto; padding: 18px; max-width: 680px; border: 1px solid var(--red); border-radius: 12px; color: var(--red); background: var(--surface); text-align: center; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }
.copy-helper { position: fixed; left: -9999px; top: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.mt-12 { margin-top: 12px; }
.mt-14 { margin-top: 14px; }
.mt-16 { margin-top: 16px; }
.mt-18 { margin-top: 18px; }
.mb-0 { margin-bottom: 0; }
.label-flush { margin: 0; }

@media (max-width: 960px) {
  .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .editor-grid, .two-column, .regex-layout, .qr-layout, .image-base64-layout { grid-template-columns: 1fr; }
  .qr-preview-wrap { min-height: 380px; }
}

@media (max-width: 700px) {
  .site-header-inner { width: min(100% - 24px, 1220px); min-height: 68px; }
  .site-brand-name { font-size: 16px; }
  .site-slogan { font-size: 11px; }
  .site-footer { width: min(100% - 24px, 1220px); flex-wrap: wrap; }
  .page, .workspace { width: min(100% - 24px, 1220px); padding-top: 38px; padding-bottom: 50px; }
  .home-hero { margin-bottom: 30px; }
  .home-title { font-size: clamp(36px, 13vw, 54px); }
  .home-copy { font-size: 15px; }
  .tool-grid { grid-template-columns: 1fr; gap: 12px; }
  .tool-card { min-height: 150px; padding: 18px; }
  .home-footer { flex-direction: column; gap: 8px; }
  .workspace-head { align-items: flex-start; }
  .workspace-description { font-size: 13px; }
  #tool-content { margin-top: 20px; }
  .panel-head { align-items: flex-start; flex-direction: column; }
  .panel-actions { width: 100%; }
  .panel-actions .btn { flex: 1 1 auto; }
  .panel-body { padding: 12px; }
  .form-grid, .form-grid.three, .timestamp-results, .diff-editors, .color-fields, .cron-results { grid-template-columns: 1fr; }
  .cron-field-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cron-expression { font-size: 15px; }
  .timestamp-results .result-card:last-child { grid-column: auto; }
  .editor { min-height: 290px; font-size: 12px; }
  .line-number-gutter { height: 290px; font-size: 12px; }
  .json-viewer { min-height: 290px; font-size: 12px; }
  .editor.short { min-height: 160px; }
  .editor.medium { min-height: 230px; }
  .diff-output { max-height: 530px; }
  .diff-table { min-width: 0; }
  .diff-row { display: block; }
  .diff-cell + .diff-cell { border-top: 1px solid var(--border); border-left: 0; }
  .qr-preview-wrap { min-height: 320px; padding: 18px; }
  .image-preview { min-height: 240px; }
  .page.legal-page { width: min(100% - 24px, 880px); }
  .legal-header { padding: 26px 22px 23px; }
  .legal-content { padding: 6px 22px 28px; }
  .legal-section p, .legal-section li { font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}
