/* The Lowsite look, from lowsite-os ui-kit (tokens.css is a verbatim copy). The component recipes below restate ui-kit's Button, Card,
   Input, Label, Badge, Table, PageHeader and the console TopBar in plain CSS,
   because this page has no Vue or Tailwind. Source commit: README.md. */
@import url("tokens.css");

* { box-sizing: border-box; border-color: hsl(var(--border)); }
html, body {
  margin: 0;
  min-height: 100vh;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  font: 14px/1.5 var(--font-sans);
}
code, pre, .mono { font-family: var(--font-mono); }
[hidden] { display: none !important; }

/* ---- TopBar ------------------------------------------------------------ */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: .5rem;
  height: 56px; padding: 0 12px;
  border-bottom: 1px solid hsl(var(--border));
  background: hsl(var(--card) / .8);
  backdrop-filter: blur(8px);
}
.brand { display: flex; align-items: center; gap: 8px; padding: 0 8px; }
.brand-mark {
  display: grid; place-items: center; width: 24px; height: 24px; border-radius: 6px;
  background: hsl(var(--primary)); color: hsl(var(--primary-foreground));
  font-size: 13px; font-weight: 900;
}
.brand-name { font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.divider { width: 1px; height: 20px; margin: 0 8px; background: hsl(var(--border)); }
.topbar-title { font-size: 14px; font-weight: 500; }
.spacer { flex: 1; }
.who { color: hsl(var(--muted-foreground)); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- layout ------------------------------------------------------------ */
main { max-width: 1040px; margin: 0 auto; padding: 32px 16px 64px; display: grid; gap: 24px; }
.page-header h1 { margin: 0; font-size: 30px; font-weight: 600; letter-spacing: -.02em; }
.page-header p { margin: 6px 0 0; max-width: 42rem; color: hsl(var(--muted-foreground)); font-size: 14px; line-height: 1.6; }
.center { min-height: calc(100vh - 56px); display: grid; place-items: center; padding: 16px; }

/* ---- Card -------------------------------------------------------------- */
.card {
  border: 1px solid hsl(var(--border) / .7);
  border-radius: 16px;
  background: hsl(var(--card));
  color: hsl(var(--card-foreground));
  box-shadow: 0 16px 50px -20px rgba(60, 45, 0, .20), 0 4px 12px -6px rgba(0, 0, 0, .06);
  padding: 24px;
}
.card h2 { margin: 0 0 16px; font-size: 16px; font-weight: 600; }
.login { width: 100%; max-width: 384px; padding: 32px; text-align: center; }
.login h1 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.login p { margin: 4px 0 24px; color: hsl(var(--muted-foreground)); font-size: 14px; }
.login .btn { width: 100%; }

/* ---- form -------------------------------------------------------------- */
form { display: grid; gap: 20px; }
.row { display: grid; gap: 20px; grid-template-columns: 1fr 1fr; }
@media (max-width: 640px) { .row { grid-template-columns: 1fr; } }
.field { display: grid; gap: 6px; }
.label { font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .14em; color: hsl(var(--muted-foreground)); }
.hint { font-size: 12px; color: hsl(var(--muted-foreground)); }
.input, textarea.input {
  width: 100%; min-height: 40px; padding: 8px 14px;
  border: 1px solid hsl(var(--input)); border-radius: 12px;
  background: hsl(var(--card) / .6); color: inherit; font: inherit; font-size: 14px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
  transition: border-color .15s, box-shadow .15s;
}
textarea.input { font-family: var(--font-mono); font-size: 12px; word-break: break-all; resize: vertical; }
.input::placeholder { color: hsl(var(--muted-foreground)); }
.input:focus-visible, .btn:focus-visible, .chip input:focus-visible + span {
  outline: none; box-shadow: 0 0 0 2px hsl(var(--background)), 0 0 0 4px hsl(var(--ring));
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
  display: inline-flex; align-items: center; height: 32px; padding: 0 14px; border-radius: 999px;
  border: 1px solid hsl(var(--border)); font-size: 13px; cursor: pointer; user-select: none;
  font-family: var(--font-mono);
  transition: background-color .15s, color .15s, border-color .15s;
}
.chip span:hover { background: hsl(var(--accent)); }
.chip input:checked + span { background: hsl(var(--primary) / .15); border-color: transparent; color: hsl(var(--accent-foreground)); font-weight: 500; }

/* ---- Button ------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 20px; border-radius: 999px; border: 1px solid transparent;
  font: inherit; font-size: 14px; font-weight: 500; white-space: nowrap; cursor: pointer;
  transition: background-color .15s, color .15s, opacity .15s;
}
.btn:disabled { opacity: .5; pointer-events: none; }
.btn-primary { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.btn-primary:hover { background: hsl(var(--primary) / .9); }
.btn-outline { border-color: hsl(var(--border)); background: hsl(var(--card) / .4); color: hsl(var(--foreground)); }
.btn-outline:hover { background: hsl(var(--accent)); color: hsl(var(--accent-foreground)); }
.btn-ghost { background: transparent; color: hsl(var(--foreground)); }
.btn-ghost:hover { background: hsl(var(--accent)); color: hsl(var(--accent-foreground)); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12px; }
.btn-icon { width: 36px; height: 36px; padding: 0; }
.actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }

/* ---- preview / messages ----------------------------------------------- */
.preview { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; padding: 16px; border-radius: 12px; background: hsl(var(--muted)); font-size: 13px; }
.preview dt { color: hsl(var(--muted-foreground)); }
.preview dd { margin: 0; font-family: var(--font-mono); word-break: break-all; }
.message { margin: 0; font-size: 14px; }
.message.bad { color: hsl(var(--destructive)); }
.message.ok { color: rgb(5 150 105); }
.dark .message.ok { color: rgb(52 211 153); }

/* ---- Badge ------------------------------------------------------------- */
.badge { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px; border: 1px solid transparent; font-size: 12px; font-weight: 500; white-space: nowrap; }
.badge-success { background: rgb(16 185 129 / .15); color: rgb(5 150 105); }
.dark .badge-success { color: rgb(52 211 153); }
.badge-warn { background: rgb(245 158 11 / .15); color: rgb(217 119 6); }
.dark .badge-warn { color: rgb(251 191 36); }
.badge-failed { background: hsl(var(--foreground)); color: hsl(var(--background)); }
.badge-outline { border-color: hsl(var(--border)); }

/* ---- Table ------------------------------------------------------------- */
.table-wrap { overflow-x: auto; border-radius: 16px; border: 1px solid hsl(var(--border) / .7); background: hsl(var(--card)); box-shadow: 0 16px 50px -20px rgba(60, 45, 0, .20); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead th { padding: 12px 16px; text-align: left; font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: hsl(var(--muted-foreground)); border-bottom: 1px solid hsl(var(--border)); white-space: nowrap; }
tbody td { padding: 12px 16px; border-bottom: 1px solid hsl(var(--border) / .55); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background-color 140ms ease; }
tbody tr:hover { background: hsl(var(--primary) / .05); }
td.num, th.num { text-align: right; }
td .sub { display: block; font-size: 12px; color: hsl(var(--muted-foreground)); }
.empty { padding: 32px 16px; text-align: center; color: hsl(var(--muted-foreground)); }
.section-title { display: flex; align-items: baseline; justify-content: space-between; margin: 8px 0 12px; }
.section-title h2 { margin: 0; font-size: 18px; font-weight: 600; }
td .mono { white-space: nowrap; }

/* Grid items default to min-width:auto, which let the 64-char MAC hash and the
   table widen the page past a phone screen. */
main > *, form > *, .row > * { min-width: 0; }
.preview { grid-template-columns: max-content minmax(0, 1fr); }
@media (max-width: 640px) {
  .topbar-title, .divider, .who { display: none; }
  main { padding-top: 24px; }
  .page-header h1 { font-size: 24px; }
  .card { padding: 20px 16px; }
  .preview { grid-template-columns: 1fr; gap: 2px; }
  .preview dd { margin-bottom: 8px; }
}
tbody td { white-space: nowrap; }
