:root {
  color-scheme: light;
  --ink: #1c1915;
  --muted: #6b645c;
  --line: #e4ddd4;
  --paper: #f7f4ef;
  --card: #fff;
  --accent: #9a3412;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font: 16px/1.45 "Iowan Old Style", Palatino, "Palatino Linotype", serif;
  color: var(--ink);
  background: var(--paper);
}
a { color: var(--accent); }
header.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--card);
}
.brand { font-weight: 700; text-decoration: none; color: var(--ink); }
nav { display: flex; gap: 16px; align-items: center; }
.balance { color: var(--ink); font-variant-numeric: tabular-nums; }
.balance.low { color: #9f1239; }
nav form {
  margin: 0;
  display: inline-flex;
  align-items: center;
}
button.link {
  background: none;
  border: 0;
  border-radius: 0;
  color: var(--accent);
  font: inherit;
  line-height: inherit;
  cursor: pointer;
  padding: 0;
  margin: 0;
  display: inline;
  vertical-align: baseline;
}
main { max-width: 980px; margin: 0 auto; padding: 28px 20px 64px; }
h1 { font-size: 32px; margin: 0 0 8px; }
h2 { font-size: 20px; margin: 0 0 8px; }
.muted { color: var(--muted); }
.error { color: #9f1239; }
.ok { color: #166534; }
.card, .list {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.card { padding: 18px; margin: 16px 0; }
.narrow { max-width: 420px; margin: 10vh auto; }
.split { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 20px; }
@media (max-width: 800px) { .split { grid-template-columns: 1fr; } }
label { display: block; margin: 12px 0 4px; font-size: 14px; }
.checks { display: flex; gap: 16px; flex-wrap: wrap; margin: 4px 0 8px; }
label.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 15px;
  cursor: pointer;
}
label.check input {
  width: auto;
  margin: 0;
}
input, textarea {
  width: 100%;
  font: inherit;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
button, .button {
  display: inline-block;
  margin-top: 14px;
  background: var(--ink);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 8px 14px;
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}
.price { font-size: 20px; margin-bottom: 0; }
.breakdown { padding-left: 18px; color: var(--muted); }
.list { list-style: none; padding: 0; margin: 0; }
.list li { padding: 12px 14px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; }
.list li:first-child { border-top: 0; }
.list a { font-weight: 700; text-decoration: none; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 6px; border-top: 1px solid var(--line); vertical-align: top; }
td a { margin-right: 8px; }
.code { font-family: ui-monospace, monospace; font-size: 14px; }
form.run { margin-top: 0; }
.folder-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.folder-row input { flex: 1; }
button.secondary {
  margin-top: 0;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  white-space: nowrap;
}
button.secondary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
[hidden] { display: none !important; }
.page-head { margin-bottom: 8px; }
.page-head .lead { margin: 0; max-width: 42rem; }
.user-add {
  display: grid;
  grid-template-columns: 1fr 180px auto;
  gap: 12px 14px;
  align-items: end;
}
.user-add .field { min-width: 0; }
.user-add .field label {
  margin: 0 0 6px;
  color: var(--muted);
}
.user-add .field.submit button { margin-top: 0; width: 100%; }
.user-add select,
.role-select {
  width: 100%;
  font: inherit;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}
.table-wrap { overflow-x: auto; margin-top: 8px; }
.users-table { width: 100%; border-collapse: collapse; }
.users-table th {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  border-top: 0;
}
.users-table td {
  padding: 14px 12px;
  border-top: 1px solid var(--line);
  vertical-align: middle;
}
.users-table tbody tr:first-child td { border-top: 0; }
.users-table tr.is-disabled td { opacity: 0.62; }
.user-email { font-weight: 600; }
.tag.you {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f3e8e2;
  color: var(--accent);
  font-size: 12px;
}
.status {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 13px;
}
.status.on { background: #e8f5ee; color: #166534; }
.status.off { background: #f3eee8; color: var(--muted); }
td.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
}
td.actions form { margin: 0; }
td.actions button { margin-top: 0; }
button.danger {
  margin-top: 0;
  background: transparent;
  color: #9f1239;
  border: 1px solid #f0d0d8;
  white-space: nowrap;
}
button.danger:hover { background: #fff5f7; }
form.inline { margin: 0; }
@media (max-width: 720px) {
  .user-add { grid-template-columns: 1fr; }
  .user-add .field.submit label.spacer { display: none; }
  td.actions { justify-content: flex-start; }
}
.progress {
  height: 8px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
  margin: 10px 0 6px;
}
.progress span {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: inherit;
  min-width: 0;
  transition: width 0.4s ease;
}
.progress.done span { background: #166534; }
