:root {
  color-scheme: dark;
  --bg: #0d1117;
  --panel: #151b23;
  --panel-2: #1b2330;
  --border: #2a3442;
  --text: #e6edf3;
  --muted: #8b98a8;
  --accent: #6ea8fe;
  --accent-2: #3fb950;
  --danger: #f85149;
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

body { padding: 10px; }

.panel { max-width: 520px; margin: 0 auto; }

.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 4px 14px;
}

.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }

.logo {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(145deg, #2f81f7, #6ea8fe);
  color: #06121f;
  font-size: 22px;
  font-weight: 800;
  box-shadow: 0 6px 18px rgba(47, 129, 247, .25);
}

h1 { margin: 0; font-size: 17px; letter-spacing: .2px; }
.hero p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }

.pill {
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 11px;
  color: var(--muted);
  background: var(--panel);
}

.pill.ok { color: #7ee787; border-color: rgba(63, 185, 80, .35); }
.pill.err { color: #ff7b72; border-color: rgba(248, 81, 73, .35); }

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

h2 { margin: 0 0 11px; font-size: 12px; text-transform: uppercase; letter-spacing: .7px; color: var(--muted); }

.hint { margin: -4px 0 10px; color: var(--muted); font-size: 12px; }

.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.actions.three { grid-template-columns: repeat(3, 1fr); }

.action {
  appearance: none;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .05s;
}

.action:hover { border-color: #3d4c61; background: #202a39; }
.action:active { transform: translateY(1px); }
.action:disabled { opacity: .45; cursor: default; }
.action .icon { font-size: 16px; }
.action.compact { justify-content: center; min-height: 38px; padding: 7px 6px; font-size: 12px; }

.row { display: flex; gap: 8px; }
input {
  min-width: 0;
  flex: 1;
  height: 40px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
  outline: none;
}
input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(110, 168, 254, .12); }

button.primary {
  height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 9px;
  background: var(--accent);
  color: #06121f;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
button.primary:hover { background: #85b6ff; }
button.primary:disabled { opacity: .45; cursor: default; }

.links { display: flex; flex-wrap: wrap; gap: 6px; }
.links a {
  color: var(--text);
  text-decoration: none;
  border: 1px solid var(--border);
  background: var(--panel-2);
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
}
.links a:hover { border-color: var(--accent); color: var(--accent); }

.result-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.result-head h2 { margin-bottom: 8px; }
.result {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 320px;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #0b1016;
  font: 12px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace;
}
.muted { color: var(--muted); }
.result a { color: var(--accent); }

.ghost {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  border-radius: 8px;
  width: 30px;
  height: 28px;
  cursor: pointer;
}
.ghost:hover { color: var(--text); border-color: #3d4c61; }

footer { padding: 2px 4px 8px; color: #5d6b7c; font-size: 11px; text-align: center; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  padding: 9px 13px;
  border-radius: 9px;
  background: #202a39;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 12px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, .35);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s;
  z-index: 10;
}
.toast.show { opacity: 1; }

@media (max-width: 360px) {
  .actions.three { grid-template-columns: 1fr; }
}
