/* SOMA dashboard: a terminal page on paper. One accent, green, and only for money saved. */

:root {
  --paper: #f3efe5;
  --paper-2: #ebe6d8;
  --paper-3: #fbf9f3;
  --ink: #171612;
  --ink-2: #57524a;
  --ink-3: #8a8476;
  --rule: #d4ccba;
  --green: #1c6b36;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Monaco, "Cascadia Mono", "Roboto Mono",
    "DejaVu Sans Mono", "Liberation Mono", Consolas, monospace;
  color-scheme: light;
}

* { box-sizing: border-box; }
html {
  background: var(--paper);
  color: var(--ink);
  font: 13px/1.6 var(--mono);
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}
body { margin: 0; background: var(--paper); }
::selection { background: var(--ink); color: var(--paper); }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
code { font: inherit; background: var(--paper-2); padding: 0 .5ch; }
p { margin: 0; }
[hidden] { display: none !important; }

.page { max-width: 1120px; margin: 0 auto; padding: 26px 32px 64px; }

/* top bar */
.top {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 1ch 3ch;
  padding-bottom: 12px; border-bottom: 1px solid var(--ink);
}
.brand { font-weight: 700; letter-spacing: .34em; text-decoration: none; }
.top nav { display: flex; gap: 1ch; }
.top nav a { color: var(--ink-2); text-decoration: none; padding: 0 .6ch; }
.top nav a:hover { color: var(--ink); text-decoration: underline; }
.top nav a[aria-current="page"] { background: var(--ink); color: var(--paper); text-decoration: none; }
.live { margin-left: auto; color: var(--ink-3); font-size: 12px; white-space: nowrap; }
.live::before {
  content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 1ch; vertical-align: 1px;
  background: var(--ink-3);
}
.live[data-state="ok"]::before { background: var(--ink); }
.live[data-state="error"]::before, .live[data-state="auth"]::before { background: none; box-shadow: inset 0 0 0 1px var(--ink); }
.live[data-state="error"], .live[data-state="auth"] { color: var(--ink); }

.notice { margin: 18px 0 0; padding: 10px 14px; border: 1px solid var(--ink); background: var(--paper-3); }
.alert { margin: 14px 0 0; padding: 8px 14px; background: var(--ink); color: var(--paper); font-weight: 700; }

/* the number */
.hero { padding: 64px 0 46px; border-bottom: 1px solid var(--rule); }
.big {
  font-size: clamp(56px, 12vw, 136px); line-height: .92; font-weight: 600; letter-spacing: -.05em;
  color: var(--green); white-space: nowrap;
}
.big.flat { color: var(--ink); }
.caption { margin-top: 20px; color: var(--ink-2); }
.facts { margin-top: 2px; color: var(--ink-3); }

/* sections */
section { padding: 24px 0 28px; border-bottom: 1px solid var(--rule); }
.head { display: flex; align-items: baseline; justify-content: space-between; gap: 2ch; margin-bottom: 10px; }
h1 { margin: 0; font-size: 22px; line-height: 1.25; font-weight: 700; letter-spacing: -.01em; }
h2 { margin: 0; font-size: 11px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; }
.meta, .sub { color: var(--ink-3); }
.meta { font-size: 12px; text-align: right; }
.empty { color: var(--ink-2); padding: 6px 0; }

/* tables */
.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left; font-weight: 400; font-size: 12px; color: var(--ink-3); white-space: nowrap;
  padding: 0 1.4ch 6px; border-bottom: 1px solid var(--rule);
}
td { padding: 7px 1.4ch; border-bottom: 1px dotted var(--rule); white-space: nowrap; vertical-align: baseline; }
tr:last-child td { border-bottom: 0; }
th:first-child, td:first-child { padding-left: 0; }
th:last-child, td:last-child { padding-right: 0; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.go { cursor: pointer; }
tr.go:hover td, tr.go:focus-within td { background: var(--paper-2); }
td.wrap { white-space: normal; min-width: 24ch; }
.name { font-weight: 700; }
.saved { color: var(--green); }
.bar { white-space: pre; }
.dim { color: var(--ink-3); }

/* status words */
.st { white-space: nowrap; }
.st-failed { background: var(--ink); color: var(--paper); padding: 0 .6ch; }
.st-moving, .st-suspending, .st-resuming, .st-provisioning, .st-starting, .st-queued { font-style: italic; }
.st-finished, .st-stopped, .st-suspended { color: var(--ink-2); }

/* bracket buttons: [ stop ] */
button {
  font: inherit; color: var(--ink); background: none; border: 0; padding: 1px .4ch; cursor: pointer;
}
button::before { content: "[ "; color: var(--ink-3); }
button::after { content: " ]"; color: var(--ink-3); }
button:hover:not(:disabled) { background: var(--ink); color: var(--paper); }
button:hover:not(:disabled)::before, button:hover:not(:disabled)::after { color: var(--paper); }
button:disabled { color: var(--ink-3); cursor: default; }
button:disabled::before, button:disabled::after { color: var(--rule); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.actions { display: flex; flex-wrap: wrap; gap: .5ch 2ch; align-items: baseline; margin-top: 20px; }
.plan { margin-top: 18px; }
.said { color: var(--ink-2); }

/* forms */
label { display: block; color: var(--ink-2); font-size: 12px; margin: 12px 0 2px; }
input[type="text"], input[type="password"], input[type="number"], textarea {
  display: block; width: 100%; font: inherit; color: var(--ink); background: var(--paper-3);
  border: 0; border-bottom: 1px solid var(--ink-3); border-radius: 0; padding: 5px 6px;
}
input:focus, textarea:focus { outline: none; border-bottom-color: var(--ink); background: #fffdf7; }
textarea { min-height: 7.5em; resize: vertical; border: 1px solid var(--rule); }
input[type="radio"], input[type="checkbox"] { accent-color: var(--ink); }
fieldset { border: 0; margin: 12px 0 0; padding: 0; }
legend { color: var(--ink-2); font-size: 12px; padding: 0; }
.choice { display: inline-flex; align-items: baseline; gap: .6ch; margin: 4px 2ch 0 0; color: var(--ink); font-size: 13px; }
.row { display: flex; flex-wrap: wrap; gap: 0 2ch; align-items: flex-end; }
.row > div { flex: 1 1 18ch; }
.form-foot { display: flex; flex-wrap: wrap; gap: 1ch 2ch; align-items: baseline; margin-top: 16px; }

/* job page */
.back { color: var(--ink-2); text-decoration: none; }
.back:hover { color: var(--ink); text-decoration: underline; }
.title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 1ch 2ch; padding: 22px 0 6px; }
.title .st { margin-left: auto; font-size: 13px; }
.cmd { color: var(--ink-2); padding-bottom: 20px; border-bottom: 1px solid var(--rule); word-break: break-all; }
.cmd::before { content: "$ "; color: var(--ink-3); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px 3ch; }
.grid .wide { grid-column: span 2; }
.grid dt { color: var(--ink-3); font-size: 12px; }
.grid dd { margin: 2px 0 0; }
.progress-line { margin-top: 18px; }
.loops { color: var(--ink-2); margin-top: 4px; }
pre { margin: 0; font: inherit; }
pre.log {
  max-height: 62vh; overflow: auto; padding: 14px 16px; background: var(--paper-3);
  border: 1px solid var(--rule); white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12.5px; line-height: 1.55;
}
.tl td.track { padding-left: .5ch; padding-right: .5ch; }
.tl .track span { white-space: pre; }
.scale { display: flex; justify-content: space-between; color: var(--ink-3); font-size: 12px; }
.events li { display: flex; gap: 2ch; padding: 2px 0; }
.events { list-style: none; margin: 0; padding: 0; max-height: 40vh; overflow: auto; }
.events .k { color: var(--ink-3); min-width: 9ch; }
.events .t { color: var(--ink-3); }
.log-meta { color: var(--ink-3); font-size: 12px; margin-top: 6px; }
section > .sub { font-size: 12px; margin: 6px 0 8px; }
.boots { list-style: none; margin: 8px 0 0; padding: 0; color: var(--ink-3); font-size: 12px; }
.check { display: inline-flex; gap: .6ch; align-items: baseline; color: var(--ink-2); font-size: 12px; margin: 0; }

/* connections */
.intro { color: var(--ink-2); padding: 22px 0 24px; border-bottom: 1px solid var(--rule); }
.intro p { max-width: 80ch; }
.intro code { white-space: nowrap; }
.cards {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  border-top: 1px solid var(--rule); border-left: 1px solid var(--rule); margin-top: 4px;
}
.card { border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 18px 20px 20px; }
.card .head { margin-bottom: 4px; }
.card h3 { margin: 0; font-size: 15px; font-weight: 700; letter-spacing: .02em; }
.card .state { font-size: 12px; }
.card .state.ok { color: var(--ink); }
.card .state.bad { background: var(--ink); color: var(--paper); padding: 0 .6ch; }
.card .err { margin-top: 8px; color: var(--ink); border-left: 2px solid var(--ink); padding-left: 1ch; overflow-wrap: anywhere; }
.secret-list { list-style: none; margin: 0 0 10px; padding: 0; }
.secret-list li { display: flex; justify-content: space-between; gap: 2ch; padding: 6px 0; border-bottom: 1px dotted var(--rule); }

/* job page: a capsule kept after its verification failed */
.quarantine { margin-top: 18px; padding: 10px 14px; border: 1px solid var(--ink); border-left-width: 4px; background: var(--paper-3); }
.quarantine p + p { margin-top: 4px; }
.quarantine .q-head { font-size: 11px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; }

/* settings: one box per setting, ruled like the connection cards */
.groups {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  border-top: 1px solid var(--rule); border-left: 1px solid var(--rule); margin-top: 4px;
}
.group { min-width: 0; margin: 0; padding: 14px 18px 18px; border: 0; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.group legend { float: left; width: 100%; padding: 0; color: var(--ink); font-size: 13px; font-weight: 700; }
.group .hint { clear: both; color: var(--ink-3); font-size: 12px; padding-top: 2px; }
.group > .field, .group > .choice { clear: both; }
.group .choice { display: flex; margin-top: 10px; }
select {
  display: block; width: 100%; font: inherit; color: var(--ink); background: var(--paper-3);
  border: 0; border-bottom: 1px solid var(--ink-3); border-radius: 0; padding: 5px 6px;
}
select:focus { outline: none; border-bottom-color: var(--ink); background: #fffdf7; }
input[data-dirty], select[data-dirty] { border-bottom-style: dashed; border-bottom-color: var(--ink); }

.foot { padding-top: 18px; color: var(--ink-3); font-size: 12px; display: flex; flex-wrap: wrap; gap: 0 3ch; }

@media (max-width: 680px) {
  .page { padding: 18px 16px 48px; }
  .hero { padding: 40px 0 32px; }
  .live { margin-left: 0; width: 100%; }
  .cards, .groups { grid-template-columns: 1fr; }
  .title .st { margin-left: 0; }
}
@media print {
  .top nav, .live, .actions { display: none; }
}
