:root {
  color-scheme: light;
  --bg: #f6f7f4;
  --ink: #1d2421;
  --muted: #65706a;
  --line: #d7ddd5;
  --panel: #ffffff;
  --accent: #176b5d;
  --danger: #b43f2f;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar div { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.topbar span, p, label { color: var(--muted); }
main { max-width: 1180px; margin: 0 auto; padding: 24px; }
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  margin-bottom: 18px;
}
h1, h2 { margin: 0 0 14px; letter-spacing: 0; }
h1 { font-size: 28px; }
h2 { font-size: 18px; }
.grid { display: grid; gap: 18px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
form { display: grid; gap: 10px; }
.inline { display: flex; margin-top: 12px; }
input, select, textarea, button {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  font: inherit;
  background: #fff;
  min-height: 42px;
}
textarea { resize: vertical; min-height: 84px; }
button {
  cursor: pointer;
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  font-weight: 650;
}
button.ghost, .tabs button {
  background: transparent;
  color: var(--ink);
}
.tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-bottom: 18px;
}
.tabs button { border-color: var(--line); white-space: nowrap; }
.tabs button.active { border-color: var(--accent); color: var(--accent); }
.tab, .hidden { display: none; }
.tab.active { display: block; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; }
.actions button { width: auto; }
fieldset {
  border: 1px solid var(--line);
  border-radius: 6px;
  display: grid;
  gap: 8px;
}
fieldset label { display: flex; align-items: center; gap: 8px; }
fieldset input, label input { width: auto; min-height: auto; }
pre {
  white-space: pre-wrap;
  overflow: auto;
  background: #17211e;
  color: #eef7f3;
  border-radius: 8px;
  padding: 14px;
  min-height: 54px;
}
.handover {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
#toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  max-width: min(420px, calc(100vw - 32px));
  background: var(--ink);
  color: #fff;
  padding: 12px 14px;
  border-radius: 8px;
  opacity: 0;
  transform: translateY(8px);
  transition: 160ms ease;
}
#toast.show { opacity: 1; transform: translateY(0); }
@media (max-width: 760px) {
  main { padding: 14px; }
  .grid.two { grid-template-columns: 1fr; }
  .inline { display: grid; }
}
