/* Appraiser: one hand-written stylesheet. Dark, warm, a little engraved. */
:root {
  --bg: #0d0b09;
  --panel: #16120e;
  --panel2: #1d1812;
  --line: #3a2f22;
  --line2: #2a2219;
  --text: #e4d8c2;
  --muted: #8f8170;
  --gold: #c8a35a;
  --gold2: #e8c77e;
  --good: #7fb069;
  --bad: #d0614f;
  --warn: #d8a443;
  --blue: #7a9cc6;
  --serif: "Fontin SmallCaps", "Fontin", Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 var(--sans); }
body { background: radial-gradient(1200px 600px at 70% -10%, #2a1f12 0%, transparent 60%), var(--bg); min-height: 100vh; }
a { color: var(--gold2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2 { font-family: var(--serif); font-weight: normal; letter-spacing: .02em; margin: 0; }
h1 { font-size: 26px; color: var(--gold2); }
h2 { font-size: 17px; color: var(--gold); margin-bottom: .6em; }
code { background: var(--panel2); padding: 0 .3em; border-radius: 3px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.strong { font-weight: 600; }

/* shell */
.shell { display: grid; grid-template-columns: 200px 1fr; min-height: 100vh; }
.side { display: flex; flex-direction: column; gap: 2px; padding: 18px 12px; border-right: 1px solid var(--line2);
  background: linear-gradient(180deg, #15110c, #0f0c09); position: sticky; top: 0; height: 100vh; }
.side a, .side .soon { padding: 7px 10px; border-radius: 4px; color: var(--text); font-family: var(--serif); font-size: 15px; }
.side a:hover { background: var(--panel2); text-decoration: none; }
.side a.on { background: var(--panel2); color: var(--gold2); box-shadow: inset 2px 0 0 var(--gold); }
.side .soon { color: #5d5245; cursor: default; }
.side .soon::after { content: " · soon"; font-size: 11px; font-family: var(--sans); }
.brand { font-size: 19px !important; color: var(--gold2) !important; margin-bottom: 14px; }
.glyph { color: var(--gold); }
.who { margin-top: auto; display: flex; flex-direction: column; gap: 2px; padding: 10px; border-top: 1px solid var(--line2); }
main { padding: 14px 28px 40px; max-width: 1280px; }
main.bare { display: grid; place-items: center; min-height: 100vh; padding: 0; margin: 0 auto; }

/* status bar */
.status { display: flex; align-items: center; gap: 10px; justify-content: flex-end; min-height: 30px; margin-bottom: 8px; flex-wrap: wrap; }
.budget { display: inline-flex; align-items: center; gap: 6px; }
.label { font-family: var(--serif); text-transform: uppercase; letter-spacing: .12em; font-size: 11px; color: var(--muted); }
.meter { width: 90px; height: 6px; background: var(--panel2); border: 1px solid var(--line); border-radius: 3px; overflow: hidden; display: inline-block; }
.meter span { display: block; height: 100%; background: linear-gradient(90deg, #8a6d35, var(--gold)); }
.meter span.hot { background: var(--bad); }
.pill { display: inline-block; padding: 2px 9px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel2); font-size: 12px; }
.pill.good { border-color: #3f5a33; color: var(--good); }
.pill.bad { border-color: #6b3128; color: #f0a597; }
.pill.warn { border-color: #6d5422; color: var(--warn); }
.pill.busy { border-color: #3b4d66; color: var(--blue); }
.spin { display: inline-block; width: 9px; height: 9px; border: 2px solid var(--blue); border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -1px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* layout */
.head { display: flex; align-items: center; gap: 14px; margin: 4px 0 16px; }
.head .primary { margin-left: auto; }
.card { background: linear-gradient(180deg, var(--panel), #130f0b); border: 1px solid var(--line); border-radius: 6px; padding: 16px 18px; margin-bottom: 16px;
  box-shadow: inset 0 1px 0 rgba(255, 230, 180, .04), 0 2px 10px rgba(0,0,0,.35); }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.card.empty { text-align: center; padding: 40px; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.cols > .card { margin-bottom: 0; }
@media (max-width: 960px) { .cols { grid-template-columns: 1fr; } .shell { grid-template-columns: 1fr; } .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; } .who { margin: 0; border: 0; flex-direction: row; } }

/* tiles */
.tiles { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px;
  box-shadow: inset 0 1px 0 rgba(255, 230, 180, .05); }
.tile .value { font-family: var(--serif); font-size: 24px; color: var(--text); }
.tile.big .value { font-size: 34px; color: var(--gold2); text-shadow: 0 1px 0 #000, 0 0 18px rgba(200, 163, 90, .25); }
.tile .sub { color: var(--muted); font-size: 12px; }
.up { color: var(--good) !important; }
.down { color: var(--bad) !important; }
@media (max-width: 960px) { .tiles { grid-template-columns: 1fr 1fr; } }

/* chart */
.plot { width: 100%; height: 200px; display: block; border-bottom: 1px solid var(--line2); }
.axis { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 4px; }
.tabs-inline a { margin-left: 10px; color: var(--muted); }
.tabs-inline a.on { color: var(--gold2); }

/* tables */
table.grid { width: 100%; border-collapse: collapse; }
.grid th { text-align: left; font-family: var(--serif); font-weight: normal; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-size: 11px;
  padding: 6px 8px; border-bottom: 1px solid var(--line); }
.grid th a { color: var(--muted); cursor: pointer; }
.grid th a.on { color: var(--gold2); }
.grid td { padding: 5px 8px; border-bottom: 1px solid var(--line2); vertical-align: middle; }
.grid tbody tr:hover { background: rgba(200, 163, 90, .05); }
.grid tfoot td { border-bottom: 0; padding-top: 10px; color: var(--muted); }
.grid.compact td, .grid.compact th { padding: 4px 6px; font-size: 12px; }
.grid .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.grid td.icon { width: 34px; padding: 2px 4px; }
.grid td.icon img { max-width: 30px; max-height: 30px; display: block; margin: auto; }
tr.unpriced td { color: var(--muted); }
.rule { display: inline-block; margin-right: 10px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.conf { font-size: 11px; padding: 1px 7px; border-radius: 9px; border: 1px solid var(--line); }
.conf.high { color: var(--good); border-color: #3f5a33; }
.conf.medium { color: var(--warn); border-color: #6d5422; }
.conf.low { color: #f0a597; border-color: #6b3128; }
.tag { font-size: 11px; padding: 0 5px; border-radius: 3px; }
.tag.corrupt { color: #e06c5f; border: 1px solid #6b3128; }

/* bars */
.bars { list-style: none; padding: 0; margin: 0; }
.bars li { display: grid; grid-template-columns: 90px 1fr 90px; gap: 10px; align-items: center; padding: 4px 0; }
.bars .k { text-transform: capitalize; }
.bars .bar { height: 8px; background: var(--panel2); border-radius: 4px; overflow: hidden; }
.bars .bar span { display: block; height: 100%; background: linear-gradient(90deg, #8a6d35, var(--gold)); }
.bars .v { text-align: right; font-variant-numeric: tabular-nums; }

/* stash */
.stash { display: grid; grid-template-columns: 210px 1fr; gap: 16px; align-items: start; }
.tablist { display: flex; flex-direction: column; gap: 1px; position: sticky; top: 10px; }
.tablist a { display: flex; align-items: center; gap: 7px; padding: 6px 9px; border-radius: 4px; color: var(--text); }
.tablist a .muted { margin-left: auto; font-size: 12px; }
.tablist a:hover { background: var(--panel2); text-decoration: none; }
.tablist a.on { background: var(--panel2); box-shadow: inset 2px 0 0 var(--gold); color: var(--gold2); }
.swatch { width: 9px; height: 9px; border-radius: 2px; display: inline-block; flex: none; border: 1px solid rgba(0,0,0,.5); }
.filters { margin-bottom: 8px; color: var(--muted); }
@media (max-width: 960px) { .stash { grid-template-columns: 1fr; } .tablist { position: static; flex-direction: row; flex-wrap: wrap; } }

/* forms */
input, select, button { font: inherit; color: var(--text); }
input:not([type=checkbox]):not([type=range]), select { background: #0f0c09; border: 1px solid var(--line); border-radius: 4px; padding: 6px 9px; min-width: 0; }
input:focus, select:focus { outline: 1px solid var(--gold); border-color: var(--gold); }
input.narrow { width: 90px; }
button { background: linear-gradient(180deg, #3a2d1b, #261d12); border: 1px solid #5c4628; border-radius: 4px; padding: 6px 14px; cursor: pointer; color: var(--gold2);
  font-family: var(--serif); letter-spacing: .03em; }
button:hover { border-color: var(--gold); }
button.primary { background: linear-gradient(180deg, #6b5226, #43321a); border-color: #8a6d35; color: #fbe7b9; }
button.link { background: none; border: 0; padding: 0; color: var(--muted); font-family: var(--sans); font-size: 12px; }
button.link:hover { color: var(--gold2); }
.htmx-request button, button.htmx-request { opacity: .6; }
form.stack { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
form.stack label { display: flex; flex-direction: column; gap: 3px; width: 100%; }
form.stack label input:not([type=checkbox]):not(.narrow), form.stack select { width: 100%; }
form.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 6px 0; }
form.row input[type=password] { flex: 1; }
.checks { display: flex; flex-direction: column; gap: 4px; width: 100%; }
label.check { flex-direction: row !important; align-items: center; gap: 7px !important; }
.flash { padding: 6px 10px; border-left: 2px solid var(--gold); background: var(--panel2); }
.flash.bad { border-color: var(--bad); }

/* login */
.login { width: 340px; }
.login h1 { margin-bottom: 4px; }
.login form { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.login label { display: flex; flex-direction: column; gap: 3px; }
