:root {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    color: #18202a;
    background: #f5f7fa;
}
* {
    box-sizing: border-box;
}
html,
body {
    margin: 0;
    height: 100%;
}
.app {
    max-width: 1500px;
    margin: auto;
    padding: 18px;
    display: flex;
    flex-direction: column;
}
header {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    flex-wrap: wrap;
}
h1 {
    font-size: 20px;
    margin: 0;
}
header img {
  height: 24px;
  padding-right: 10px;
}
button,
select,
input {
    font: inherit;
    border: 1px solid #cbd3dc;
    background: white;
    border-radius: 6px;
    padding: 7px 9px;
}
button {
    cursor: pointer;
}
.toolbar {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
}
.toolbar button.active {
    font-weight: 700;
}
.layout {
    display: grid;
    grid-template-columns: minmax(400px, 1fr) minmax(700px, 1.8fr);
    gap: 14px;
    flex: 1;
    height: 500px;
}
.panel {
    background: white;
    border: 1px solid #d8dee6;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 500px;
}
.bar {
    padding: 10px 12px;
    border-bottom: 1px solid #e1e6ec;
    font-weight: 700;
}
.controls {
    display: grid;
    gap: 4px;
    margin: 4px;
}
.controls input {
    flex: 1;
    min-width: 260px;
}
.api-key-label {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 220px;
    font-size: 12px;
    color: #65707d;
}
.api-key-label input {
    flex: 1;
    min-width: 140px;
    font-family: inherit;
}
textarea {
    width: 100%;
    flex: 1;
    min-height: 0;
    border: 0;
    padding: 12px;
    resize: none;
    font: 13px/1.45 inherit;
    outline: 0;
}
pre {
    margin: 0;
    padding: 12px;
    white-space: pre-wrap;
    overflow: auto;
    font-size: 12px;
    line-height: 1.45;
    flex: 1;
    min-height: 0;
}
.meta {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: #d8dee6;
    border-bottom: 1px solid #d8dee6;
}
.meta div {
    background: #fafbfd;
    padding: 9px;
}
.meta b {
    display: block;
    font-size: 11px;
    color: #65707d;
    margin-bottom: 4px;
}
.copied,
.status-ok {
    color: #16743b;
}
.status-bad {
    color: #a51d2d;
}
.tabs {
    display: flex;
    gap: 5px;
    padding: 8px;
    border-bottom: 1px solid #e1e6ec;
}
.tabs button {
    background: #f5f7fa;
}
.tabs button.sel {
    background: #e8edf3;
    font-weight: 700;
}
/* the visible tab content fills the rest of the panel; scrolling happens
   inside it (pre/.table-wrap), not the page */
.tabpanel:not([hidden]) {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.chart {
    padding: 12px;
    flex: 1;
    min-height: 0;
    display: flex;
}
.chart svg {
    width: 100%;
    height: 100%;
    background: #fbfcfd;
    border: 1px solid #e1e6ec;
}
.gridline {
    stroke: #dce2e8;
}
.curve-line {
    fill: none;
    stroke: #1f6feb;
    stroke-width: 2;
}
.curve-bid,
.curve-ask {
    fill: none;
    stroke-width: 1.5;
    stroke-dasharray: 5 3;
}
.curve-bid {
    stroke: #16743b;
}
.curve-ask {
    stroke: #a51d2d;
}
.point {
    fill: transparent;
}
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}
th,
td {
    padding: 7px 8px;
    border-bottom: 1px solid #e4e8ed;
    text-align: left;
    white-space: nowrap;
}
th {
    background: #f7f8fa;
    position: sticky;
    top: 0;
}
.table-wrap {
    flex: 1;
    min-height: 0;
    overflow: auto;
}
.small {
    font-size: 11px;
    color: #66717e;
}
.method {
    font-weight: 700;
}
.endpoint {
    color: #53606d;
}
@media (max-width: 1000px) {
    .layout {
        grid-template-columns: 1fr;
    }
    .meta {
        grid-template-columns: repeat(2, 1fr);
    }
}
.pre-toolbar {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
    padding: 6px 10px;
    border-bottom: 1px solid #e1e6ec;
    background: #fafbfd;
}
.pre-toolbar button {
    padding: 4px 8px;
    font-size: 11px;
}
/* debug tab — mirrors the colored crate's red/green/yellow terminal output */
.tok-red {
    color: #a51d2d;
    font-weight: 700;
}
.tok-green {
    color: #16743b;
    font-weight: 700;
}
.tok-yellow {
    color: #9a7d0a;
    font-weight: 700;
}
.blk {
    color: #dce2e8;
}
.blk.on.redundant {
    color: #a51d2d;
}
.blk.on.retained {
    color: #16743b;
}
.blk.on.synthetic {
    color: #9a7d0a;
}
#debug {
    font-size: 12px;
}
