:root {
  --paper: #e6ecf0;
  --card: #f7f9fa;
  --ink: #1b2a38;
  --muted: #56667a;
  --line: #c3cfd9;
  --brass: #94702a;
  --brass-soft: #efe2c4;
  --active: #2e7a52;
  --pending: #a8650c;
  --off: #7d8896;
  --danger: #a33a2f;
  --radius-tag: 6px 14px 14px 6px;
  font-family: "Atkinson Hyperlegible", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.5;
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--ink); text-underline-offset: 3px; }
h1, h2 { line-height: 1.2; margin: 0 0 .5rem; }
h1 { font-size: 1.9rem; }
h2 { font-size: 1.2rem; }
small, .muted { color: var(--muted); }
small { display: block; font-size: .85rem; margin-top: .2rem; font-weight: 400; }
:focus-visible { outline: 3px solid var(--brass); outline-offset: 2px; }

/* The punched hole of a key tag: the one recurring motif */
.hole {
  display: inline-block; width: .7rem; height: .7rem; border-radius: 50%;
  background: var(--paper); box-shadow: inset 0 0 0 2px var(--brass); margin-right: .55rem;
  vertical-align: middle; flex: none;
}
.hole.big { width: 1rem; height: 1rem; }

.bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem;
  padding: .8rem clamp(1rem, 4vw, 2.5rem); background: var(--ink); color: #fff;
}
.bar .brand { color: #fff; font-weight: 700; text-decoration: none; font-size: 1.1rem; }
.bar .brand .hole { background: var(--ink); box-shadow: inset 0 0 0 2px var(--brass-soft); }
.bar nav { display: flex; flex-wrap: wrap; gap: 1.2rem; align-items: center; }
.bar nav a, .bar nav .link { color: #d7e0e7; text-decoration: none; font: inherit; }
.bar nav a[aria-current="page"] { color: #fff; box-shadow: 0 2px 0 var(--brass-soft); }
.bar nav form { margin: 0; }

main { max-width: 60rem; padding: 2rem clamp(1rem, 4vw, 2.5rem) 4rem; }
.narrow { max-width: 26rem; margin: 10vh auto 0; }
.lede { font-size: 1.1rem; max-width: 34rem; }
.head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .5rem 1rem; margin-bottom: 1.5rem; }
.head .state, .head .muted { flex-basis: 100%; margin: 0; }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 1.25rem 1.4rem; margin-bottom: 1.25rem; }
.panel.proposal { border-color: var(--brass); background: #fbf6ea; }
.panel.danger { border-color: #d8b3ae; }

/* Service list as key tags */
.tags { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }
.tag a {
  display: grid; grid-template-columns: auto minmax(7rem, 11rem) 1fr auto; align-items: center; gap: .9rem;
  padding: .85rem 1.1rem; background: var(--card); border: 1px solid var(--line);
  border-left: 6px solid var(--off); border-radius: var(--radius-tag); text-decoration: none;
}
.tag a:hover { border-color: var(--ink); border-left-color: inherit; }
.tag.is-active a { border-left-color: var(--active); }
.tag.is-pending a { border-left-color: var(--pending); background: #fdf8ee; }
.tag.is-blocked a { border-left-color: var(--danger); }
.tag-name { font-weight: 700; }
.tag-desc { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag-state { font-size: .92rem; text-align: right; }
.tag-state em { display: block; color: var(--brass); font-style: normal; font-weight: 700; }
@media (max-width: 40rem) {
  .tag a { grid-template-columns: auto 1fr; }
  .tag-desc, .tag-state { grid-column: 2; text-align: left; white-space: normal; }
}
.tag-title { display: flex; align-items: center; }
.tag-title .hole { width: 1rem; height: 1rem; }

/* Forms */
label { display: block; font-weight: 700; }
input, select, textarea {
  display: block; width: 100%; margin-top: .3rem; padding: .55rem .65rem; font: inherit; font-weight: 400;
  color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 6px;
}
textarea.code, pre { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .88rem; }
.stack > * + * { margin-top: 1rem; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1rem 1.25rem; margin-bottom: 1.25rem; }
.grid2 .wide { grid-column: 1 / -1; }
.checks { border: 0; padding: 0; margin: 0; display: grid; gap: .6rem; }
label.check { display: flex; flex-wrap: wrap; gap: .5rem; align-items: baseline; font-weight: 400; }
label.check input { width: auto; margin: 0; }
label.check small { flex-basis: 100%; margin-left: 1.6rem; margin-top: 0; }
.row { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; }
.row .grow { flex: 1 1 14rem; }
.inline { display: inline; }
.secret { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: flex-end; }
.secret > label:first-child { flex: 1 1 18rem; }

button, .button {
  display: inline-block; font: inherit; font-weight: 700; padding: .55rem 1.1rem; border-radius: 6px;
  border: 1px solid var(--ink); background: #fff; color: var(--ink); cursor: pointer; text-decoration: none;
}
button.primary, .button { background: var(--ink); color: #fff; }
button.primary:hover, .button:hover { background: #2c4157; }
button.quiet { border-color: var(--line); }
button.destroy { border-color: var(--danger); color: var(--danger); }
button.link { border: 0; padding: 0; background: none; font-weight: 400; }
button:disabled { opacity: .45; cursor: not-allowed; }

.flash { background: var(--brass-soft); border-left: 4px solid var(--brass); padding: .6rem .9rem; border-radius: 4px; }
.error { background: #f8e4e1; border-left: 4px solid var(--danger); padding: .6rem .9rem; border-radius: 4px; }
.error p, .error ul { margin: .2rem 0; }
.empty { color: var(--muted); }
.result { margin-top: 1rem; padding: .75rem 1rem; border-radius: 6px; border-left: 4px solid var(--active); background: #e9f3ed; }
.result.bad { border-left-color: var(--danger); background: #f8e4e1; }
.result pre, .diff pre { white-space: pre-wrap; word-break: break-word; margin: .4rem 0 0; }

.scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .92rem; }
th, td { text-align: left; padding: .45rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { color: var(--muted); font-weight: 700; }
td.detail { max-width: 22rem; overflow-wrap: anywhere; }
.diff th[scope="row"] { white-space: nowrap; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

h3 { font-size: 1.02rem; margin: 1.4rem 0 .3rem; }
.plain { padding-left: 1.1rem; }
pre.notes { white-space: pre-wrap; background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: .8rem; }
td small { font-weight: 400; }
details summary { cursor: pointer; font-weight: 700; }
details .menu { padding: .75rem 0 .25rem; min-width: 16rem; }
.narrowpanel { max-width: 36rem; }
.narrowpanel label + label { margin-top: 1rem; }
td select { width: auto; margin: 0; }
