:root {
  --bg: #ffffff;
  --panel: #f6f7f9;
  --fg: #1f2328;
  --muted: #656d76;
  --line: #d8dee4;
  --accent: #2f6fdd;
  --accent-fg: #ffffff;
  --ok: #1a7f37;
  --warn: #9a6700;
  --err: #cf222e;
  --err-bg: #ffebe9;
  --add-bg: #dafbe1;
  --add-word: #aceebb;
  --del-bg: #ffebe9;
  --del-word: #ffc1ba;
  --chip: #eef1f5;
  --active: #e7eefc;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1216;
    --panel: #161b22;
    --fg: #e6edf3;
    --muted: #8d96a0;
    --line: #30363d;
    --accent: #4c8dff;
    --chip: #21262d;
    --active: #1c2a44;
    --err-bg: #3a1618;
    --ok: #3fb950;
    --warn: #d29922;
    --err: #f85149;
    --add-bg: #12261e;
    --add-word: #1f5a35;
    --del-bg: #2d1416;
    --del-word: #6e2a2d;
    color-scheme: dark;
  }
}
* {
  box-sizing: border-box;
}
/* the hidden attribute must win over every display rule below */
[hidden] {
  /* biome-ignore lint/complexity/noImportantStyles: deliberate, see above */
  display: none !important;
}
html,
body,
#root {
  height: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font:
    14px / 1.45 system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    Helvetica,
    Arial,
    sans-serif;
}
h1,
h2 {
  margin: 0;
  font-size: 18px;
}
p {
  margin: 0;
}
a {
  color: var(--accent);
}
input,
select,
textarea,
button {
  font: inherit;
  color: inherit;
}
input:not([type="checkbox"]),
select,
textarea {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
}
input:disabled,
textarea:read-only {
  color: var(--muted);
}
button {
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  cursor: pointer;
}
button:disabled {
  cursor: default;
  opacity: 0.6;
}
button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-fg);
}
button.ghost {
  border-color: transparent;
  background: transparent;
}
button.ghost:hover {
  background: var(--panel);
}
button.danger {
  color: var(--err);
}
button.small {
  padding: 2px 8px;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 12px;
}
.block {
  display: block;
}
.error {
  color: var(--err);
}
.grow {
  flex: 1;
}
.chip {
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--chip);
  font-size: 12px;
  white-space: nowrap;
}
.chip.ok {
  color: var(--ok);
}
.chip.warn {
  color: var(--warn);
}
.note {
  padding: 8px 12px;
  border-radius: 6px;
  background: var(--panel);
}

.login {
  display: grid;
  place-items: center;
  height: 100%;
  padding: 16px;
}
.card {
  display: grid;
  gap: 12px;
  width: min(360px, 100%);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.shell {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--line);
}
.top select {
  width: auto;
}
.body {
  display: flex;
  flex: 1;
  min-height: 0;
}
.side {
  flex: 0 0 240px;
  overflow: auto;
  padding: 12px 8px;
  border-right: 1px solid var(--line);
  background: var(--panel);
}
.side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px 8px;
}
.side nav {
  display: grid;
  gap: 2px;
}
.item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border-color: transparent;
  background: transparent;
  text-align: left;
}
.side .item {
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
}
.item:hover {
  background: var(--chip);
}
.item.active {
  background: var(--active);
}
.main {
  flex: 1;
  min-width: 0;
  overflow: auto;
}
.empty {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 64px 24px;
  text-align: center;
}

.page {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 820px;
  padding: 20px 24px;
}
.page.wide {
  max-width: none;
  height: 100%;
  gap: 12px;
  padding: 12px 16px;
}
.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.label-input {
  /* biome-ignore lint/complexity/noImportantStyles: wins over the generic input width */
  width: 130px !important;
}
.versions {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.form {
  display: grid;
  gap: 12px;
  max-width: 560px;
  padding: 20px 24px;
}
.form label,
.settings label,
.editor > label {
  display: grid;
  gap: 4px;
}

.split {
  display: grid;
  flex: 1;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  min-height: 0;
}
.editor,
.result {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}
.settings {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px 16px;
}
.settings label.check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
}
.tab {
  position: relative;
  margin-bottom: -1px;
  border-color: transparent;
  border-radius: 6px 6px 0 0;
  background: transparent;
}
.tab.active {
  border-color: var(--line);
  border-bottom-color: var(--bg);
  background: var(--bg);
  font-weight: 600;
}
.dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-left: 6px;
  border-radius: 50%;
  background: var(--warn);
  vertical-align: middle;
}
textarea.code {
  flex: 1;
  min-height: 240px;
  font: 13px / 1.5 var(--mono);
  resize: none;
}
.pane {
  flex: 1;
  min-height: 240px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
}
.pane iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}
.diff {
  padding: 10px 12px;
  font: 13px / 1.5 var(--mono);
}
.diff p {
  margin-bottom: 8px;
  font-family: system-ui, sans-serif;
}
.line {
  padding: 1px 6px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.line.add {
  background: var(--add-bg);
}
.line.del {
  background: var(--del-bg);
}
.line.add .word {
  background: var(--add-word);
}
.line.del .word {
  background: var(--del-word);
}
.fold {
  padding: 2px 6px;
  color: var(--muted);
  font-size: 12px;
}

dialog {
  width: min(480px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--fg);
}
dialog::backdrop {
  background: rgb(0 0 0 / 40%);
}
dialog ul {
  display: grid;
  gap: 4px;
  margin: 0;
  padding-left: 18px;
}
.strong {
  color: var(--err);
  font-weight: 600;
}

#toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  max-width: 420px;
  padding: 8px 12px;
  border-radius: 6px;
  background: var(--fg);
  color: var(--bg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}
#toast.show {
  opacity: 1;
}
#toast.err {
  background: var(--err);
  color: #fff;
}

@media (max-width: 820px) {
  .body {
    flex-direction: column;
  }
  .side {
    flex: none;
    max-height: 30vh;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .split,
  .settings {
    grid-template-columns: minmax(0, 1fr);
  }
}

fieldset.plain {
  border: 0;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 16px;
  align-items: center;
}

fieldset.plain legend {
  float: left;
  margin-right: 8px;
}

fieldset.plain label.check {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
}
