:root {
  --bg: #ffffff;
  --fg: #111111;
  --muted: #5a5a5a;
  --line: #d8d8d8;
  --faint: #f6f7f8;
  --accent: #1d4e89;
  --err: #961e1e;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
  line-height: 1.45;
}

body {
  display: flex;
  flex-direction: column;
}

.hidden { display: none !important; }
.muted { color: var(--muted); }
.error { color: var(--err); }
.spacer { flex: 1; }

.bar {
  border-bottom: 1px solid var(--line);
  padding: 8px 14px 0;
}

.bar-top {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 6px;
}

.brand { font-weight: 700; }
.sep { color: var(--muted); }
.hint { color: var(--muted); border: 1px solid var(--line); padding: 1px 5px; font-size: 11px; }

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}

.tab {
  font: inherit;
  background: transparent;
  color: var(--muted);
  border: 1px solid transparent;
  border-bottom: none;
  padding: 4px 10px;
  cursor: pointer;
}

.tab:hover { color: var(--fg); }
.tab.active {
  color: var(--fg);
  border-color: var(--line);
  background: var(--bg);
  font-weight: 700;
}

.workspace {
  flex: 1;
  overflow: auto;
  padding: 14px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.status-line {
  min-height: 18px;
  margin-bottom: 8px;
}

.btn {
  font: inherit;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--fg);
  padding: 3px 9px;
  text-decoration: none;
  cursor: pointer;
}

.btn:hover:not(:disabled) { background: var(--faint); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

input, select, textarea {
  font: inherit;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 3px 6px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

th, td {
  text-align: left;
  padding: 4px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  font-weight: 700;
  border-bottom: 1px solid var(--fg);
}

td.num, th.num { text-align: right; }

.composer {
  margin-top: 14px;
  border: 1px solid var(--fg);
  padding: 10px;
}

.composer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.composer textarea { width: 100%; margin-bottom: 8px; }
.composer-actions { display: flex; gap: 8px; }

.pre-box {
  margin: 8px 0 0;
  padding: 8px;
  background: var(--faint);
  border: 1px solid var(--line);
  overflow-x: auto;
  white-space: pre-wrap;
}

.prompt-bar {
  border-top: 1px solid var(--fg);
  padding: 6px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
}

.prompt-prefix { font-weight: 700; white-space: nowrap; }
#prompt { flex: 1; border: none; outline: none; padding: 2px 0; }
