* {
  box-sizing: border-box;
}

:root {
  color-scheme: dark;
  --bg: #111;
  --panel: #161616;
  --panel-hover: #191919;
  --input: #131313;
  --border: #2a2a2a;
  --border-light: #333;
  --text: #ddd;
  --muted: #888;
  --faint: #666;
  --white: #fff;
  --accent: #7aa2f7;
  --danger: #f7768e;
  --success: #9ece6a;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.6;
}

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

button {
  color: inherit;
}

.container {
  width: 90%;
  max-width: 760px;
  margin: 60px auto;
}

.hero {
  margin-bottom: 42px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--faint);
  font-size: 13px;
  font-family: Consolas, "Courier New", monospace;
}

h1 {
  color: var(--white);
  font-size: 32px;
  line-height: 1.2;
  margin: 0 0 8px;
}

h2 {
  color: var(--white);
  font-size: 20px;
  margin-top: 38px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 6px;
}

h3 {
  color: var(--white);
  font-size: 15px;
  margin: 18px 0 8px;
}

p {
  color: #aaa;
}

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

a:hover {
  text-decoration: underline;
}

code {
  background: #1b1b1b;
  border: 1px solid #2b2b2b;
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--text);
  font-family: Consolas, "Courier New", monospace;
}

.search,
input[type="text"],
input[type="number"],
input[type="datetime-local"],
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--input);
  color: var(--text);
  outline: none;
  padding: 10px 12px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.search {
  margin-top: 18px;
}

input:focus,
textarea:focus,
select:focus {
  border-color: #444;
  background: #151515;
}

textarea {
  min-height: 150px;
  resize: vertical;
  font-family: Consolas, "Courier New", monospace;
  line-height: 1.5;
}

select {
  cursor: pointer;
}

.tool-list {
  border-top: 1px solid var(--border);
}

.tool {
  border-bottom: 1px solid var(--border);
}

.tool[hidden] {
  display: none;
}

.tool-header {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 17px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-align: left;
  cursor: pointer;
}

.tool-header:hover strong {
  color: var(--accent);
}

.tool-header strong {
  display: block;
  color: var(--white);
  font-size: 16px;
  font-weight: 600;
  transition: color 0.15s ease;
}

.tool-header small {
  display: block;
  color: var(--muted);
  font-size: 14px;
  margin-top: 2px;
}

.toggle {
  color: var(--faint);
  font-family: Consolas, "Courier New", monospace;
  font-size: 20px;
  margin-left: 20px;
}

.tool-body {
  display: none;
  padding: 2px 0 20px;
}

.tool.open .tool-body {
  display: block;
}

.tool.open .toggle {
  color: var(--accent);
}

label {
  display: block;
  margin: 14px 0 6px;
  color: #aaa;
  font-size: 13px;
}

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.actions button {
  border: 1px solid #3a3a3a;
  background: #202020;
  color: var(--text);
  border-radius: 5px;
  padding: 7px 12px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.actions button:hover {
  background: #272727;
  border-color: #484848;
}

.actions button.secondary {
  background: transparent;
  color: var(--muted);
}

.status {
  min-height: 24px;
  margin: 9px 0 0;
  font-size: 13px;
}

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

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

.inline-fields {
  display: grid;
  grid-template-columns: 120px 1fr;
  align-items: end;
  gap: 14px;
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  margin: 0;
  cursor: pointer;
}

.check input {
  width: auto;
}

.result {
  margin-top: 14px;
  border: 1px solid var(--border);
  background: #141414;
  border-radius: 6px;
  padding: 12px;
  overflow-wrap: anywhere;
}

.result.muted,
.muted {
  color: var(--muted);
}

.result div {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 6px 0;
}

.result span {
  width: 45px;
  color: var(--faint);
  font-size: 12px;
}

.color-row {
  display: grid;
  grid-template-columns: 1fr 46px;
  gap: 8px;
}

input[type="color"] {
  width: 46px;
  height: 43px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px;
  background: var(--input);
  cursor: pointer;
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.markdown-preview {
  min-height: 150px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #141414;
  padding: 10px 12px;
  overflow-wrap: anywhere;
}

.markdown-preview h1,
.markdown-preview h2,
.markdown-preview h3 {
  border: 0;
  margin: 0.7em 0 0.35em;
  padding: 0;
  line-height: 1.3;
}

.markdown-preview h1 {
  font-size: 23px;
}

.markdown-preview h2 {
  font-size: 19px;
}

.markdown-preview h3 {
  font-size: 16px;
}

.markdown-preview p {
  margin: 0.6em 0;
  color: #bbb;
}

.markdown-preview pre {
  overflow-x: auto;
  background: #0f0f0f;
  border: 1px solid var(--border);
  padding: 10px;
  border-radius: 5px;
}

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

.markdown-preview ul {
  padding-left: 22px;
}

.about p {
  margin-bottom: 8px;
}

.empty {
  color: var(--faint);
  padding: 12px 0;
  display: none;
}

/* Live Updates */

.live-panel {
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 8px;
  padding: 16px 18px 20px;
}

.live-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.live-sub {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.secondary-btn {
  border: 1px solid #3a3a3a;
  background: #202020;
  color: var(--text);
  border-radius: 5px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.secondary-btn:hover {
  background: #272727;
  border-color: #484848;
}

.live-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 16px;
}

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

.live-label {
  display: block;
  color: var(--faint);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.live-value {
  font-size: 14px;
  color: var(--text);
  overflow-wrap: anywhere;
}

.live-value a {
  color: var(--accent);
}

.live-history-title {
  border: 0;
}

.live-history {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.live-history li {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.live-history li:last-child {
  border-bottom: 0;
}

.live-commit-msg {
  color: var(--text);
}

.live-commit-meta {
  color: var(--faint);
  font-size: 12px;
  white-space: nowrap;
}

footer {
  margin-top: 50px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  color: var(--faint);
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

@media (max-width: 650px) {
  .container {
    margin: 38px auto;
  }

  h1 {
    font-size: 28px;
  }

  .split,
  .inline-fields {
    grid-template-columns: 1fr;
  }

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

  .live-history li {
    flex-direction: column;
    gap: 2px;
  }

  .check {
    min-height: auto;
    margin-top: 2px;
  }

  footer {
    flex-direction: column;
    gap: 4px;
  }
}
