:root {
  --bg: #070c0e;
  --bg-grid: rgba(86, 239, 197, 0.075);
  --surface: #0c1518;
  --surface-2: #101d20;
  --surface-3: #14262a;
  --line: #254047;
  --line-strong: #3a5d64;
  --text: #e9f7f4;
  --muted: #88a29d;
  --muted-2: #5f7b78;
  --accent: #56efc5;
  --accent-soft: rgba(86, 239, 197, 0.11);
  --lime: #c2f762;
  --red: #ff6f6f;
  --red-soft: rgba(255, 111, 111, 0.13);
  --blue: #73b8ff;
  --purple: #c89cff;
  --yellow: #f7da74;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.34);
  color: var(--text);
  background: var(--bg);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(var(--bg-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--bg-grid) 1px, transparent 1px),
    radial-gradient(circle at 75% 8%, rgba(86, 239, 197, 0.09), transparent 30%),
    var(--bg);
  background-attachment: fixed;
  background-size: 42px 42px, 42px 42px, auto, auto;
}

button,
select,
textarea,
input {
  font: inherit;
}

button,
select,
textarea,
input {
  color: inherit;
}

button {
  cursor: pointer;
}

a,
button,
select,
textarea,
input {
  -webkit-tap-highlight-color: transparent;
}

a:focus-visible,
button:focus-visible,
select:focus-visible,
textarea:focus-visible,
input:focus-visible,
pre:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

::selection {
  color: var(--bg);
  background: var(--accent);
}

.page-shell {
  width: min(1480px, calc(100% - 64px));
  margin: 0 auto;
}

.site-header {
  position: relative;
  z-index: 20;
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  border-bottom: 1px solid var(--line-strong);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-decoration: none;
}

.brand b {
  color: var(--accent);
}

.brand-mark {
  width: 13px;
  height: 13px;
  overflow: hidden;
  color: transparent;
  background: var(--accent);
  box-shadow: 0 0 18px rgba(86, 239, 197, 0.72);
  animation: terminal-cursor 1.4s steps(1) infinite;
}

@keyframes terminal-cursor {
  50% { opacity: 0.34; }
}

.header-right,
.site-nav,
.privacy-note {
  display: flex;
  align-items: center;
}

.header-right {
  gap: 26px;
}

.site-nav {
  gap: 3px;
}

.site-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 11px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
}

.site-nav a::before {
  margin-right: 7px;
  color: var(--accent);
  content: "./";
  opacity: 0;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--text);
  background: var(--surface-2);
}

.site-nav a:hover::before,
.site-nav a[aria-current="page"]::before {
  opacity: 1;
}

.privacy-note {
  gap: 9px;
  padding: 8px 10px;
  color: var(--accent);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 10px;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.privacy-dot,
.live-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(86, 239, 197, 0.75);
}

.app-view {
  animation: route-in 210ms ease both;
}

@keyframes route-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Shared hero */
.hero {
  display: grid;
  grid-template-columns: 185px minmax(0, 1fr);
  gap: 38px;
  padding: 62px 0 48px;
}

.eyebrow {
  padding-top: 10px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  white-space: nowrap;
}

.eyebrow span {
  margin-right: 7px;
  color: var(--lime);
}

.hero-copy {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 54px;
}

h1 {
  max-width: 860px;
  margin: 0;
  font-size: clamp(48px, 6vw, 88px);
  font-weight: 600;
  line-height: 0.96;
  letter-spacing: -0.07em;
}

h1 em {
  color: var(--accent);
  font-style: normal;
  font-weight: inherit;
  text-shadow: 0 0 28px rgba(86, 239, 197, 0.15);
}

.hero-copy p {
  width: min(360px, 100%);
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}

/* Home */
.portal-hero {
  min-height: 570px;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(250px, 0.65fr);
  gap: 42px;
  align-items: stretch;
  padding: 64px 0 52px;
  border-bottom: 1px solid var(--line-strong);
}

.portal-hero-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.portal-hero h1 {
  max-width: 980px;
  margin: 24px 0 18px;
  font-size: clamp(45px, 5.6vw, 82px);
}

.portal-hero-main > p {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.75;
}

.portal-command {
  width: min(680px, 100%);
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 38px;
  padding: 0 16px;
  color: var(--muted);
  background: rgba(12, 21, 24, 0.9);
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 12px;
}

.portal-command b {
  margin-right: 6px;
  color: var(--accent);
}

.portal-command kbd,
.button-primary kbd {
  padding: 4px 7px;
  color: var(--text);
  background: var(--surface-3);
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  font-family: inherit;
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.now-widget {
  align-self: center;
  display: flex;
  flex-direction: column;
  min-height: 270px;
  padding: 24px;
  background: rgba(12, 21, 24, 0.92);
  border: 1px solid var(--line);
  border-radius: 9px;
  box-shadow: var(--shadow);
}

.now-widget-label {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.now-widget strong {
  margin: auto 0 8px;
  color: var(--lime);
  font-size: clamp(34px, 4vw, 58px);
  font-weight: 600;
  letter-spacing: -0.08em;
}

.now-widget > span:not(.now-widget-label) {
  color: var(--muted);
  font-size: 11px;
}

.now-widget a {
  display: flex;
  justify-content: space-between;
  margin-top: 24px;
  padding-top: 16px;
  color: var(--accent);
  border-top: 1px solid var(--line);
  font-size: 11px;
  text-decoration: none;
}

.tool-directory {
  padding: 54px 0 20px;
}

.directory-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line-strong);
}

.directory-header span,
.directory-header p {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.1em;
}

.directory-header h2 {
  margin: 7px 0 0;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.04em;
}

.directory-header p {
  margin: 0;
}

.directory-header p b {
  color: var(--lime);
}

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

.tool-card {
  min-width: 0;
  min-height: 150px;
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) 150px;
  align-items: center;
  gap: 28px;
  padding: 24px 12px;
  color: var(--text);
  background: rgba(7, 12, 14, 0.48);
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  transition: padding 170ms ease, background 170ms ease, border-color 170ms ease;
}

.tool-card:hover {
  padding-right: 20px;
  padding-left: 20px;
  background: var(--accent-soft);
  border-bottom-color: var(--accent);
}

.tool-card-top {
  display: flex;
  align-items: center;
  gap: 14px;
}

.tool-card-icon {
  min-width: 54px;
  min-height: 54px;
  display: grid;
  place-items: center;
  color: var(--accent);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 17px;
  font-weight: 700;
}

.tool-card-clock {
  position: relative;
  border-radius: 50%;
}

.tool-card-clock::before,
.tool-card-clock::after {
  position: absolute;
  left: 50%;
  bottom: 50%;
  width: 1px;
  background: var(--accent);
  content: "";
  transform-origin: bottom;
}

.tool-card-clock::before {
  height: 15px;
  transform: rotate(20deg);
}

.tool-card-clock::after {
  height: 10px;
  transform: rotate(120deg);
}

.tool-card-tag,
.tool-card-number {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.1em;
}

.tool-card-number {
  display: block;
  margin-bottom: 8px;
  color: var(--accent);
}

.tool-card h3 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.04em;
}

.tool-card p {
  max-width: 620px;
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.tool-card-link {
  justify-self: end;
  color: var(--lime);
  font-size: 11px;
}

.tool-card-link b {
  margin-left: 7px;
}

.tool-card-soon {
  opacity: 0.62;
}

.tool-card-soon:hover {
  padding-right: 12px;
  padding-left: 12px;
  background: transparent;
  border-bottom-color: var(--line);
}

.portal-manifesto,
.feature-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 62px 0 72px;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
}

.portal-manifesto > div,
.feature-strip > div {
  position: relative;
  min-height: 120px;
  padding: 26px 26px 22px 54px;
}

.portal-manifesto > div + div,
.feature-strip > div + div {
  border-left: 1px solid var(--line);
}

.portal-manifesto span,
.feature-strip span {
  position: absolute;
  top: 28px;
  left: 18px;
  color: var(--accent);
  font-size: 9px;
}

.portal-manifesto strong,
.feature-strip strong {
  display: block;
  margin-bottom: 9px;
  color: var(--text);
  font-size: 13px;
  letter-spacing: 0.05em;
}

.portal-manifesto p,
.feature-strip p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

/* JSON workbench */
.workbench {
  overflow: hidden;
  background: rgba(12, 21, 24, 0.96);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.toolbar {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 15px;
  background: var(--surface);
  border-bottom: 1px solid var(--line-strong);
}

.toolbar-left,
.toolbar-right {
  display: flex;
  align-items: center;
  gap: 9px;
}

.button {
  min-height: 41px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  font-size: 11px;
  font-weight: 700;
  transition: color 150ms ease, background 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button svg,
.copy-button svg,
.drop-overlay svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.button-primary {
  min-width: 140px;
  color: var(--bg);
  background: var(--accent);
  border-color: var(--accent);
}

.button-primary:hover:not(:disabled) {
  background: var(--lime);
  border-color: var(--lime);
  box-shadow: 0 0 22px rgba(86, 239, 197, 0.18);
}

.button-primary svg {
  fill: currentColor;
  stroke: none;
}

.button-primary kbd {
  color: var(--bg);
  background: rgba(7, 12, 14, 0.12);
  border-color: rgba(7, 12, 14, 0.3);
}

.button-ghost {
  color: var(--text);
  background: transparent;
}

.button-ghost:hover:not(:disabled) {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.file-label {
  max-width: 220px;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.indent-control {
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 12px;
  color: var(--muted);
  border-left: 1px solid var(--line);
  font-size: 10px;
}

.wrap-control {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 9px;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}

.wrap-control input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.wrap-switch {
  position: relative;
  width: 29px;
  height: 16px;
  flex: 0 0 29px;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  transition: background 150ms ease, border-color 150ms ease;
}

.wrap-switch::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 8px;
  height: 8px;
  background: var(--muted);
  border-radius: 50%;
  content: "";
  transition: background 150ms ease, transform 150ms ease;
}

.wrap-control input:checked + .wrap-switch {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.wrap-control input:checked + .wrap-switch::after {
  background: var(--accent);
  transform: translateX(13px);
}

.wrap-control input:focus-visible + .wrap-switch {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.indent-control select,
.time-field select,
.time-field input {
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 4px;
}

.indent-control select {
  padding: 6px 8px;
  font-size: 10px;
}

.icon-button {
  min-height: 30px;
  padding: 0 9px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-bottom: 1px solid transparent;
  font-size: 10px;
}

.icon-button:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.editor-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 560px;
}

.editor-panel {
  min-width: 0;
  display: grid;
  grid-template-rows: 54px minmax(440px, 1fr) 36px;
}

.input-panel {
  border-right: 1px solid var(--line-strong);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.panel-header > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel-header h2 {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.panel-index {
  min-width: 23px;
  min-height: 23px;
  display: grid;
  place-items: center;
  color: var(--accent);
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  font-size: 9px;
  font-weight: 700;
}

.output-panel .panel-index {
  color: var(--bg);
  background: var(--accent);
  border-color: var(--accent);
}

.panel-meta {
  color: var(--muted);
  font-size: 10px;
}

.input-wrap,
.output-wrap {
  position: relative;
  min-height: 440px;
  overflow: hidden;
}

.input-wrap {
  background: rgba(7, 12, 14, 0.66);
}

.output-wrap {
  background: rgba(9, 17, 19, 0.92);
}

#jsonInput,
#jsonOutput {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 22px 24px;
  color: var(--text);
  background: transparent;
  border: 0;
  border-radius: 0;
  font: 12px/21px "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  tab-size: 4;
}

#jsonInput {
  position: relative;
  z-index: 2;
  display: block;
  padding-left: 66px;
  overflow: auto;
  overflow-wrap: normal;
  resize: none;
  white-space: pre;
}

.workbench.is-wrap-enabled #jsonInput {
  overflow-x: hidden;
  overflow-wrap: break-word;
  white-space: pre-wrap;
}

#jsonInput::placeholder {
  color: transparent;
}

#jsonInput:focus {
  outline-offset: -3px;
}

.line-numbers {
  position: absolute;
  z-index: 3;
  top: 0;
  bottom: 0;
  left: 0;
  width: 48px;
  padding: 22px 10px 22px 0;
  overflow: hidden;
  color: var(--muted-2);
  background: rgba(16, 29, 32, 0.72);
  border-right: 1px solid var(--line);
  pointer-events: none;
  user-select: none;
}

.line-numbers pre {
  margin: 0;
  font-family: inherit;
  font-size: 10px;
  line-height: 21px;
  text-align: right;
  will-change: transform;
}

.line-numbers span {
  display: block;
  height: 21px;
}

.line-numbers span.is-error {
  color: var(--red);
  font-weight: 800;
  text-shadow: 0 0 10px rgba(255, 111, 111, 0.48);
}

.error-line-highlight,
.error-token-underline {
  position: absolute;
  z-index: 1;
  display: none;
  pointer-events: none;
}

.error-line-highlight {
  right: 0;
  height: 21px;
  background: var(--red-soft);
  border-top: 1px solid rgba(255, 111, 111, 0.35);
  border-bottom: 1px solid rgba(255, 111, 111, 0.55);
}

.error-token-underline {
  z-index: 4;
  min-width: 9px;
  height: 4px;
  background: repeating-linear-gradient(135deg, var(--red) 0 2px, transparent 2px 4px);
  filter: drop-shadow(0 0 3px rgba(255, 111, 111, 0.65));
}

.error-line-highlight.is-visible,
.error-token-underline.is-visible {
  display: block;
}

.input-panel.has-error {
  box-shadow: inset 0 0 0 2px var(--red);
}

.input-panel.has-error .panel-header {
  background: var(--red-soft);
  border-bottom-color: var(--red);
}

.input-panel.has-error .panel-index {
  color: var(--bg);
  background: var(--red);
  border-color: var(--red);
}

.empty-hint,
.output-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  pointer-events: none;
  transition: opacity 150ms ease;
}

.input-wrap .empty-hint {
  left: 48px;
}

.empty-hint.is-hidden,
.output-placeholder.is-hidden {
  opacity: 0;
}

.empty-symbol {
  margin-bottom: 5px;
  color: var(--line-strong);
  font-size: 38px;
}

.empty-hint strong {
  color: var(--text);
  font-size: 12px;
}

.error-diagnostic {
  position: absolute;
  z-index: 6;
  right: 13px;
  bottom: 13px;
  left: 61px;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 11px;
  align-items: start;
  padding: 13px 15px 13px 12px;
  color: #ffd6d6;
  background: #291719;
  border: 1px solid var(--red);
  border-left-width: 4px;
  border-radius: 5px;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.45), 0 0 24px rgba(255, 111, 111, 0.11);
}

.error-diagnostic:not([hidden]) {
  display: grid;
}

.error-diagnostic-icon {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  color: var(--bg);
  background: var(--red);
  border-radius: 4px;
  font-size: 13px;
  font-weight: 800;
}

.error-diagnostic strong {
  display: block;
  margin: 1px 0 6px;
  color: var(--red);
  font-size: 12px;
}

.error-diagnostic p {
  margin: 0;
  color: #f0b9b9;
  font-size: 11px;
  line-height: 1.55;
}

#jsonOutput {
  position: relative;
  z-index: 1;
  padding: 0;
  overflow: auto;
  white-space: pre;
}

#jsonOutput code {
  display: block;
  width: max-content;
  min-width: 100%;
  padding: 22px 0;
}

#jsonOutput code:empty {
  display: none;
}

.output-line {
  min-width: max-content;
  min-height: 21px;
  display: flex;
  width: 100%;
  line-height: 21px;
}

.output-line:hover {
  background: rgba(86, 239, 197, 0.045);
}

.output-gutter {
  position: sticky;
  z-index: 2;
  left: 0;
  width: 60px;
  height: 21px;
  flex: 0 0 60px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
  padding: 0 8px 0 5px;
  color: var(--muted-2);
  background: #0f1b1e;
  border-right: 1px solid var(--line);
  user-select: none;
}

.output-line:hover .output-gutter {
  color: var(--muted);
  background: #132326;
}

.output-line-number {
  width: 24px;
  font-size: 9px;
  text-align: right;
}

.fold-toggle,
.fold-spacer {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}

.fold-toggle {
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--accent);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 3px;
}

.fold-toggle:hover {
  color: var(--bg);
  background: var(--accent);
  border-color: var(--accent);
}

.fold-toggle span {
  width: 0;
  height: 0;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 6px solid currentColor;
  transform-origin: 2px 4px;
  transition: transform 140ms ease;
}

.fold-toggle[aria-expanded="true"] span {
  transform: rotate(90deg);
}

.output-content {
  min-height: 21px;
  padding-right: 24px;
}

.workbench.is-wrap-enabled #jsonOutput code {
  width: 100%;
  min-width: 0;
}

.workbench.is-wrap-enabled .output-line {
  min-width: 0;
}

.workbench.is-wrap-enabled .output-content {
  min-width: 0;
  flex: 1 1 auto;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  word-break: break-word;
}

.fold-placeholder {
  display: inline-block;
  margin-left: 8px;
  padding: 0 7px;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  font-size: 9px;
  line-height: 16px;
  vertical-align: 1px;
  white-space: nowrap;
}

.output-line.is-collapsed {
  background: rgba(194, 247, 98, 0.045);
}

.output-placeholder svg {
  width: 44px;
  height: 44px;
  fill: none;
  stroke: var(--line-strong);
  stroke-width: 3;
  stroke-linecap: round;
}

.json-key { color: var(--blue); }
.json-string { color: var(--accent); }
.json-number { color: var(--yellow); }
.json-boolean { color: var(--purple); font-weight: 700; }
.json-null { color: var(--muted); font-style: italic; }

.output-actions {
  display: flex;
  align-items: center;
  gap: 3px !important;
}

.output-actions button {
  min-height: 29px;
  padding: 0 8px;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
}

.output-actions button:not(:disabled):hover {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: var(--line);
}

.output-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.32;
}

.copy-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.copy-button svg {
  width: 13px;
  height: 13px;
}

.panel-footer {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 16px;
  overflow: hidden;
  color: var(--muted-2);
  background: var(--surface);
  border-top: 1px solid var(--line);
  font-size: 9px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.status {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  overflow: hidden;
  text-transform: none;
}

.status > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-icon {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 3px;
  font-size: 8px;
  font-weight: 800;
}

.status.success { color: var(--accent); }
.status.error { color: var(--red); }

.drop-overlay {
  position: absolute;
  z-index: 10;
  inset: 12px;
  display: none;
  place-items: center;
  color: var(--accent);
  background: rgba(7, 12, 14, 0.96);
  border: 2px dashed var(--accent);
  border-radius: 7px;
}

.drop-overlay.is-visible {
  display: grid;
}

.drop-overlay > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.drop-overlay svg {
  width: 38px;
  height: 38px;
}

.drop-overlay strong {
  color: var(--text);
  font-size: 18px;
}

.drop-overlay span {
  color: var(--muted);
  font-size: 10px;
}

/* SQL formatter */
.sql-workbench {
  position: relative;
  overflow: hidden;
  background: rgba(12, 21, 24, 0.96);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.sql-toolbar {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 15px;
  background: var(--surface);
  border-bottom: 1px solid var(--line-strong);
}

.sql-options {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sql-options label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 9px;
  white-space: nowrap;
}

.sql-options select {
  height: 31px;
  padding: 0 8px;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 10px;
}

.sql-editor-grid {
  height: 610px;
  min-height: 610px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.sql-panel {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: 54px minmax(0, 1fr) 36px;
}

.sql-input-panel {
  border-right: 1px solid var(--line-strong);
}

#sqlInput {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: block;
  padding: 23px 24px;
  color: var(--text);
  background: rgba(7, 12, 14, 0.72);
  border: 0;
  border-radius: 0;
  font: 12px/21px "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  overflow: auto;
  overflow-wrap: normal;
  resize: none;
  tab-size: 4;
  white-space: pre;
}

.sql-workbench.is-wrap-enabled #sqlInput {
  overflow-x: hidden;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  word-break: break-word;
}

#sqlInput::placeholder {
  color: var(--muted-2);
}

#sqlInput:focus {
  outline-offset: -3px;
}

.sql-output-wrap {
  position: relative;
  min-height: 0;
  overflow: hidden;
  background: #091113;
}

#sqlOutput {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 23px 24px;
  overflow: auto;
  color: var(--text);
  background: transparent;
  border: 0;
  font: 12px/21px "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  tab-size: 4;
  white-space: pre;
}

.sql-workbench.is-wrap-enabled #sqlOutput {
  overflow-x: hidden;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  word-break: break-word;
}

.sql-output-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  pointer-events: none;
  transition: opacity 150ms ease;
}

.sql-output-placeholder.is-hidden {
  opacity: 0;
}

.sql-output-placeholder > span {
  display: grid;
  place-items: center;
  width: 58px;
  height: 42px;
  margin-bottom: 4px;
  color: var(--line-strong);
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  font-size: 14px;
  font-weight: 700;
}

.sql-output-placeholder strong {
  color: var(--text);
  font-size: 12px;
}

.sql-output-placeholder small {
  color: var(--muted-2);
  font-size: 9px;
}

.sql-output-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.sql-output-actions button {
  min-height: 29px;
  padding: 0 8px;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 700;
}

.sql-output-actions button:not(:disabled):hover {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: var(--line);
}

.sql-output-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.32;
}

.sql-status {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-transform: none;
}

.sql-status i {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 3px;
  font-size: 8px;
  font-style: normal;
  font-weight: 800;
}

.sql-status.success { color: var(--accent); }
.sql-status.error { color: var(--red); }
.sql-status.idle { color: var(--muted); }

.sql-token-keyword { color: var(--blue); font-weight: 700; }
.sql-token-string { color: var(--accent); }
.sql-token-identifier { color: #b9d7ff; }
.sql-token-number { color: var(--yellow); }
.sql-token-parameter,
.sql-token-template,
.sql-token-template-marker { color: var(--purple); }
.sql-token-comment { color: var(--muted-2); font-style: italic; }
.sql-token-operator { color: var(--lime); }
.sql-token-punctuation,
.sql-token-symbol { color: #b3c8c4; }

.sql-drop-overlay {
  inset: 10px;
}

/* PlantUML canvas */
.plantuml-workbench {
  overflow: hidden;
  background: rgba(12, 21, 24, 0.96);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.plantuml-main-toolbar {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 15px;
  background: var(--surface);
  border-bottom: 1px solid var(--line-strong);
}

.plantuml-sync-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-size: 9px;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.plantuml-sync-state span {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(86, 239, 197, 0.72);
}

.plantuml-sync-state.is-working span {
  animation: terminal-cursor 700ms steps(1) infinite;
}

.plantuml-sync-state.is-warning {
  color: var(--yellow);
}

.plantuml-sync-state.is-warning span {
  background: var(--yellow);
  box-shadow: 0 0 10px rgba(255, 209, 102, 0.55);
}

.plantuml-editor-grid {
  height: 650px;
  min-height: 650px;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
}

.plantuml-panel {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: 54px minmax(0, 1fr) 36px;
}

.plantuml-source-panel {
  border-right: 1px solid var(--line-strong);
}

#plantumlInput {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: block;
  padding: 23px 24px;
  overflow: auto;
  color: var(--text);
  background: rgba(7, 12, 14, 0.72);
  border: 0;
  border-radius: 0;
  font: 12px/21px "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  resize: none;
  tab-size: 4;
  white-space: pre;
}

#plantumlInput::placeholder {
  color: var(--muted-2);
}

#plantumlInput:focus {
  outline-offset: -3px;
}

.plantuml-output-actions {
  display: flex;
  align-items: center;
  gap: 4px !important;
}

.plantuml-output-actions button,
.plantuml-source-actions button {
  min-height: 29px;
  padding: 0 9px;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 700;
}

.plantuml-output-actions button:hover,
.plantuml-source-actions button:hover {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: var(--line);
}

.plantuml-board {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
}

.plantuml-palette {
  position: relative;
  z-index: 4;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 12px 9px;
  overflow: auto;
  background: #0d181b;
  border-right: 1px solid var(--line-strong);
}

.plantuml-palette header {
  display: grid;
  gap: 4px;
  padding: 1px 3px 9px;
  border-bottom: 1px solid var(--line);
}

.plantuml-palette header strong {
  color: var(--text);
  font-size: 10px;
  letter-spacing: 0.06em;
}

.plantuml-palette header small {
  color: var(--muted-2);
  font-size: 7px;
  line-height: 1.45;
}

.plantuml-palette button {
  min-height: 48px;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  grid-template-rows: 17px 14px;
  align-items: center;
  column-gap: 7px;
  padding: 6px;
  color: var(--text);
  background: rgba(16, 29, 32, 0.86);
  border: 1px solid var(--line);
  border-radius: 4px;
  text-align: left;
  cursor: grab;
  transition: color 130ms ease, background 130ms ease, border-color 130ms ease, transform 130ms ease;
}

.plantuml-palette button:hover,
.plantuml-palette button:focus-visible {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: var(--accent);
  transform: translateX(2px);
}

.plantuml-palette button:active {
  cursor: grabbing;
}

.plantuml-palette button > span {
  grid-row: 1 / 3;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  color: var(--accent);
  background: #091113;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  font-size: 8px;
  font-weight: 700;
}

.plantuml-palette button > b {
  align-self: end;
  overflow: hidden;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plantuml-palette button > small {
  align-self: start;
  overflow: hidden;
  color: var(--muted-2);
  font-size: 7px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plantuml-canvas-wrap {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  background-color: #091113;
  background-image: radial-gradient(circle, rgba(58, 93, 100, 0.42) 0.7px, transparent 0.8px);
  background-size: 18px 18px;
  overscroll-behavior: contain;
  transition: box-shadow 140ms ease;
}

.plantuml-canvas-wrap.is-drop-ready {
  box-shadow: inset 0 0 0 2px var(--accent), inset 0 0 48px rgba(86, 239, 197, 0.08);
}

#plantumlCanvas {
  position: relative;
  z-index: 1;
  display: block;
  min-width: 100%;
  min-height: 100%;
  overflow: visible;
  touch-action: none;
  user-select: none;
}

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

.plantuml-link {
  fill: none;
  stroke: #6f918d;
  stroke-width: 1.6;
  vector-effect: non-scaling-stroke;
}

.plantuml-link-hit {
  fill: none;
  stroke: transparent;
  stroke-width: 16;
  cursor: pointer;
  pointer-events: stroke;
}

.plantuml-link-group {
  outline: none;
}

.plantuml-link-group:hover .plantuml-link,
.plantuml-link-group:focus .plantuml-link,
.plantuml-link-group.is-selected .plantuml-link {
  stroke: var(--accent);
  stroke-width: 2.4;
}

.plantuml-link-group.is-selected .plantuml-link-label-bg {
  stroke: var(--accent);
}

.plantuml-link.is-dashed {
  stroke-dasharray: 6 5;
}

.plantuml-link-label-bg {
  fill: #0c1518;
  stroke: #254047;
  stroke-width: 1;
}

.plantuml-link-label {
  fill: #a7bbb7;
  font: 10px "SFMono-Regular", Consolas, monospace;
  text-anchor: middle;
}

.plantuml-node {
  cursor: grab;
  outline: none;
}

.plantuml-node:active {
  cursor: grabbing;
}

.plantuml-node-shape {
  fill: #101d20;
  stroke: #3a5d64;
  stroke-width: 1.5;
  transition: fill 120ms ease, stroke 120ms ease;
  vector-effect: non-scaling-stroke;
}

.plantuml-node:hover .plantuml-node-shape,
.plantuml-node:focus .plantuml-node-shape {
  fill: #132629;
  stroke: #56efc5;
}

.plantuml-node.is-selected .plantuml-node-shape {
  fill: #15302d;
  stroke: #c2f762;
  stroke-width: 2;
  filter: drop-shadow(0 0 7px rgba(86, 239, 197, 0.22));
}

.plantuml-node[data-node-type="database"] .plantuml-node-shape,
.plantuml-node[data-node-type="queue"] .plantuml-node-shape {
  fill: #121d26;
  stroke: #6aa6e8;
}

.plantuml-node[data-node-type="actor"] .plantuml-node-shape,
.plantuml-node[data-node-type="participant"] .plantuml-node-shape {
  fill: #221d14;
  stroke: #ffd166;
}

.plantuml-node[data-node-type="cloud"] .plantuml-node-shape {
  fill: #21172b;
  stroke: #c38cff;
}

.plantuml-node[data-node-type="decision"] .plantuml-node-shape {
  fill: #202313;
  stroke: var(--yellow);
}

.plantuml-decision-shape {
  stroke-linejoin: round;
}

.plantuml-connector-handle {
  fill: #091113;
  stroke: var(--accent);
  stroke-width: 2;
  cursor: crosshair;
  opacity: 0;
  transition: fill 120ms ease, opacity 120ms ease;
  vector-effect: non-scaling-stroke;
}

.plantuml-node:hover .plantuml-connector-handle,
.plantuml-node:focus .plantuml-connector-handle,
.plantuml-node.is-selected .plantuml-connector-handle {
  opacity: 1;
}

.plantuml-connector-handle:hover {
  fill: var(--accent);
}

.plantuml-connection-preview {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-dasharray: 7 5;
  pointer-events: none;
  vector-effect: non-scaling-stroke;
}

.plantuml-lifeline {
  fill: none;
  stroke: #45635f;
  stroke-width: 1.2;
  stroke-dasharray: 5 5;
  pointer-events: none;
  vector-effect: non-scaling-stroke;
}

.plantuml-sequence-number {
  fill: var(--muted-2);
  font: 8px "SFMono-Regular", Consolas, monospace;
  pointer-events: none;
}

.plantuml-fragment-box {
  fill: rgba(12, 21, 24, 0.34);
  stroke: #45635f;
  stroke-width: 1.2;
  vector-effect: non-scaling-stroke;
}

.plantuml-fragment-tag {
  fill: #132326;
  stroke: #45635f;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.plantuml-fragment-label,
.plantuml-fragment-else-label {
  fill: var(--yellow);
  font: 8px "SFMono-Regular", Consolas, monospace;
  pointer-events: none;
}

.plantuml-fragment-else-label {
  fill: var(--muted);
}

.plantuml-fragment-divider {
  fill: none;
  stroke: #45635f;
  stroke-width: 1;
  stroke-dasharray: 6 5;
  vector-effect: non-scaling-stroke;
}

.plantuml-node-type {
  fill: #69817d;
  font: 8px "SFMono-Regular", Consolas, monospace;
  letter-spacing: 0.12em;
  pointer-events: none;
}

.plantuml-node-label {
  fill: #e7f2ef;
  font: 600 12px "SFMono-Regular", Consolas, monospace;
  text-anchor: middle;
  pointer-events: none;
}

.plantuml-node-handle {
  fill: #55736e;
  font: 10px "SFMono-Regular", Consolas, monospace;
  pointer-events: none;
}

.plantuml-canvas-placeholder {
  position: absolute;
  z-index: 0;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  pointer-events: none;
  transition: opacity 150ms ease;
}

.plantuml-canvas-placeholder.is-hidden {
  opacity: 0;
}

.plantuml-canvas-placeholder > span {
  width: 62px;
  height: 44px;
  display: grid;
  place-items: center;
  margin-bottom: 4px;
  color: var(--line-strong);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
}

.plantuml-canvas-placeholder strong {
  color: var(--text);
  font-size: 12px;
}

.plantuml-canvas-placeholder small {
  color: var(--muted-2);
  font-size: 9px;
}

.plantuml-drop-indicator {
  position: absolute;
  z-index: 8;
  top: 50%;
  left: 50%;
  display: none;
  padding: 12px 16px;
  color: var(--bg);
  background: var(--accent);
  border: 1px solid var(--lime);
  border-radius: 5px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.42), 0 0 24px rgba(86, 239, 197, 0.22);
  font-size: 10px;
  font-weight: 800;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.plantuml-canvas-wrap.is-drop-ready .plantuml-drop-indicator {
  display: block;
}

.plantuml-canvas-hint {
  position: sticky;
  z-index: 2;
  left: 50%;
  bottom: 12px;
  width: max-content;
  margin: -31px auto 10px;
  padding: 5px 9px;
  color: var(--muted);
  background: rgba(7, 12, 14, 0.88);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 8px;
  pointer-events: none;
}

.plantuml-canvas-hint.is-hidden {
  display: none;
}

.plantuml-inspector,
.plantuml-link-inspector {
  position: absolute;
  z-index: 5;
  top: 12px;
  right: 12px;
  width: 224px;
  display: grid;
  gap: 9px;
  padding: 12px;
  color: var(--muted);
  background: rgba(12, 21, 24, 0.97);
  border: 1px solid var(--line-strong);
  border-top: 2px solid var(--accent);
  border-radius: 5px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.42);
}

.plantuml-inspector[hidden],
.plantuml-link-inspector[hidden] {
  display: none;
}

.plantuml-inspector > div,
.plantuml-link-inspector > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.plantuml-inspector > div span,
.plantuml-inspector label,
.plantuml-link-inspector > div span,
.plantuml-link-inspector label {
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.06em;
}

.plantuml-inspector > div strong,
.plantuml-link-inspector > div strong {
  max-width: 105px;
  overflow: hidden;
  color: var(--accent);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plantuml-inspector label,
.plantuml-link-inspector label {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.plantuml-inspector input,
.plantuml-inspector select,
.plantuml-link-inspector input,
.plantuml-link-inspector select {
  width: 100%;
  height: 29px;
  min-width: 0;
  padding: 0 7px;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 3px;
  font-size: 9px;
}

.plantuml-inspector input:focus,
.plantuml-inspector select:focus,
.plantuml-link-inspector input:focus,
.plantuml-link-inspector select:focus {
  border-color: var(--accent);
}

.plantuml-status {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-transform: none;
}

.plantuml-status i {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 3px;
  font-size: 8px;
  font-style: normal;
  font-weight: 800;
}

.plantuml-status.success { color: var(--accent); }
.plantuml-status.warning { color: var(--yellow); }
.plantuml-status.error { color: var(--red); }
.plantuml-status.idle { color: var(--muted); }

.plantuml-source-actions {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 7px 14px 7px 18px;
  color: var(--muted);
  background: var(--surface);
  border-top: 1px solid var(--line-strong);
  font-size: 9px;
}

.plantuml-source-actions code {
  color: var(--purple);
}

.plantuml-source-actions > div {
  display: flex;
  gap: 3px;
}

@media (max-width: 1040px) {
  .plantuml-editor-grid {
    height: auto;
    grid-template-columns: 1fr;
  }

  .plantuml-panel {
    min-height: 540px;
  }

  .plantuml-source-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line-strong);
  }
}

@media (max-width: 760px) {
  .plantuml-main-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .plantuml-main-toolbar .toolbar-left {
    width: 100%;
  }

  .plantuml-sync-state {
    align-self: flex-end;
  }

  .plantuml-panel {
    min-height: 540px;
  }

  #plantumlInput {
    min-height: 370px;
  }

  .plantuml-source-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .plantuml-source-actions > div {
    align-self: flex-end;
  }

  .plantuml-inspector,
  .plantuml-link-inspector {
    right: 8px;
    width: min(224px, calc(100% - 16px));
  }

  .plantuml-board {
    grid-template-columns: 1fr;
    grid-template-rows: 84px minmax(0, 1fr);
  }

  .plantuml-palette {
    flex-direction: row;
    gap: 5px;
    padding: 7px;
    overflow-x: auto;
    overflow-y: hidden;
    border-right: 0;
    border-bottom: 1px solid var(--line-strong);
  }

  .plantuml-palette header {
    min-width: 84px;
    justify-content: center;
    padding: 4px 8px 4px 2px;
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }

  .plantuml-palette button {
    width: 76px;
    min-width: 76px;
    min-height: 68px;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: 26px 15px;
    place-items: center;
    gap: 4px;
    padding: 5px;
    text-align: center;
  }

  .plantuml-palette button:hover {
    transform: translateY(-1px);
  }

  .plantuml-palette button > span {
    grid-row: auto;
  }

  .plantuml-palette button > small {
    display: none;
  }
}

/* Markdown studio */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.markdown-workbench {
  position: relative;
  overflow: hidden;
  background: rgba(12, 21, 24, 0.96);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.markdown-main-toolbar {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 15px;
  background: var(--surface);
  border-bottom: 1px solid var(--line-strong);
}

.markdown-sync-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-size: 9px;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.markdown-sync-state span {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(86, 239, 197, 0.7);
}

.markdown-editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  height: 640px;
  min-height: 640px;
}

.markdown-panel {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(520px, 1fr) 36px;
}

.markdown-source-panel {
  border-right: 1px solid var(--line-strong);
}

#markdownInput {
  width: 100%;
  min-height: 0;
  display: block;
  padding: 24px;
  color: var(--text);
  background: rgba(7, 12, 14, 0.72);
  border: 0;
  border-radius: 0;
  font: 12px/21px "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  overflow-wrap: normal;
  resize: none;
  tab-size: 2;
  white-space: pre-wrap;
}

#markdownInput::placeholder {
  color: var(--muted-2);
}

#markdownInput:focus {
  outline-offset: -3px;
}

.markdown-format-toolbar {
  min-height: 54px;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 9px 11px;
  overflow-x: auto;
  color: var(--muted);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  scrollbar-width: thin;
}

.markdown-format-toolbar label,
.markdown-format-toolbar button,
.markdown-format-toolbar select {
  flex: 0 0 auto;
}

.markdown-format-toolbar select {
  height: 31px;
  padding: 0 8px;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 10px;
}

.markdown-format-toolbar button {
  min-width: 31px;
  height: 31px;
  padding: 0 8px;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  font-size: 10px;
}

.markdown-format-toolbar button:hover {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: var(--line);
}

.markdown-toolbar-divider {
  width: 1px;
  height: 22px;
  flex: 0 0 1px;
  margin: 0 3px;
  background: var(--line);
}

.markdown-format-hint {
  margin-left: auto;
  padding-left: 8px;
  color: var(--muted-2);
  font-size: 8px;
  white-space: nowrap;
}

.markdown-preview {
  min-height: 0;
  padding: 34px 38px 56px;
  overflow: auto;
  color: #d9e8e5;
  background: #0a1214;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.8;
}

.markdown-preview:focus {
  outline-offset: -3px;
}

.markdown-preview:empty::before {
  color: var(--muted-2);
  content: attr(data-placeholder);
  pointer-events: none;
}

.markdown-preview h1,
.markdown-preview h2,
.markdown-preview h3,
.markdown-preview h4,
.markdown-preview h5,
.markdown-preview h6 {
  max-width: none;
  margin: 1.7em 0 0.65em;
  color: var(--text);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.04em;
}

.markdown-preview h1 {
  margin-top: 0;
  padding-bottom: 0.45em;
  border-bottom: 1px solid var(--line-strong);
  font-size: 32px;
}

.markdown-preview h2 {
  padding-bottom: 0.35em;
  border-bottom: 1px solid var(--line);
  font-size: 24px;
}

.markdown-preview h3 { font-size: 19px; }
.markdown-preview h4 { font-size: 16px; }
.markdown-preview h5,
.markdown-preview h6 { font-size: 14px; }

.markdown-preview p {
  margin: 0 0 1em;
}

.markdown-preview strong {
  color: var(--text);
}

.markdown-preview em {
  color: #b7d9d2;
}

.markdown-preview a {
  color: var(--accent);
  text-decoration-color: rgba(86, 239, 197, 0.38);
  text-underline-offset: 3px;
}

.markdown-preview code {
  padding: 0.15em 0.38em;
  color: var(--lime);
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.88em;
}

.markdown-preview pre {
  position: relative;
  margin: 1.4em 0;
  padding: 18px 20px;
  overflow: auto;
  color: var(--text);
  background: #05090a;
  border: 1px solid var(--line);
  border-radius: 6px;
  line-height: 1.65;
}

.markdown-preview pre code {
  padding: 0;
  color: inherit;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.markdown-preview pre code[data-language]::before {
  display: block;
  margin-bottom: 10px;
  color: var(--muted-2);
  content: attr(data-language);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.markdown-preview blockquote {
  margin: 1.35em 0;
  padding: 10px 18px;
  color: #b9cbc7;
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
}

.markdown-preview blockquote > :last-child {
  margin-bottom: 0;
}

.markdown-preview ul,
.markdown-preview ol {
  margin: 0 0 1.1em;
  padding-left: 1.6em;
}

.markdown-preview li {
  margin: 0.3em 0;
  padding-left: 0.25em;
}

.markdown-task-item {
  list-style: none;
}

.markdown-task-item input {
  margin: 0 8px 0 -1.4em;
  accent-color: var(--accent);
}

.markdown-preview hr {
  height: 1px;
  margin: 2em 0;
  background: var(--line-strong);
  border: 0;
}

.markdown-table-wrap {
  max-width: 100%;
  margin: 1.4em 0;
  overflow-x: auto;
}

.markdown-preview table {
  width: 100%;
  border-collapse: collapse;
}

.markdown-preview th,
.markdown-preview td {
  padding: 9px 11px;
  text-align: left;
  border: 1px solid var(--line);
}

.markdown-preview th {
  color: var(--accent);
  background: var(--surface-2);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 11px;
}

.markdown-preview td {
  font-size: 12px;
}

.markdown-image-placeholder {
  display: inline-block;
  padding: 4px 8px;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px dashed var(--line-strong);
  border-radius: 4px;
  font: 10px/1.4 "SFMono-Regular", Consolas, monospace;
}

.markdown-preview-footer {
  text-transform: none;
}

.markdown-footer-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

.markdown-footer-actions button {
  padding: 4px 6px;
  color: var(--muted);
  background: transparent;
  border: 0;
  font-size: 9px;
}

.markdown-footer-actions button:hover {
  color: var(--accent);
}

.markdown-drop-overlay {
  inset: 10px;
}

/* Timestamp */
.timestamp-workbench {
  display: grid;
  grid-template-columns: minmax(250px, 0.58fr) minmax(0, 1.42fr);
  gap: 16px;
}

.live-time-card,
.time-converter-card {
  background: rgba(12, 21, 24, 0.96);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.live-time-card {
  min-width: 0;
  padding: 24px;
}

.live-time-heading {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.09em;
}

.live-time-card > strong {
  display: block;
  margin: 44px 0 8px;
  color: var(--lime);
  font-size: clamp(34px, 4.2vw, 62px);
  font-weight: 600;
  letter-spacing: -0.08em;
}

.live-time-card > p {
  margin: 0 0 42px;
  color: var(--muted);
  font-size: 11px;
}

.live-time-card dl {
  margin: 0;
  border-top: 1px solid var(--line);
}

.live-time-card dl > div {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.live-time-card dt {
  color: var(--muted);
  font-size: 10px;
}

.live-time-card dd {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  margin: 0;
}

.live-time-card code {
  min-width: 0;
  overflow: hidden;
  color: var(--accent);
  font-size: 11px;
  text-overflow: ellipsis;
}

.live-time-card button,
.time-results button {
  padding: 3px 5px;
  color: var(--muted);
  background: transparent;
  border: 0;
  font-size: 9px;
}

.live-time-card button:hover,
.time-results button:hover {
  color: var(--accent);
}

.time-converters {
  display: grid;
  gap: 16px;
}

.time-converter-card {
  padding: 22px;
}

.time-converter-card > header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 22px;
  padding-bottom: 17px;
  border-bottom: 1px solid var(--line);
}

.time-converter-card h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}

.time-converter-card header p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.time-form-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(145px, 0.34fr);
  gap: 12px;
}

.time-field {
  min-width: 0;
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 10px;
}

.time-field small {
  margin-top: -2px;
  color: var(--muted-2);
  font-size: 9px;
  line-height: 1.5;
}

.time-field input,
.time-field select {
  width: 100%;
  height: 42px;
  padding: 0 11px;
  font-size: 11px;
}

.time-field input:focus,
.time-field select:focus,
.indent-control select:focus {
  border-color: var(--accent);
}

.time-card-actions {
  display: flex;
  gap: 9px;
  margin: 16px 0;
}

.time-results {
  border-top: 1px solid var(--line);
}

.time-results > div {
  min-width: 0;
  display: grid;
  grid-template-columns: 95px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  border-bottom: 1px solid var(--line);
}

.time-results span {
  color: var(--muted);
  font-size: 9px;
}

.time-results strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 10px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.time-message {
  min-height: 16px;
  margin: 12px 0 0;
  color: var(--accent);
  font-size: 10px;
}

.time-message.is-error {
  color: var(--red);
}

.timestamp-notes {
  margin-top: 54px;
}

/* Footer and toast */
.site-footer {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  color: var(--muted-2);
  border-top: 1px solid var(--line);
  font-size: 9px;
  letter-spacing: 0.1em;
}

.toast {
  position: fixed;
  z-index: 100;
  right: 24px;
  bottom: 24px;
  max-width: min(360px, calc(100vw - 48px));
  padding: 12px 15px;
  color: var(--bg);
  background: var(--accent);
  border: 1px solid var(--lime);
  border-radius: 5px;
  box-shadow: 0 15px 36px rgba(0, 0, 0, 0.45), 0 0 24px rgba(86, 239, 197, 0.18);
  font-size: 11px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 170ms ease, transform 170ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1040px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .eyebrow {
    padding-top: 0;
  }

  .portal-hero {
    grid-template-columns: minmax(0, 1.2fr) minmax(235px, 0.8fr);
    gap: 24px;
  }

  .editor-grid,
  .timestamp-workbench {
    grid-template-columns: 1fr;
  }

  .markdown-editor-grid {
    grid-template-columns: 1fr;
    height: auto;
  }

  .sql-editor-grid {
    height: auto;
    grid-template-columns: 1fr;
  }

  .sql-panel {
    min-height: 540px;
  }

  .sql-input-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line-strong);
  }

  .markdown-source-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line-strong);
  }

  .input-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line-strong);
  }

  .live-time-card > strong {
    margin-top: 30px;
  }

  .live-time-card > p {
    margin-bottom: 26px;
  }
}

@media (max-width: 760px) {
  .page-shell {
    width: min(100% - 28px, 1480px);
  }

  .site-header {
    min-height: 68px;
  }

  .header-right {
    gap: 8px;
  }

  .site-nav a {
    padding: 0 7px;
    font-size: 10px;
  }

  .site-nav a::before,
  .privacy-note span:last-child {
    display: none;
  }

  .privacy-note {
    padding: 8px;
  }

  .hero {
    padding: 42px 0 34px;
  }

  .hero-copy {
    display: block;
  }

  .hero-copy p {
    width: auto;
    margin-top: 22px;
  }

  h1 {
    font-size: clamp(40px, 12vw, 62px);
  }

  .portal-hero {
    min-height: 0;
    grid-template-columns: 1fr;
    padding: 46px 0 38px;
  }

  .portal-hero h1 {
    font-size: clamp(40px, 12vw, 62px);
  }

  .now-widget {
    width: 100%;
    min-height: 210px;
  }

  .tool-card {
    grid-template-columns: 130px minmax(0, 1fr) auto;
    gap: 18px;
  }

  .portal-manifesto,
  .feature-strip {
    grid-template-columns: 1fr;
    margin: 42px 0 48px;
  }

  .portal-manifesto > div + div,
  .feature-strip > div + div {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .markdown-main-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .sql-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .sql-toolbar .toolbar-left {
    width: 100%;
  }

  .sql-options {
    align-self: flex-end;
  }

  .markdown-main-toolbar .toolbar-left {
    width: 100%;
  }

  .markdown-sync-state {
    align-self: flex-end;
  }

  .toolbar-left,
  .toolbar-right {
    width: 100%;
    flex-wrap: wrap;
  }

  .toolbar-right {
    justify-content: flex-end;
  }

  .button {
    flex: 1;
  }

  .file-label {
    max-width: 100%;
    flex-basis: 100%;
  }

  .button-primary kbd {
    display: none;
  }

  .editor-panel {
    grid-template-rows: 52px minmax(360px, 1fr) 36px;
  }

  .input-wrap,
  .output-wrap {
    min-height: 360px;
  }

  .panel-header {
    padding: 0 11px;
  }

  #jsonInput,
  #jsonOutput {
    font-size: 11px;
    line-height: 20px;
  }

  #jsonInput {
    padding: 19px 16px 19px 56px;
  }

  #jsonOutput {
    padding: 0;
  }

  #jsonOutput code {
    padding: 19px 0;
  }

  .line-numbers {
    width: 42px;
    padding-top: 19px;
    padding-right: 7px;
  }

  .line-numbers pre,
  .line-numbers span,
  .output-line,
  .output-content {
    height: 20px;
    min-height: 20px;
    line-height: 20px;
  }

  .input-wrap .empty-hint {
    left: 42px;
  }

  .output-gutter {
    width: 54px;
    height: 20px;
    flex-basis: 54px;
    padding-right: 6px;
  }

  .error-diagnostic {
    right: 9px;
    bottom: 9px;
    left: 49px;
  }

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

  .markdown-panel {
    grid-template-rows: auto minmax(400px, 1fr) 36px;
  }

  .sql-panel {
    min-height: 440px;
  }

  #markdownInput,
  .markdown-preview {
    min-height: 400px;
  }

  .markdown-preview {
    padding: 28px 24px 44px;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
  }
}

@media (max-width: 520px) {
  .site-header {
    gap: 10px;
  }

  .brand {
    font-size: 12px;
  }

  .brand-mark {
    width: 10px;
    height: 10px;
  }

  .site-nav {
    gap: 0;
  }

  .site-nav a {
    padding: 0 6px;
    font-size: 9px;
  }

  .privacy-note {
    display: none;
  }

  .portal-command {
    align-items: flex-start;
    margin-top: 28px;
    padding: 14px;
  }

  .portal-command kbd {
    display: none;
  }

  .directory-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .tool-card {
    grid-template-columns: 1fr auto;
    gap: 14px;
    padding: 20px 4px;
  }

  .tool-card-top {
    grid-column: 1 / -1;
  }

  .tool-card-link {
    align-self: end;
  }

  .tool-card:hover {
    padding-right: 8px;
    padding-left: 8px;
  }

  .tool-card-soon:hover {
    padding-right: 4px;
    padding-left: 4px;
  }

  .toolbar-left .button {
    min-width: 0;
  }

  .indent-control {
    margin-right: auto;
    padding-left: 0;
    border-left: 0;
  }

  .output-actions button:not(.copy-button) {
    width: 26px;
    overflow: hidden;
    padding: 0;
    font-size: 0;
  }

  #minifyButton::after {
    font-size: 9px;
    content: "压";
  }

  #downloadButton::after {
    font-size: 9px;
    content: "存";
  }

  .error-diagnostic {
    grid-template-columns: 24px minmax(0, 1fr);
    left: 8px;
  }

  .error-diagnostic-icon {
    width: 23px;
    height: 23px;
  }

  .live-time-card,
  .time-converter-card {
    padding: 17px;
  }

  .time-card-actions {
    flex-direction: column;
  }

  .time-results > div {
    grid-template-columns: 78px minmax(0, 1fr) auto;
  }

  .markdown-main-toolbar .toolbar-left .button {
    flex-basis: calc(50% - 5px);
  }

  .sql-toolbar .toolbar-left .button {
    flex-basis: calc(50% - 5px);
  }

  .sql-options {
    width: 100%;
    justify-content: space-between;
  }

  .markdown-format-hint {
    display: none;
  }

  .markdown-preview {
    padding: 24px 18px 40px;
  }

  .markdown-preview h1 { font-size: 27px; }
  .markdown-preview h2 { font-size: 21px; }

  .markdown-preview-footer > span:first-child {
    display: none;
  }

  .markdown-preview-footer {
    justify-content: flex-end;
  }

  .toast {
    right: 14px;
    bottom: 14px;
    max-width: calc(100vw - 28px);
  }
}

/* Mermaid local visualizer */
.mermaid-workbench {
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.mermaid-main-toolbar {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 15px;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}

.mermaid-sync-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.mermaid-sync-state span {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.mermaid-sync-state.is-working span {
  animation: terminal-cursor 700ms steps(1) infinite;
}

.mermaid-sync-state.is-error {
  color: var(--red);
}

.mermaid-sync-state.is-error span {
  background: var(--red);
  box-shadow: 0 0 0 3px var(--red-soft);
}

.mermaid-editor-grid {
  height: 650px;
  min-height: 650px;
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(0, 1.14fr);
}

.mermaid-panel {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: 54px minmax(0, 1fr) 36px;
}

.mermaid-source-panel {
  border-right: 1px solid var(--line-strong);
}

#mermaidInput {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: block;
  padding: 23px 24px;
  overflow: auto;
  color: var(--text);
  background: #fbfcfd;
  border: 0;
  border-radius: 0;
  caret-color: var(--accent);
  font: 12px/21px "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  resize: none;
  tab-size: 2;
  white-space: pre;
}

#mermaidInput::placeholder {
  color: var(--muted-2);
}

#mermaidInput:focus {
  outline-offset: -3px;
}

.mermaid-output-actions {
  display: flex;
  align-items: center;
  gap: 7px !important;
}

.mermaid-output-actions button,
.mermaid-source-actions button {
  min-height: 29px;
  padding: 0 9px;
  color: var(--muted);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 9px;
  font-weight: 700;
}

.mermaid-output-actions button:not(:disabled):hover,
.mermaid-source-actions button:hover {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: rgba(var(--accent-rgb), 0.3);
}

.mermaid-output-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.36;
}

.mermaid-zoom-controls {
  height: 31px;
  display: inline-flex;
  align-items: center;
  gap: 1px;
  padding: 2px;
  background: #f6f7f9;
  border: 1px solid var(--line);
  border-radius: 9px;
}

.mermaid-zoom-controls button {
  width: 26px;
  min-height: 25px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 6px;
  font-size: 12px;
}

.mermaid-zoom-controls output {
  min-width: 43px;
  color: var(--muted);
  font: 700 9px/1 "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  text-align: center;
}

.mermaid-zoom-controls #mermaidFitButton {
  width: auto;
  padding: 0 7px;
  font-size: 9px;
}

.mermaid-canvas-wrap {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background-color: #fbfcfd;
  background-image: radial-gradient(circle, rgba(105, 115, 134, 0.16) 0.7px, transparent 0.8px);
  background-size: 18px 18px;
  overscroll-behavior: contain;
}

.mermaid-canvas {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: block;
  overflow: hidden;
  cursor: grab;
  outline: none;
  touch-action: none;
  user-select: none;
}

.mermaid-canvas:empty {
  display: none;
}

.mermaid-canvas.is-panning {
  cursor: grabbing;
}

.mermaid-canvas:focus-visible {
  box-shadow: inset 0 0 0 2px rgba(var(--accent-rgb), 0.34);
}

.mermaid-canvas > svg {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  max-width: none !important;
  height: auto;
  overflow: visible;
  pointer-events: none;
  transform-origin: 0 0;
  will-change: transform;
  filter: drop-shadow(0 8px 18px rgba(31, 38, 51, 0.05));
}

.mermaid-canvas:not(:empty)::after {
  content: "拖动平移 · Ctrl/⌘ + 滚轮缩放 · 双击适应";
  position: absolute;
  z-index: 3;
  right: 11px;
  bottom: 10px;
  padding: 5px 7px;
  color: var(--muted-2);
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(105, 115, 134, 0.12);
  border-radius: 6px;
  font-size: 8px;
  letter-spacing: 0.02em;
  pointer-events: none;
  backdrop-filter: blur(8px);
}

.mermaid-placeholder {
  position: absolute;
  z-index: 0;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  pointer-events: none;
}

.mermaid-placeholder > span {
  width: 68px;
  height: 48px;
  display: grid;
  place-items: center;
  margin-bottom: 4px;
  color: #ffffff;
  background: var(--accent);
  border-radius: 14px;
  box-shadow: 0 9px 20px rgba(var(--accent-rgb), 0.2);
  font-size: 12px;
  font-weight: 800;
}

.mermaid-placeholder strong {
  color: var(--text);
  font-size: 12px;
}

.mermaid-placeholder small {
  color: var(--muted-2);
  font-size: 9px;
}

.mermaid-error {
  position: absolute;
  z-index: 4;
  right: 18px;
  bottom: 18px;
  left: 18px;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 11px;
  align-items: start;
  padding: 14px;
  color: #6f2730;
  background: rgba(255, 245, 246, 0.97);
  border: 1px solid var(--red);
  border-left-width: 4px;
  border-radius: 12px;
  box-shadow: 0 16px 38px rgba(84, 29, 37, 0.14);
}

.mermaid-error:not([hidden]) {
  display: grid;
}

.mermaid-error > i {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  color: #ffffff;
  background: var(--red);
  border-radius: 8px;
  font-size: 13px;
  font-style: normal;
  font-weight: 800;
}

.mermaid-error strong {
  display: block;
  margin: 1px 0 6px;
  color: var(--red);
  font-size: 12px;
}

.mermaid-error p {
  max-height: 150px;
  margin: 0;
  overflow: auto;
  color: #8d4b53;
  font: 10px/1.55 "SFMono-Regular", Consolas, monospace;
  white-space: pre-wrap;
}

.mermaid-status {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-transform: none;
}

.mermaid-status i {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 5px;
  font-size: 8px;
  font-style: normal;
  font-weight: 800;
}

.mermaid-status.success { color: var(--accent); }
.mermaid-status.error { color: var(--red); }
.mermaid-status.working { color: var(--muted); }
.mermaid-status.idle { color: var(--muted); }

.mermaid-source-actions {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 7px 14px 7px 18px;
  color: var(--muted);
  background: #ffffff;
  border-top: 1px solid var(--line);
  font-size: 9px;
}

.mermaid-source-actions > div {
  display: flex;
  gap: 5px;
}

.mermaid-drop-overlay {
  inset: 10px;
}

@media (max-width: 1040px) {
  .mermaid-editor-grid {
    height: auto;
    grid-template-columns: 1fr;
  }

  .mermaid-panel {
    min-height: 540px;
  }

  .mermaid-source-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line-strong);
  }
}

@media (max-width: 760px) {
  .mermaid-main-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .mermaid-main-toolbar .toolbar-left {
    width: 100%;
  }

  .mermaid-sync-state {
    align-self: flex-end;
  }

  .mermaid-panel {
    min-height: 460px;
  }

  .mermaid-output-actions {
    gap: 5px !important;
  }

  .mermaid-canvas:not(:empty)::after {
    content: "拖动平移 · 双击适应";
  }

  .mermaid-source-actions {
    align-items: flex-start;
    flex-direction: column;
    padding: 12px 14px;
  }

  .mermaid-source-actions > div {
    width: 100%;
  }

  .mermaid-source-actions button {
    flex: 1;
  }
}

@media (max-width: 420px) {
  .brand > span:last-child {
    display: none;
  }

  .site-header {
    gap: 6px;
  }

  .site-nav a {
    padding-right: 5px;
    padding-left: 5px;
  }
}

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

/* PlantUML classic surface — intentionally independent from the portal theme */
.plantuml-workbench {
  --puml-red: #a80036;
  --puml-yellow: #fefece;
  --puml-ink: #111111;
  --puml-line: #b8b8b8;
  color: var(--puml-ink);
  background: #ffffff;
  border-color: #8f8f8f;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.16);
  font-family: Arial, Helvetica, sans-serif;
}

.plantuml-workbench .plantuml-main-toolbar,
.plantuml-workbench .panel-header,
.plantuml-workbench .panel-footer,
.plantuml-workbench .plantuml-source-actions {
  color: #333333;
  background: #f2f2f2;
  border-color: var(--puml-line);
}

.plantuml-workbench .panel-header h2,
.plantuml-workbench .panel-footer,
.plantuml-workbench .panel-meta,
.plantuml-workbench .file-label {
  color: #333333;
}

.plantuml-workbench .panel-index {
  color: #ffffff;
  background: var(--puml-red);
  border-color: var(--puml-red);
}

.plantuml-workbench .button-primary {
  color: #ffffff;
  background: var(--puml-red);
  border-color: #760025;
  box-shadow: none;
}

.plantuml-workbench .button-primary:hover {
  color: #ffffff;
  background: #88002b;
  border-color: #5f001e;
}

.plantuml-workbench .button-ghost,
.plantuml-workbench .icon-button,
.plantuml-workbench .plantuml-output-actions button,
.plantuml-workbench .plantuml-source-actions button {
  color: #333333;
  background: #ffffff;
  border: 1px solid #b8b8b8;
}

.plantuml-workbench .button-ghost:hover,
.plantuml-workbench .icon-button:hover,
.plantuml-workbench .plantuml-output-actions button:hover,
.plantuml-workbench .plantuml-source-actions button:hover {
  color: var(--puml-red);
  background: #fff6f8;
  border-color: var(--puml-red);
}

.plantuml-workbench kbd {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.44);
}

.plantuml-workbench .plantuml-sync-state,
.plantuml-workbench .plantuml-sync-state.is-warning {
  color: var(--puml-red);
}

.plantuml-workbench .plantuml-sync-state span,
.plantuml-workbench .plantuml-sync-state.is-warning span {
  background: var(--puml-red);
  box-shadow: none;
}

.plantuml-workbench .plantuml-source-panel {
  border-color: var(--puml-line);
}

.plantuml-workbench #plantumlInput {
  color: #1d1d1d;
  background: #fffef8;
  caret-color: var(--puml-red);
}

.plantuml-workbench #plantumlInput::placeholder {
  color: #8a8a8a;
}

.plantuml-workbench #plantumlInput:focus {
  outline: 2px solid rgba(168, 0, 54, 0.32);
}

.plantuml-workbench .plantuml-palette {
  color: #222222;
  background: #f6f6f6;
  border-color: var(--puml-line);
}

.plantuml-workbench .plantuml-palette header {
  border-color: #d2d2d2;
}

.plantuml-workbench .plantuml-palette header strong,
.plantuml-workbench .plantuml-palette button {
  color: #222222;
}

.plantuml-workbench .plantuml-palette header small,
.plantuml-workbench .plantuml-palette button > small {
  color: #6f6f6f;
}

.plantuml-workbench .plantuml-palette button {
  background: #ffffff;
  border-color: #c9c9c9;
  border-radius: 2px;
}

.plantuml-workbench .plantuml-palette button:hover,
.plantuml-workbench .plantuml-palette button:focus-visible {
  color: var(--puml-red);
  background: #fff7f9;
  border-color: var(--puml-red);
}

.plantuml-workbench .plantuml-palette button > span {
  color: var(--puml-red);
  background: var(--puml-yellow);
  border-color: var(--puml-red);
  border-radius: 1px;
}

.plantuml-workbench .plantuml-canvas-wrap {
  background-color: #ffffff;
  background-image: radial-gradient(circle, rgba(0, 0, 0, 0.13) 0.7px, transparent 0.8px);
}

.plantuml-workbench .plantuml-canvas-wrap.is-drop-ready {
  box-shadow: inset 0 0 0 2px var(--puml-red), inset 0 0 48px rgba(168, 0, 54, 0.06);
}

.plantuml-workbench .plantuml-link {
  stroke: var(--puml-red);
  stroke-width: 1.45;
}

.plantuml-workbench .plantuml-link-group:hover .plantuml-link,
.plantuml-workbench .plantuml-link-group:focus .plantuml-link,
.plantuml-workbench .plantuml-link-group.is-selected .plantuml-link {
  stroke: #0057b8;
}

.plantuml-workbench .plantuml-link-group.is-selected .plantuml-link-label-bg {
  stroke: #0057b8;
}

.plantuml-workbench .plantuml-link-label-bg {
  fill: #ffffff;
  stroke: #d0d0d0;
}

.plantuml-workbench .plantuml-link-label {
  fill: #111111;
  font-family: Arial, Helvetica, sans-serif;
}

.plantuml-workbench .plantuml-node-hit {
  fill: transparent;
  stroke: none;
  pointer-events: all;
}

.plantuml-workbench .plantuml-node .plantuml-node-shape {
  fill: var(--puml-yellow);
  stroke: var(--puml-red);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.plantuml-workbench .plantuml-node:hover .plantuml-node-shape,
.plantuml-workbench .plantuml-node:focus .plantuml-node-shape {
  fill: #fff7d5;
  stroke: #7c0028;
}

.plantuml-workbench .plantuml-node.is-selected .plantuml-node-shape {
  fill: #fff0b9;
  stroke: #0057b8;
  stroke-width: 2;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.16));
}

.plantuml-workbench .plantuml-node-label {
  fill: #111111;
  font: 12px Arial, Helvetica, sans-serif;
}

.plantuml-workbench .plantuml-node-handle {
  fill: #666666;
}

.plantuml-workbench .plantuml-connector-handle {
  fill: #ffffff;
  stroke: var(--puml-red);
}

.plantuml-workbench .plantuml-connector-handle:hover {
  fill: var(--puml-red);
}

.plantuml-workbench .plantuml-connection-preview {
  stroke: var(--puml-red);
}

.plantuml-workbench .plantuml-lifeline,
.plantuml-workbench .plantuml-fragment-box,
.plantuml-workbench .plantuml-fragment-tag,
.plantuml-workbench .plantuml-fragment-divider {
  stroke: var(--puml-red);
}

.plantuml-workbench .plantuml-lifeline {
  stroke-dasharray: 5 5;
}

.plantuml-workbench .plantuml-fragment-box {
  fill: rgba(254, 254, 206, 0.18);
}

.plantuml-workbench .plantuml-fragment-tag {
  fill: var(--puml-yellow);
}

.plantuml-workbench .plantuml-fragment-label,
.plantuml-workbench .plantuml-fragment-else-label,
.plantuml-workbench .plantuml-sequence-number {
  fill: #111111;
  font-family: Arial, Helvetica, sans-serif;
}

.plantuml-workbench .plantuml-canvas-placeholder {
  color: #777777;
}

.plantuml-workbench .plantuml-canvas-placeholder > span {
  color: var(--puml-red);
  background: var(--puml-yellow);
  border-color: var(--puml-red);
}

.plantuml-workbench .plantuml-canvas-placeholder strong {
  color: #333333;
}

.plantuml-workbench .plantuml-canvas-placeholder small {
  color: #777777;
}

.plantuml-workbench .plantuml-drop-indicator {
  color: #ffffff;
  background: var(--puml-red);
  border-color: #760025;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
}

.plantuml-workbench .plantuml-canvas-hint {
  color: #555555;
  background: rgba(255, 255, 255, 0.94);
  border-color: #c8c8c8;
}

.plantuml-workbench .plantuml-inspector,
.plantuml-workbench .plantuml-link-inspector {
  color: #555555;
  background: rgba(255, 255, 255, 0.98);
  border-color: #b8b8b8;
  border-top-color: var(--puml-red);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}

.plantuml-workbench .plantuml-inspector > div,
.plantuml-workbench .plantuml-link-inspector > div {
  border-color: #d7d7d7;
}

.plantuml-workbench .plantuml-inspector > div span,
.plantuml-workbench .plantuml-inspector label,
.plantuml-workbench .plantuml-link-inspector > div span,
.plantuml-workbench .plantuml-link-inspector label {
  color: #666666;
}

.plantuml-workbench .plantuml-inspector > div strong,
.plantuml-workbench .plantuml-link-inspector > div strong {
  color: var(--puml-red);
}

.plantuml-workbench .plantuml-inspector input,
.plantuml-workbench .plantuml-inspector select,
.plantuml-workbench .plantuml-link-inspector input,
.plantuml-workbench .plantuml-link-inspector select {
  color: #222222;
  background: #ffffff;
  border-color: #b8b8b8;
}

.plantuml-workbench .plantuml-inspector input:focus,
.plantuml-workbench .plantuml-inspector select:focus,
.plantuml-workbench .plantuml-link-inspector input:focus,
.plantuml-workbench .plantuml-link-inspector select:focus {
  border-color: var(--puml-red);
}

.plantuml-workbench .plantuml-status.success,
.plantuml-workbench .plantuml-status.warning,
.plantuml-workbench .plantuml-status.error,
.plantuml-workbench .plantuml-status.idle,
.plantuml-workbench .plantuml-source-actions code {
  color: var(--puml-red);
}

/* 03 · Minimal OS */
:root {
  --bg: #f4f5f7;
  --bg-grid: transparent;
  --surface: #ffffff;
  --surface-2: #f5f6f8;
  --surface-3: #e9eef8;
  --line: #e4e6eb;
  --line-strong: #d3d7df;
  --text: #1d222b;
  --muted: #697386;
  --muted-2: #98a1b2;
  --accent: #4169e1;
  --accent-rgb: 65, 105, 225;
  --accent-soft: rgba(var(--accent-rgb), 0.1);
  --app-tint: rgba(var(--accent-rgb), 0.08);
  --lime: #147d68;
  --red: #d73a49;
  --red-soft: rgba(215, 58, 73, 0.1);
  --blue: #2f67c7;
  --purple: #7654c4;
  --yellow: #a96508;
  --shadow: 0 18px 54px rgba(26, 34, 49, 0.09), 0 2px 8px rgba(26, 34, 49, 0.04);
  color: var(--text);
  background: var(--bg);
  color-scheme: light;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html[data-color-theme="graphite"] {
  --bg: #f3f3f2;
  --surface-2: #f4f4f3;
  --surface-3: #e9e9e7;
  --line: #e1e1df;
  --line-strong: #cececa;
  --text: #202124;
  --muted: #6f7074;
  --accent: #303238;
  --accent-rgb: 48, 50, 56;
  --lime: #4d6b59;
  --blue: #3f5f94;
  --purple: #6e577d;
}

html[data-color-theme="sage"] {
  --bg: #f2f5f1;
  --surface-2: #f2f6f1;
  --surface-3: #e5efe8;
  --line: #dce5dd;
  --line-strong: #c8d5ca;
  --text: #1f2923;
  --muted: #68776d;
  --accent: #327a5c;
  --accent-rgb: 50, 122, 92;
  --lime: #327a5c;
  --blue: #3c7088;
  --purple: #6d638f;
}

html[data-color-theme="violet"] {
  --bg: #f5f3f8;
  --surface-2: #f6f3fa;
  --surface-3: #ede7f6;
  --line: #e5dfeb;
  --line-strong: #d4cadf;
  --text: #27222f;
  --muted: #756b80;
  --accent: #7657c5;
  --accent-rgb: 118, 87, 197;
  --lime: #4c7b6c;
  --blue: #4b68b3;
  --purple: #7657c5;
}

html[data-color-theme="coral"] {
  --bg: #f8f3f0;
  --surface-2: #faf4f1;
  --surface-3: #f6e7df;
  --line: #ebded7;
  --line-strong: #dbc9bf;
  --text: #302521;
  --muted: #7f6d65;
  --accent: #d0604f;
  --accent-rgb: 208, 96, 79;
  --lime: #5e7c63;
  --blue: #4c6f9e;
  --purple: #8a5f87;
}

body {
  background:
    radial-gradient(circle at 14% -8%, var(--app-tint), transparent 31rem),
    radial-gradient(circle at 92% 12%, rgba(var(--accent-rgb), 0.045), transparent 28rem),
    var(--bg);
  background-attachment: fixed;
  background-size: auto;
}

::selection {
  color: #ffffff;
  background: var(--accent);
}

.page-shell {
  width: min(1320px, calc(100% - 48px));
}

.site-header {
  position: sticky;
  top: 12px;
  z-index: 40;
  min-height: 62px;
  margin-top: 12px;
  padding: 8px 10px 8px 14px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(211, 215, 223, 0.9);
  border-radius: 18px;
  box-shadow: 0 12px 38px rgba(31, 38, 51, 0.08);
  backdrop-filter: blur(22px) saturate(150%);
}

.brand {
  gap: 10px;
  color: var(--text);
  font-size: 13px;
  letter-spacing: -0.01em;
}

.brand b {
  color: var(--text);
  font-weight: 750;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: #ffffff;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.3), transparent 45%), var(--accent);
  border: 1px solid rgba(var(--accent-rgb), 0.2);
  border-radius: 10px;
  box-shadow: 0 7px 16px rgba(var(--accent-rgb), 0.22);
  animation: none;
  font-size: 14px;
  font-weight: 800;
}

.header-right {
  min-width: 0;
  gap: 10px;
}

.site-nav {
  gap: 2px;
  padding: 3px;
  background: #f2f3f5;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.site-nav a {
  height: 32px;
  padding: 0 11px;
  color: var(--muted);
  border-radius: 9px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.site-nav a::before {
  display: none;
}

.site-nav a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.78);
}

.site-nav a[aria-current="page"] {
  color: var(--accent);
  background: #ffffff;
  box-shadow: 0 2px 7px rgba(30, 36, 48, 0.08);
}

.privacy-note {
  gap: 7px;
  padding: 8px 10px;
  color: #33715e;
  background: #f0f8f5;
  border-color: #d7ebe4;
  border-radius: 11px;
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.03em;
}

.privacy-dot,
.live-dot {
  background: #36a77f;
  box-shadow: 0 0 0 3px rgba(54, 167, 127, 0.12);
}

.theme-config {
  position: relative;
  flex: 0 0 auto;
}

.theme-config summary {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  color: var(--muted);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 11px;
  font-size: 10px;
  font-weight: 650;
  list-style: none;
  cursor: pointer;
  user-select: none;
}

.theme-config summary::-webkit-details-marker {
  display: none;
}

.theme-config summary::after {
  color: var(--muted-2);
  content: "⌄";
  font-size: 12px;
  transform: translateY(-1px);
}

.theme-config[open] summary {
  color: var(--accent);
  border-color: rgba(var(--accent-rgb), 0.35);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.theme-current-swatch,
.theme-swatch {
  display: block;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.theme-current-swatch {
  width: 13px;
  height: 13px;
}

.theme-swatch {
  width: 28px;
  height: 28px;
}

.theme-swatch-cloud { background: linear-gradient(135deg, #4169e1 0 50%, #dfe6fb 50%); }
.theme-swatch-graphite { background: linear-gradient(135deg, #303238 0 50%, #dededb 50%); }
.theme-swatch-sage { background: linear-gradient(135deg, #327a5c 0 50%, #dce9df 50%); }
.theme-swatch-violet { background: linear-gradient(135deg, #7657c5 0 50%, #e5ddf3 50%); }
.theme-swatch-coral { background: linear-gradient(135deg, #d0604f 0 50%, #f2dcd4 50%); }

.theme-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 292px;
  padding: 10px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  box-shadow: 0 22px 58px rgba(28, 35, 48, 0.18);
  backdrop-filter: blur(24px) saturate(150%);
}

.theme-panel > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 8px 11px;
  border-bottom: 1px solid var(--line);
}

.theme-panel header div,
.theme-panel header span {
  display: grid;
}

.theme-panel header strong {
  font-size: 13px;
}

.theme-panel header span,
.theme-panel header small {
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 9px;
  font-weight: 500;
}

.theme-options {
  display: grid;
  gap: 3px;
  padding-top: 7px;
}

.theme-options button {
  width: 100%;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 10px;
  padding: 8px;
  color: var(--text);
  background: transparent;
  border: 0;
  border-radius: 10px;
  text-align: left;
}

.theme-options button:hover {
  background: var(--surface-2);
}

.theme-options button[aria-pressed="true"] {
  background: var(--accent-soft);
}

.theme-options button > span:nth-child(2) {
  display: grid;
  gap: 2px;
}

.theme-options b {
  font-size: 11px;
}

.theme-options small {
  color: var(--muted-2);
  font-size: 9px;
}

.theme-options i {
  color: var(--accent);
  font-size: 11px;
  font-style: normal;
  opacity: 0;
}

.theme-options button[aria-pressed="true"] i {
  opacity: 1;
}

.app-view {
  animation: os-route-in 260ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes os-route-in {
  from { opacity: 0; transform: translateY(8px) scale(0.995); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.hero {
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 28px;
  padding: 66px 8px 44px;
}

.eyebrow {
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.eyebrow span {
  color: var(--accent);
}

h1,
.portal-hero h1 {
  color: var(--text);
  font-size: clamp(46px, 5.4vw, 76px);
  font-weight: 710;
  line-height: 1.02;
  letter-spacing: -0.06em;
}

h1 em {
  color: var(--accent);
  text-shadow: none;
}

.hero-copy p,
.portal-hero-main > p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.75;
}

.portal-hero {
  min-height: 530px;
  grid-template-columns: minmax(0, 1.45fr) minmax(270px, 0.55fr);
  gap: 32px;
  padding: 62px 8px 50px;
  border-color: var(--line);
}

.portal-hero h1 {
  margin: 22px 0 20px;
}

.portal-command {
  min-height: 52px;
  margin-top: 34px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.78);
  border-color: var(--line);
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(31, 38, 51, 0.05);
}

.portal-command kbd,
.button-primary kbd {
  color: var(--muted);
  background: #ffffff;
  border-color: var(--line-strong);
  border-radius: 7px;
}

.now-widget {
  position: relative;
  min-height: 280px;
  padding: 48px 24px 24px;
  background: rgba(255, 255, 255, 0.9);
  border-color: var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.now-widget::before {
  position: absolute;
  top: 18px;
  left: 20px;
  width: 9px;
  height: 9px;
  background: #ff5f57;
  border-radius: 50%;
  box-shadow: 16px 0 #febc2e, 32px 0 #28c840;
  content: "";
}

.now-widget-label {
  color: var(--muted-2);
  font-size: 9px;
}

.now-widget strong,
.live-time-card > strong {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.now-widget a {
  color: var(--accent);
  border-color: var(--line);
}

.tool-directory {
  padding: 54px 8px 18px;
}

.directory-header {
  align-items: center;
  padding-bottom: 20px;
  border-color: var(--line);
}

.directory-header h2 {
  font-size: 24px;
  font-weight: 720;
}

.directory-header p b {
  color: var(--accent);
}

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

.tool-card {
  min-height: 250px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 22px;
  padding: 20px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 7px 22px rgba(34, 42, 56, 0.045);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.tool-card:hover {
  padding: 20px;
  background: #ffffff;
  border-color: rgba(var(--accent-rgb), 0.32);
  box-shadow: 0 18px 42px rgba(34, 42, 56, 0.1);
  transform: translateY(-3px);
}

.tool-card-top {
  justify-content: space-between;
}

.tool-card-icon {
  min-width: 48px;
  min-height: 48px;
  color: #ffffff;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.28), transparent 48%), var(--accent);
  border: 0;
  border-radius: 14px;
  box-shadow: 0 8px 18px rgba(var(--accent-rgb), 0.2);
  font-size: 14px;
}

.tool-card-clock::before,
.tool-card-clock::after {
  background: #ffffff;
}

.tool-card-tag {
  padding: 5px 8px;
  color: var(--muted);
  background: var(--surface-2);
  border-radius: 999px;
  letter-spacing: 0.04em;
}

.tool-card-number {
  color: var(--accent);
}

.tool-card h3 {
  font-size: 21px;
  font-weight: 720;
}

.tool-card p {
  color: var(--muted);
  font-size: 12px;
}

.tool-card-link {
  width: 100%;
  display: flex;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 16px;
  color: var(--accent);
  border-top: 1px solid var(--line);
}

.tool-card-soon,
.tool-card-soon:hover {
  padding: 20px;
  background: rgba(255, 255, 255, 0.46);
  border-style: dashed;
  opacity: 0.72;
  transform: none;
}

.portal-manifesto,
.feature-strip {
  gap: 12px;
  margin: 56px 8px 68px;
  border: 0;
}

.portal-manifesto > div,
.feature-strip > div {
  min-height: 112px;
  padding: 24px 22px 20px 50px;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid var(--line);
  border-radius: 15px;
}

.portal-manifesto > div + div,
.feature-strip > div + div {
  border: 1px solid var(--line);
}

.portal-manifesto strong,
.feature-strip strong {
  color: var(--text);
}

.portal-manifesto span,
.feature-strip span {
  color: var(--accent);
}

.workbench,
.sql-workbench,
.markdown-workbench,
.live-time-card,
.time-converter-card {
  background: rgba(255, 255, 255, 0.94);
  border-color: var(--line-strong);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.toolbar,
.sql-toolbar,
.markdown-main-toolbar,
.panel-header,
.panel-footer,
.markdown-format-toolbar {
  background: #ffffff;
  border-color: var(--line);
}

.toolbar,
.sql-toolbar,
.markdown-main-toolbar {
  min-height: 66px;
}

.button {
  min-height: 39px;
  border-color: var(--line-strong);
  border-radius: 10px;
  box-shadow: none;
  font-size: 10px;
}

.button-primary {
  color: #ffffff;
  background: var(--accent);
  border-color: var(--accent);
}

.button-primary:hover:not(:disabled) {
  color: #ffffff;
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 8px 20px rgba(var(--accent-rgb), 0.2);
}

.button-primary kbd {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.3);
}

.button-ghost {
  color: var(--text);
  background: #ffffff;
}

.icon-button,
.output-actions button,
.sql-output-actions button,
.markdown-format-toolbar button {
  border-radius: 8px;
}

.panel-header h2,
.directory-header h2 {
  text-transform: none;
}

.panel-index {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: rgba(var(--accent-rgb), 0.22);
  border-radius: 7px;
}

.output-panel .panel-index {
  color: #ffffff;
  background: var(--accent);
  border-color: var(--accent);
}

.input-wrap,
.output-wrap,
.sql-output-wrap,
#sqlInput,
#markdownInput,
.markdown-preview {
  color: var(--text);
  background: #fbfcfd;
}

.input-panel,
.sql-input-panel,
.markdown-source-panel {
  border-color: var(--line-strong);
}

#jsonInput,
#jsonOutput,
#sqlInput,
#sqlOutput,
#markdownInput {
  color: var(--text);
  caret-color: var(--accent);
}

.line-numbers,
.output-gutter {
  color: var(--muted-2);
  background: #f3f5f7;
  border-color: var(--line);
}

.output-line:hover,
.output-line:hover .output-gutter {
  background: var(--accent-soft);
}

.error-diagnostic {
  color: #6f2730;
  background: #fff5f6;
  box-shadow: 0 14px 34px rgba(84, 29, 37, 0.12);
}

.error-diagnostic p {
  color: #8d4b53;
}

.drop-overlay {
  color: var(--accent);
  background: rgba(255, 255, 255, 0.96);
  border-radius: 14px;
}

.indent-control select,
.sql-options select,
.time-field select,
.time-field input,
.markdown-format-toolbar select {
  color: var(--text);
  background: var(--surface-2);
  border-color: var(--line);
  border-radius: 8px;
}

.wrap-switch {
  background: #e9ebef;
  border-color: var(--line-strong);
}

.markdown-preview {
  font-size: 14px;
}

.markdown-preview h1,
.markdown-preview h2,
.markdown-preview h3,
.markdown-preview h4,
.markdown-preview h5,
.markdown-preview h6 {
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.markdown-preview em,
.markdown-preview blockquote {
  color: var(--muted);
}

.markdown-preview pre {
  color: #e9edf4;
  background: #242830;
  border-color: #242830;
  border-radius: 12px;
}

.markdown-preview code {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: rgba(var(--accent-rgb), 0.16);
}

.markdown-preview pre code {
  color: inherit;
  background: transparent;
}

.markdown-preview blockquote {
  border-radius: 0 10px 10px 0;
}

.sql-token-identifier { color: #385c8d; }
.sql-token-punctuation,
.sql-token-symbol { color: #697386; }

.live-time-card code,
.time-message,
.markdown-sync-state {
  color: var(--accent);
}

.markdown-sync-state span {
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.time-results > div,
.live-time-card dl,
.live-time-card dl > div,
.time-converter-card > header {
  border-color: var(--line);
}

.site-footer {
  min-height: 88px;
  margin: 0 8px;
  color: var(--muted-2);
  border-color: var(--line);
  letter-spacing: 0.04em;
}

.footer-signature,
.footer-records {
  display: flex;
  align-items: center;
}

.footer-signature {
  gap: 14px;
}

.footer-signature span + span::before {
  margin-right: 14px;
  color: var(--line-strong);
  content: "/";
}

.footer-records {
  justify-content: flex-end;
  gap: 14px;
  letter-spacing: 0;
}

.footer-records a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 10px;
  text-decoration: none;
  transition: color 150ms ease;
}

.footer-records a:hover {
  color: var(--accent);
}

.record-shield {
  width: 18px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  color: #ffffff;
  background: var(--accent);
  border-radius: 9px 9px 11px 11px;
  font-size: 8px;
  font-weight: 800;
}

@media (max-width: 900px) {
  .site-footer,
  .footer-signature,
  .footer-records {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-footer {
    justify-content: center;
    gap: 12px;
    padding: 20px 0;
  }

  .footer-signature,
  .footer-records {
    gap: 7px;
  }

  .footer-signature span + span::before {
    display: none;
  }
}

/* Shared vertical and diagonal workspace resizing */
.workspace-size-enabled {
  position: relative;
}

.workspace-size-enabled.is-workspace-user-sized:not(:fullscreen):not(:-webkit-full-screen) {
  width: var(--workspace-user-width, 100%);
  max-width: 100%;
  height: var(--workspace-user-height);
  margin-right: auto;
  margin-left: auto;
}

.resizable-workspace.is-workspace-user-sized:not(:fullscreen):not(:-webkit-full-screen):not(.is-generic-tool-fullscreen) {
  display: flex;
  flex-direction: column;
}

.resizable-workspace.is-workspace-user-sized:not(:fullscreen):not(:-webkit-full-screen):not(.is-generic-tool-fullscreen) > .workspace-split-grid {
  height: auto !important;
  min-height: 0 !important;
  flex: 1 1 auto;
}

.resizable-workspace.is-workspace-user-sized .workspace-split-panel,
.resizable-workspace.is-workspace-user-sized .input-wrap,
.resizable-workspace.is-workspace-user-sized .output-wrap {
  min-height: 0 !important;
}

.resizable-workspace.is-workspace-user-sized .editor-panel,
.resizable-workspace.is-workspace-user-sized .sql-panel,
.resizable-workspace.is-workspace-user-sized .plantuml-panel,
.resizable-workspace.is-workspace-user-sized .mermaid-panel {
  grid-template-rows: 54px minmax(0, 1fr) 36px;
}

.resizable-workspace.is-workspace-user-sized .markdown-panel {
  grid-template-rows: auto minmax(0, 1fr) 36px;
}

.text-diff-workbench.is-workspace-user-sized:not(:fullscreen):not(:-webkit-full-screen):not(.is-tool-fullscreen) {
  display: grid;
  grid-template-rows: auto var(--text-diff-input-height, minmax(250px, 0.82fr)) 11px minmax(260px, 1.18fr) auto;
  overflow: hidden;
}

.text-diff-workbench.is-workspace-user-sized .text-diff-input-grid,
.text-diff-workbench.is-workspace-user-sized .text-diff-result {
  min-height: 0;
}

.text-diff-workbench.is-workspace-user-sized .text-diff-source-card {
  grid-template-rows: 54px minmax(0, 1fr) 36px;
}

.text-diff-workbench.is-workspace-user-sized .text-diff-result {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  overflow: hidden;
}

.text-diff-workbench.is-workspace-user-sized .text-diff-empty,
.text-diff-workbench.is-workspace-user-sized .text-diff-table-wrap,
.text-diff-workbench.is-workspace-user-sized .text-diff-csv-wrap {
  min-height: 0;
  grid-row: 3;
}

.text-diff-workbench.is-workspace-user-sized .text-diff-table-wrap,
.text-diff-workbench.is-workspace-user-sized .text-diff-csv-table-scroller {
  height: 100%;
  max-height: none;
}

.text-diff-workbench.is-workspace-user-sized .text-diff-csv-wrap:not([hidden]) {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  overflow: hidden;
}

.timestamp-workbench.is-workspace-user-sized {
  align-items: stretch;
}

.timestamp-workbench.is-workspace-user-sized .live-time-card,
.timestamp-workbench.is-workspace-user-sized .time-converters,
.timestamp-workbench.is-workspace-user-sized .time-converter-card {
  min-height: 0;
}

.timestamp-workbench.is-workspace-user-sized .live-time-card,
.timestamp-workbench.is-workspace-user-sized .time-converter-card {
  overflow: auto;
}

.timestamp-workbench.is-workspace-user-sized .time-converters {
  grid-template-rows: repeat(2, minmax(0, 1fr));
}

.workspace-height-handle {
  position: absolute;
  z-index: 35;
  right: 30px;
  bottom: 0;
  left: 18px;
  height: 13px;
  display: grid;
  place-items: end center;
  padding-bottom: 4px;
  cursor: ns-resize;
  outline: none;
  touch-action: none;
  user-select: none;
}

.workspace-height-handle > span {
  width: 54px;
  height: 3px;
  background: repeating-linear-gradient(90deg, var(--muted-2) 0 3px, transparent 3px 6px);
  border-radius: 999px;
  opacity: 0.48;
  transition: width 140ms ease, background 140ms ease, opacity 140ms ease;
}

.workspace-height-handle:hover > span,
.workspace-height-handle:focus-visible > span,
.workspace-height-handle.is-dragging > span {
  width: 84px;
  background: var(--accent);
  opacity: 1;
}

.workspace-corner-handle {
  position: absolute;
  z-index: 36;
  right: 0;
  bottom: 0;
  width: 27px;
  height: 27px;
  display: grid;
  place-items: end;
  padding: 0 5px 5px 0;
  color: var(--muted-2);
  background: linear-gradient(135deg, transparent 0 52%, var(--surface-2) 52% 100%);
  border: 0;
  border-radius: 0 0 16px;
  cursor: nwse-resize;
  touch-action: none;
  user-select: none;
}

.workspace-corner-handle > span,
.workspace-corner-handle > span::before {
  width: 10px;
  height: 1px;
  display: block;
  background: currentColor;
  content: "";
  transform: rotate(-45deg);
  transform-origin: center;
}

.workspace-corner-handle > span::before {
  width: 6px;
  transform: translate(-2px, -4px);
}

.workspace-corner-handle:hover,
.workspace-corner-handle:focus-visible,
.workspace-corner-handle.is-dragging {
  color: var(--accent);
  background: linear-gradient(135deg, transparent 0 48%, var(--accent-soft) 48% 100%);
}

body.is-workspace-height-resizing,
body.is-workspace-height-resizing * {
  cursor: ns-resize !important;
  user-select: none !important;
}

body.is-workspace-diagonal-resizing,
body.is-workspace-diagonal-resizing * {
  cursor: nwse-resize !important;
  user-select: none !important;
}

.workspace-size-enabled:fullscreen > .workspace-height-handle,
.workspace-size-enabled:fullscreen > .workspace-corner-handle,
.workspace-size-enabled:-webkit-full-screen > .workspace-height-handle,
.workspace-size-enabled:-webkit-full-screen > .workspace-corner-handle,
.workspace-size-enabled.is-generic-tool-fullscreen > .workspace-height-handle,
.workspace-size-enabled.is-generic-tool-fullscreen > .workspace-corner-handle,
.workspace-size-enabled.is-tool-fullscreen > .workspace-height-handle,
.workspace-size-enabled.is-tool-fullscreen > .workspace-corner-handle {
  display: none;
}

@media (max-width: 900px) {
  .workspace-size-enabled.is-workspace-user-sized {
    width: 100% !important;
  }

  .workspace-corner-handle {
    cursor: ns-resize;
  }

  .text-diff-workbench.is-workspace-user-sized {
    overflow: auto;
  }
}

.toast {
  color: #ffffff;
  background: #242830;
  border-color: #242830;
  border-radius: 12px;
  box-shadow: 0 18px 44px rgba(22, 28, 38, 0.2);
}

@media (max-width: 1120px) {
  .privacy-note {
    display: none;
  }

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

@media (max-width: 820px) {
  .page-shell {
    width: min(100% - 24px, 1320px);
  }

  .site-header {
    top: 6px;
    min-height: 0;
    flex-wrap: wrap;
    margin-top: 6px;
    padding: 9px;
    border-radius: 15px;
  }

  .header-right {
    width: 100%;
    flex: 1 1 100%;
  }

  .site-nav {
    min-width: 0;
    flex: 1 1 auto;
    justify-content: flex-start;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .site-nav::-webkit-scrollbar {
    display: none;
  }

  .theme-summary-label,
  .theme-config summary::after {
    display: none;
  }

  .theme-config summary {
    width: 38px;
    justify-content: center;
    padding: 0;
  }

  .hero,
  .portal-hero {
    grid-template-columns: 1fr;
    padding-right: 2px;
    padding-left: 2px;
  }

  .hero {
    gap: 18px;
  }

  .portal-hero {
    min-height: 0;
  }

  .portal-manifesto,
  .feature-strip {
    grid-template-columns: 1fr;
  }

  .tool-directory {
    padding-right: 2px;
    padding-left: 2px;
  }
}

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

  .tool-card {
    min-height: 230px;
  }

  .portal-manifesto,
  .feature-strip {
    margin-right: 2px;
    margin-left: 2px;
  }

  .theme-panel {
    position: fixed;
    top: 122px;
    right: 12px;
    left: 12px;
    width: auto;
  }
}

@media (max-width: 520px) {
  h1,
  .portal-hero h1 {
    font-size: clamp(39px, 12vw, 54px);
  }

  .portal-hero {
    padding-top: 42px;
  }

  .theme-panel {
    top: 116px;
  }
}

/* Text and CSV comparison */
.text-diff-workbench {
  display: grid;
  grid-template-rows: auto var(--text-diff-input-height, 420px) 11px minmax(430px, auto) auto;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.text-diff-toolbar {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 15px;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}

.text-diff-sync-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.text-diff-sync-state > span {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.text-diff-sync-state.is-working > span {
  animation: terminal-cursor 700ms steps(1) infinite;
}

.text-diff-sync-state.is-error {
  color: var(--red);
}

.text-diff-sync-state.is-error > span {
  background: var(--red);
  box-shadow: 0 0 0 3px var(--red-soft);
}

.text-diff-input-grid {
  display: grid;
  grid-template-columns:
    minmax(0, var(--text-diff-left-size, 1fr))
    9px
    minmax(0, var(--text-diff-right-size, 1fr));
}

.text-diff-source-card {
  position: relative;
  min-width: 0;
  display: grid;
  grid-template-rows: 54px minmax(250px, 1fr) 36px;
  overflow: hidden;
  background: #ffffff;
}

.text-diff-source-card[data-diff-side="right"] {
  border-left: 0;
}

.text-diff-splitter {
  position: relative;
  z-index: 6;
  display: grid;
  place-items: center;
  width: 9px;
  min-width: 9px;
  padding: 0;
  background: #f1f3f6;
  border-right: 1px solid var(--line);
  border-left: 1px solid var(--line);
  cursor: col-resize;
  outline: none;
  touch-action: none;
  user-select: none;
  transition: background 140ms ease, border-color 140ms ease;
}

.text-diff-splitter > span {
  width: 3px;
  height: 34px;
  background: repeating-linear-gradient(to bottom, var(--muted-2) 0 2px, transparent 2px 5px);
  border-radius: 999px;
  opacity: 0.58;
  transition: height 140ms ease, opacity 140ms ease;
}

.text-diff-splitter:hover,
.text-diff-splitter:focus-visible,
.text-diff-splitter.is-dragging {
  background: var(--accent-soft);
  border-color: rgba(var(--accent-rgb), 0.38);
}

.text-diff-splitter:hover > span,
.text-diff-splitter:focus-visible > span,
.text-diff-splitter.is-dragging > span {
  height: 52px;
  background: var(--accent);
  opacity: 1;
}

body.is-text-diff-resizing,
body.is-text-diff-resizing * {
  cursor: col-resize !important;
  user-select: none !important;
}

.text-diff-horizontal-splitter {
  position: relative;
  z-index: 7;
  display: grid;
  place-items: center;
  width: 100%;
  height: 11px;
  min-height: 11px;
  padding: 0;
  background: #f1f3f6;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line-strong);
  cursor: row-resize;
  outline: none;
  touch-action: none;
  user-select: none;
  transition: background 140ms ease, border-color 140ms ease;
}

.text-diff-horizontal-splitter > span {
  width: 46px;
  height: 3px;
  background: repeating-linear-gradient(to right, var(--muted-2) 0 3px, transparent 3px 6px);
  border-radius: 999px;
  opacity: 0.58;
  transition: width 140ms ease, opacity 140ms ease;
}

.text-diff-horizontal-splitter:hover,
.text-diff-horizontal-splitter:focus-visible,
.text-diff-horizontal-splitter.is-dragging {
  background: var(--accent-soft);
  border-color: rgba(var(--accent-rgb), 0.38);
}

.text-diff-horizontal-splitter:hover > span,
.text-diff-horizontal-splitter:focus-visible > span,
.text-diff-horizontal-splitter.is-dragging > span {
  width: 72px;
  background: var(--accent);
  opacity: 1;
}

body.is-text-diff-height-resizing,
body.is-text-diff-height-resizing * {
  cursor: row-resize !important;
  user-select: none !important;
}

.text-diff-source-card .panel-header {
  min-width: 0;
}

.text-diff-file-actions {
  min-width: 0;
  gap: 7px !important;
}

.text-diff-file-actions .panel-meta {
  max-width: 210px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.text-diff-file-actions button,
.text-diff-result-actions button,
.text-diff-footer button {
  min-height: 29px;
  padding: 0 9px;
  color: var(--muted);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}

.text-diff-file-actions button:hover,
.text-diff-result-actions button:not(:disabled):hover,
.text-diff-footer button:not(:disabled):hover {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: rgba(var(--accent-rgb), 0.3);
}

.text-diff-result-actions button:disabled,
.text-diff-footer button:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.text-diff-source-card textarea {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: block;
  padding: 20px 22px;
  overflow: auto;
  color: var(--text);
  background: #fbfcfd;
  border: 0;
  border-radius: 0;
  caret-color: var(--accent);
  font: 12px/21px "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  resize: none;
  tab-size: 4;
  white-space: pre;
}

.text-diff-source-card textarea::placeholder {
  color: var(--muted-2);
}

.text-diff-source-card textarea:focus {
  outline-offset: -3px;
}

.text-diff-source-card .panel-footer > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.text-diff-side-drop {
  position: absolute;
  z-index: 5;
  inset: 9px;
  display: grid;
  place-items: center;
  color: var(--accent);
  background: rgba(255, 255, 255, 0.96);
  border: 2px dashed rgba(var(--accent-rgb), 0.48);
  border-radius: 12px;
  font-size: 12px;
  font-weight: 750;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.985);
  transition: opacity 130ms ease, transform 130ms ease;
}

.text-diff-source-card.is-drag-over .text-diff-side-drop {
  opacity: 1;
  transform: scale(1);
}

.text-diff-result {
  min-height: 430px;
  background: #fbfcfd;
  border-top: 1px solid var(--line-strong);
}

.text-diff-result-toolbar {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 14px 9px 16px;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}

.text-diff-result-heading,
.text-diff-result-actions,
.text-diff-result-heading > div {
  display: flex;
  align-items: center;
}

.text-diff-result-heading {
  gap: 10px;
}

.text-diff-result-heading > div {
  align-items: flex-start;
  flex-direction: column;
  gap: 3px;
}

.text-diff-result-heading h2 {
  margin: 0;
  color: var(--text);
  font-size: 11px;
}

.text-diff-result-heading > div > span {
  color: var(--muted-2);
  font-size: 9px;
}

.text-diff-result-actions {
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.text-diff-view-switch {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  padding: 2px;
  background: #f0f2f5;
  border: 1px solid var(--line);
  border-radius: 9px;
}

.text-diff-view-switch button {
  min-height: 25px;
  padding: 0 8px;
  background: transparent;
  border: 0;
  border-radius: 6px;
}

.text-diff-view-switch button[aria-pressed="true"] {
  color: var(--accent);
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(31, 38, 51, 0.1);
}

.text-diff-option {
  min-height: 29px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 9px;
  font-weight: 650;
  white-space: nowrap;
  cursor: pointer;
}

.text-diff-option input {
  width: 13px;
  height: 13px;
  margin: 0;
  accent-color: var(--accent);
}

.text-diff-smart-option:has(input:checked) {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: rgba(var(--accent-rgb), 0.34);
}

.text-diff-statbar {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 17px;
  color: var(--muted);
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  font-size: 9px;
}

.text-diff-statbar span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.text-diff-statbar b {
  min-width: 20px;
  padding: 2px 5px;
  background: var(--surface-2);
  border-radius: 5px;
  font: 750 9px/1.4 "SFMono-Regular", Consolas, monospace;
  text-align: center;
}

.text-diff-statbar .is-modified { color: #a26724; }
.text-diff-statbar .is-added { color: #28785c; }
.text-diff-statbar .is-removed { color: #a84955; }

.text-diff-empty {
  min-height: 330px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
}

.text-diff-empty[hidden] {
  display: none;
}

.text-diff-empty > span {
  min-width: 76px;
  min-height: 48px;
  display: grid;
  place-items: center;
  margin-bottom: 4px;
  color: #ffffff;
  background: var(--accent);
  border-radius: 14px;
  box-shadow: 0 9px 20px rgba(var(--accent-rgb), 0.2);
  font: 800 12px/1 "SFMono-Regular", Consolas, monospace;
}

.text-diff-empty strong {
  color: var(--text);
  font-size: 12px;
}

.text-diff-empty small {
  color: var(--muted-2);
  font-size: 9px;
}

.text-diff-table-wrap {
  max-height: 580px;
  overflow: auto;
  overscroll-behavior: contain;
}

.text-diff-table-wrap[hidden] {
  display: none;
}

.text-diff-columns,
.text-diff-rows {
  min-width: 820px;
}

.text-diff-columns {
  position: sticky;
  z-index: 4;
  top: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  color: var(--muted);
  background: rgba(246, 247, 249, 0.96);
  border-bottom: 1px solid var(--line);
  font-size: 9px;
  font-weight: 700;
  backdrop-filter: blur(10px);
}

.text-diff-columns span {
  padding: 8px 14px 8px 76px;
}

.text-diff-columns span + span {
  border-left: 1px solid var(--line-strong);
}

.text-diff-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-height: 27px;
  border-bottom: 1px solid rgba(211, 215, 223, 0.56);
  scroll-margin-top: 36px;
}

.text-diff-row.is-equal:hover .text-diff-cell {
  background: var(--accent-soft);
}

.text-diff-row.is-current-change {
  position: relative;
  z-index: 1;
  box-shadow: inset 0 0 0 2px var(--accent);
}

.text-diff-cell {
  min-width: 0;
  display: grid;
  grid-template-columns: 50px 22px minmax(max-content, 1fr);
  align-items: stretch;
  color: var(--text);
  background: #ffffff;
}

.text-diff-cell + .text-diff-cell {
  border-left: 1px solid var(--line-strong);
}

.text-diff-line-number,
.text-diff-sign {
  display: flex;
  align-items: center;
  min-height: 27px;
  font: 10px/1 "SFMono-Regular", Consolas, monospace;
}

.text-diff-line-number {
  justify-content: flex-end;
  padding: 0 9px 0 5px;
  color: var(--muted-2);
  background: #f4f5f7;
  border-right: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
  user-select: none;
}

.text-diff-sign {
  justify-content: center;
  color: var(--muted-2);
  font-weight: 800;
  user-select: none;
}

.text-diff-cell code {
  min-height: 27px;
  display: block;
  padding: 4px 14px 3px 2px;
  color: inherit;
  background: transparent;
  border: 0;
  border-radius: 0;
  font: 11px/19px "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  white-space: pre;
}

.text-diff-row.is-removed .text-diff-cell-left,
.text-diff-row.is-modified .text-diff-cell-left {
  color: #6f2730;
  background: #fff3f4;
}

.text-diff-row.is-added .text-diff-cell-right,
.text-diff-row.is-modified .text-diff-cell-right {
  color: #185e48;
  background: #edf9f4;
}

.text-diff-row.is-removed .text-diff-cell-left .text-diff-line-number,
.text-diff-row.is-modified .text-diff-cell-left .text-diff-line-number {
  color: #a84955;
  background: #fbe5e8;
}

.text-diff-row.is-added .text-diff-cell-right .text-diff-line-number,
.text-diff-row.is-modified .text-diff-cell-right .text-diff-line-number {
  color: #28785c;
  background: #dff3eb;
}

.text-diff-row.is-removed .text-diff-cell-left .text-diff-sign,
.text-diff-row.is-modified .text-diff-cell-left .text-diff-sign {
  color: #b54150;
}

.text-diff-row.is-added .text-diff-cell-right .text-diff-sign,
.text-diff-row.is-modified .text-diff-cell-right .text-diff-sign {
  color: #23825e;
}

.text-diff-cell.is-empty {
  background-color: #f4f5f7;
  background-image: linear-gradient(135deg, transparent 45%, rgba(105, 115, 134, 0.06) 45%, rgba(105, 115, 134, 0.06) 55%, transparent 55%);
  background-size: 8px 8px;
}

.text-diff-cell-left mark {
  color: inherit;
  background: #ffcbd1;
  border-radius: 2px;
}

.text-diff-cell-right mark {
  color: inherit;
  background: #bcebd8;
  border-radius: 2px;
}

.text-diff-result.is-only-changes .text-diff-row.is-equal {
  display: none;
}

.text-diff-csv-wrap[hidden],
.text-diff-csv-table-scroller[hidden],
.text-diff-csv-error[hidden] {
  display: none;
}

.text-diff-csv-toolbar {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 5px 12px 5px 17px;
  color: var(--muted);
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  font-size: 9px;
}

.text-diff-csv-error {
  margin: 18px;
  padding: 13px 15px;
  color: #7d2f39;
  background: #fff3f4;
  border: 1px solid #efc4ca;
  border-left: 4px solid var(--red);
  border-radius: 10px;
  font-size: 11px;
  line-height: 1.55;
}

.text-diff-csv-table-scroller {
  max-height: 580px;
  overflow: auto;
  background: #ffffff;
  overscroll-behavior: contain;
}

.text-diff-csv-table {
  width: max-content;
  min-width: 100%;
  border-spacing: 0;
  color: var(--text);
  background: #ffffff;
  font: 11px/1.45 "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

.text-diff-csv-table th,
.text-diff-csv-table td {
  position: relative;
  min-width: 135px;
  max-width: 310px;
  padding: 8px 11px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.text-diff-csv-table thead th {
  position: sticky;
  z-index: 5;
  top: 0;
  height: 38px;
  color: var(--muted);
  background: rgba(244, 246, 248, 0.97);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 10px;
  font-weight: 750;
  white-space: nowrap;
  backdrop-filter: blur(10px);
}

.text-diff-csv-table thead th.is-added-column {
  color: #28785c;
  background: rgba(226, 246, 238, 0.97);
}

.text-diff-csv-table thead th.is-removed-column {
  color: #a84955;
  background: rgba(252, 232, 235, 0.97);
}

.text-diff-csv-table thead th.is-modified-column {
  color: #93601f;
  background: rgba(255, 244, 218, 0.97);
}

.text-diff-csv-table .text-diff-csv-version-heading,
.text-diff-csv-table .text-diff-csv-version {
  position: sticky;
  left: 0;
  min-width: 112px;
  width: 112px;
  max-width: 112px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.text-diff-csv-table .text-diff-csv-version-heading {
  z-index: 7;
}

.text-diff-csv-table .text-diff-csv-version {
  z-index: 3;
  color: var(--muted);
  background: #f7f8fa;
  font-size: 9px;
  font-weight: 650;
  white-space: nowrap;
}

.text-diff-csv-version b {
  width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  margin-right: 7px;
  color: #ffffff;
  background: var(--muted-2);
  border-radius: 6px;
  font-size: 9px;
}

.text-diff-csv-version.is-left b {
  background: #b64a58;
}

.text-diff-csv-version.is-right b {
  background: #2c8a68;
}

.text-diff-csv-row.is-left td,
.text-diff-csv-row.is-left th {
  border-bottom-style: dashed;
}

.text-diff-csv-row.is-right td,
.text-diff-csv-row.is-right th {
  border-bottom-color: var(--line-strong);
}

.text-diff-csv-table td.is-modified.is-left,
.text-diff-csv-table td.is-removed.is-left {
  color: #6f2730;
  background: #fff0f2;
  box-shadow: inset 3px 0 #cf5d6b;
}

.text-diff-csv-table td.is-modified.is-right,
.text-diff-csv-table td.is-added.is-right {
  color: #185e48;
  background: #eaf8f2;
  box-shadow: inset 3px 0 #3a9b76;
}

.text-diff-csv-table td.is-missing,
.text-diff-csv-version.is-missing {
  color: var(--muted-2);
  background-color: #f3f4f6;
  background-image: linear-gradient(135deg, transparent 45%, rgba(105, 115, 134, 0.07) 45%, rgba(105, 115, 134, 0.07) 55%, transparent 55%);
  background-size: 8px 8px;
}

.text-diff-csv-table .is-empty-value {
  color: var(--muted-2);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 9px;
  font-style: italic;
}

.text-diff-csv-quote {
  position: absolute;
  top: 3px;
  right: 4px;
  width: 13px;
  height: 13px;
  display: grid;
  place-items: center;
  color: var(--muted-2);
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(105, 115, 134, 0.18);
  border-radius: 4px;
  font-size: 8px;
  font-style: normal;
  line-height: 1;
}

.text-diff-csv-row.is-current-change > * {
  border-top: 2px solid var(--accent);
}

.text-diff-result.is-only-changes .text-diff-csv-row.is-same {
  display: none;
}

.text-diff-footer {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 8px 14px 8px 18px;
  color: var(--muted);
  background: #ffffff;
  border-top: 1px solid var(--line);
  font-size: 9px;
}

.text-diff-footer > div {
  display: flex;
  gap: 5px;
}

body.has-text-diff-fullscreen {
  overflow: hidden;
}

.text-diff-workbench:fullscreen,
.text-diff-workbench:-webkit-full-screen,
.text-diff-workbench.is-tool-fullscreen {
  width: 100vw;
  height: 100dvh;
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto var(--text-diff-input-height, minmax(230px, 0.82fr)) 11px minmax(260px, 1.18fr) auto;
  margin: 0;
  overflow: hidden;
  background: #ffffff;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.text-diff-workbench.is-tool-fullscreen {
  position: fixed;
  z-index: 1000;
  inset: 0;
}

.text-diff-workbench:fullscreen .text-diff-input-grid,
.text-diff-workbench:-webkit-full-screen .text-diff-input-grid,
.text-diff-workbench.is-tool-fullscreen .text-diff-input-grid,
.text-diff-workbench:fullscreen .text-diff-result,
.text-diff-workbench:-webkit-full-screen .text-diff-result,
.text-diff-workbench.is-tool-fullscreen .text-diff-result {
  min-height: 0;
}

.text-diff-workbench:fullscreen .text-diff-source-card,
.text-diff-workbench:-webkit-full-screen .text-diff-source-card,
.text-diff-workbench.is-tool-fullscreen .text-diff-source-card {
  grid-template-rows: 54px minmax(0, 1fr) 36px;
}

.text-diff-workbench:fullscreen .text-diff-result,
.text-diff-workbench:-webkit-full-screen .text-diff-result,
.text-diff-workbench.is-tool-fullscreen .text-diff-result {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  overflow: hidden;
}

.text-diff-workbench:fullscreen .text-diff-empty,
.text-diff-workbench:fullscreen .text-diff-table-wrap,
.text-diff-workbench:fullscreen .text-diff-csv-wrap,
.text-diff-workbench:-webkit-full-screen .text-diff-empty,
.text-diff-workbench:-webkit-full-screen .text-diff-table-wrap,
.text-diff-workbench:-webkit-full-screen .text-diff-csv-wrap,
.text-diff-workbench.is-tool-fullscreen .text-diff-empty,
.text-diff-workbench.is-tool-fullscreen .text-diff-table-wrap,
.text-diff-workbench.is-tool-fullscreen .text-diff-csv-wrap {
  min-height: 0;
  grid-row: 3;
}

.text-diff-workbench:fullscreen .text-diff-table-wrap,
.text-diff-workbench:fullscreen .text-diff-csv-table-scroller,
.text-diff-workbench:-webkit-full-screen .text-diff-table-wrap,
.text-diff-workbench:-webkit-full-screen .text-diff-csv-table-scroller,
.text-diff-workbench.is-tool-fullscreen .text-diff-table-wrap,
.text-diff-workbench.is-tool-fullscreen .text-diff-csv-table-scroller {
  height: 100%;
  max-height: none;
}

.text-diff-workbench:fullscreen .text-diff-csv-wrap:not([hidden]),
.text-diff-workbench:-webkit-full-screen .text-diff-csv-wrap:not([hidden]),
.text-diff-workbench.is-tool-fullscreen .text-diff-csv-wrap:not([hidden]) {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  overflow: hidden;
}

@media (max-width: 820px) {
  .text-diff-workbench,
  .text-diff-workbench.is-workspace-user-sized,
  .text-diff-workbench:fullscreen,
  .text-diff-workbench:-webkit-full-screen,
  .text-diff-workbench.is-tool-fullscreen {
    height: auto;
    grid-template-rows: auto auto minmax(430px, auto) auto;
    overflow: visible;
  }

  .text-diff-workbench:fullscreen,
  .text-diff-workbench:-webkit-full-screen,
  .text-diff-workbench.is-tool-fullscreen {
    height: 100dvh;
    overflow: auto;
  }

  .text-diff-input-grid {
    grid-template-columns: 1fr;
  }

  .text-diff-splitter,
  .text-diff-horizontal-splitter {
    display: none;
  }

  .text-diff-source-card[data-diff-side="right"] {
    border-top: 1px solid var(--line-strong);
    border-left: 0;
  }
}

@media (max-width: 760px) {
  .text-diff-toolbar,
  .text-diff-result-toolbar,
  .text-diff-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .text-diff-toolbar .toolbar-left,
  .text-diff-result-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .text-diff-sync-state {
    align-self: flex-end;
  }

  .text-diff-result-actions > * {
    flex: 1 1 auto;
    justify-content: center;
  }

  .text-diff-statbar {
    gap: 8px;
    justify-content: space-between;
    overflow-x: auto;
  }

  .text-diff-statbar span {
    white-space: nowrap;
  }

  .text-diff-footer > div {
    width: 100%;
  }

  .text-diff-footer button {
    flex: 1;
  }
}

@media (max-width: 540px) {
  .text-diff-source-card {
    grid-template-rows: auto minmax(240px, 310px) 36px;
  }

  .text-diff-source-card .panel-header {
    min-height: 88px;
    align-items: flex-start;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .text-diff-file-actions {
    align-items: flex-end !important;
    flex-direction: column;
  }

  .text-diff-file-actions .panel-meta {
    max-width: 170px;
  }

  .text-diff-source-card textarea {
    padding: 18px 16px;
  }
}

/* Shared resizable workspaces: JSON, Markdown, SQL, PlantUML and Mermaid */
.workspace-split-grid {
  grid-template-columns:
    minmax(0, var(--workspace-left-size, 1fr))
    9px
    minmax(0, var(--workspace-right-size, 1fr)) !important;
}

.workspace-split-panel-primary {
  border-right: 0 !important;
}

.workspace-splitter {
  position: relative;
  z-index: 8;
  display: grid;
  place-items: center;
  width: 9px;
  min-width: 9px;
  padding: 0;
  background: #f1f3f6;
  border-right: 1px solid var(--line);
  border-left: 1px solid var(--line);
  cursor: col-resize;
  outline: none;
  touch-action: none;
  user-select: none;
  transition: background 140ms ease, border-color 140ms ease;
}

.workspace-splitter > span {
  width: 3px;
  height: 34px;
  background: repeating-linear-gradient(to bottom, var(--muted-2) 0 2px, transparent 2px 5px);
  border-radius: 999px;
  opacity: 0.58;
  transition: height 140ms ease, opacity 140ms ease;
}

.workspace-splitter:hover,
.workspace-splitter:focus-visible,
.workspace-splitter.is-dragging {
  background: var(--accent-soft);
  border-color: rgba(var(--accent-rgb), 0.38);
}

.workspace-splitter:hover > span,
.workspace-splitter:focus-visible > span,
.workspace-splitter.is-dragging > span {
  height: 52px;
  background: var(--accent);
  opacity: 1;
}

.workspace-fullscreen-button[aria-pressed="true"] {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: rgba(var(--accent-rgb), 0.28);
}

body.is-generic-workspace-resizing,
body.is-generic-workspace-resizing * {
  cursor: col-resize !important;
  user-select: none !important;
}

body.has-generic-workspace-fullscreen {
  overflow: hidden;
}

.resizable-workspace:fullscreen,
.resizable-workspace:-webkit-full-screen,
.resizable-workspace.is-generic-tool-fullscreen {
  width: 100vw;
  height: 100dvh;
  min-height: 100vh;
  display: flex !important;
  flex-direction: column;
  margin: 0;
  overflow: hidden;
  background: #ffffff;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.resizable-workspace.is-generic-tool-fullscreen {
  position: fixed;
  z-index: 1000;
  inset: 0;
}

.resizable-workspace:fullscreen > .workspace-split-grid,
.resizable-workspace:-webkit-full-screen > .workspace-split-grid,
.resizable-workspace.is-generic-tool-fullscreen > .workspace-split-grid {
  width: 100%;
  height: auto !important;
  min-height: 0 !important;
  flex: 1 1 auto;
}

.resizable-workspace:fullscreen .workspace-split-panel,
.resizable-workspace:-webkit-full-screen .workspace-split-panel,
.resizable-workspace.is-generic-tool-fullscreen .workspace-split-panel {
  min-height: 0 !important;
}

.resizable-workspace:fullscreen .editor-panel,
.resizable-workspace:-webkit-full-screen .editor-panel,
.resizable-workspace.is-generic-tool-fullscreen .editor-panel {
  grid-template-rows: 54px minmax(0, 1fr) 36px;
}

.resizable-workspace:fullscreen .markdown-panel,
.resizable-workspace:-webkit-full-screen .markdown-panel,
.resizable-workspace.is-generic-tool-fullscreen .markdown-panel {
  grid-template-rows: auto minmax(0, 1fr) 36px;
}

@media (max-width: 900px) {
  .workspace-split-grid {
    grid-template-columns: 1fr !important;
  }

  .workspace-splitter {
    display: none;
  }

  .workspace-split-panel-secondary {
    border-top: 1px solid var(--line-strong);
    border-left: 0 !important;
  }

  .resizable-workspace:fullscreen > .workspace-split-grid,
  .resizable-workspace:-webkit-full-screen > .workspace-split-grid,
  .resizable-workspace.is-generic-tool-fullscreen > .workspace-split-grid {
    overflow: auto;
  }
}
