/* warden web: one dark teal-and-cyan theme for the landing page and every dashboard
   page (the look of the golem banner art). landing.css adds only the landing page's
   own sections. System fonts, no external requests, and no inline styles (the CSP
   forbids them), so everything lives in these two files. */
:root {
  --bg: #050a0e;
  --teal: #0c3b38;
  --teal-2: #124e49;
  --cyan: #38e8d6;
  --cyan-2: #8ff6ea;
  --ember: #ff9a3c;
  --text: #e9fbf8;
  --soft: #a9cfca;
  --muted: #8fb3ae;
  --line: rgba(56, 232, 214, 0.28);
  --line-soft: rgba(56, 232, 214, 0.14);
  --glass: rgba(4, 22, 21, 0.78);
  --field: rgba(2, 12, 12, 0.85);
  --code-bg: rgba(56, 232, 214, 0.1);
  --open: #3ddc97;
  --danger: #ff7b7b;
  --danger-bg: rgba(90, 16, 16, 0.55);
  --warn: #ffb54d;
  --tag-bg: rgba(255, 154, 60, 0.16);
  --mono: ui-monospace, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  position: relative;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  /* davinci's seamless stone tile on the page colour; the art layer sits above it. */
  background: var(--bg) url("/static/landing/texture-tile-512.webp") repeat;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--cyan-2); }
a:hover { color: #fff; }
img { max-width: 100%; height: auto; }
a:focus-visible, button:focus-visible, summary:focus-visible, select:focus-visible,
textarea:focus-visible, input:focus-visible {
  outline: 3px solid var(--ember);
  outline-offset: 3px;
}

/* --- the artwork layer: behind the text and everything else ------------- */
.art {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 380px;              /* dashboard pages: a faded band across the top */
  z-index: -2;
  overflow: hidden;
  background: var(--bg);
}
.art picture, .art img { display: block; width: 100%; height: 100%; }
.art img { object-fit: cover; object-position: right 25%; opacity: 0.6; }
/* Dashboard band: melt into the stone texture instead of ending in a hard edge. */
.art.band {
  -webkit-mask-image: linear-gradient(180deg, #000 30%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 30%, transparent 100%);
}
/* Stand-in until the full-size art is added: the small banner, enlarged. */
.art.fallback img { filter: blur(3px) saturate(1.25) brightness(1.1); transform: scale(1.12); }
/* A dark vignette plus a fade into the page colour so text is always readable. */
.veil {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 380px;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(5, 10, 14, 0.85) 0%, rgba(5, 10, 14, 0.5) 45%, rgba(5, 10, 14, 0.1) 100%);
}
/* The landing page: the whole first screen, golem fully visible. */
.art.full { height: max(100vh, 760px); }
.art.full img { opacity: 1; object-position: right center; animation: drift 60s ease-in-out infinite alternate; }
.art.full.fallback img { animation: none; }
.veil.full {
  height: max(100vh, 760px);
  background:
    linear-gradient(90deg, rgba(5, 10, 14, 0.7) 0%, rgba(5, 10, 14, 0.4) 40%, rgba(5, 10, 14, 0) 62%),
    linear-gradient(180deg, rgba(5, 10, 14, 0.35) 0%, rgba(5, 10, 14, 0) 22%);
}
@keyframes drift {
  from { transform: scale(1); }
  to { transform: scale(1.06) translateX(-1%); }
}
@media (max-width: 860px) {
  .art.full, .veil.full { height: max(100svh, 820px); }
  .art.full img { object-position: center bottom; }
  .veil.full {
    background: linear-gradient(180deg, rgba(5, 10, 14, 0.5) 0%, rgba(5, 10, 14, 0.3) 45%, rgba(5, 10, 14, 0) 70%);
  }
  .art, .veil { height: 280px; }
  .art img { object-position: 70% 25%; }
}

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon {
  width: 1.3em; height: 1.3em;
  fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
  vertical-align: -0.25em;
}
.icon.big { width: 2.2rem; height: 2.2rem; color: var(--cyan); }

.skip {
  position: absolute; left: 0.5rem; top: -4rem; z-index: 10;
  background: var(--cyan); color: #04100f !important; padding: 0.5rem 0.9rem;
  border-radius: 8px; font-weight: 700;
}
.skip:focus { top: 0.5rem; }

/* --- top bar and footer ------------------------------------------------ */
header.top {
  position: sticky; top: 0; z-index: 5;
  background: rgba(4, 16, 15, 0.78);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.bar {
  max-width: 1180px; margin: 0 auto; padding: 0.6rem 1.2rem;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
}
.brand {
  font-family: var(--mono); font-weight: 800; font-size: 1.2rem;
  color: #fff !important; text-decoration: none; letter-spacing: 0.04em;
}
.brand .icon { color: var(--cyan); margin-right: 0.45rem; }
header.top nav { display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap; }
header.top nav a { text-decoration: none; font-weight: 600; color: var(--soft); }
header.top nav a:hover, header.top nav a[aria-current] { color: #fff; }
.who { font-weight: 600; font-size: 0.95rem; color: var(--cyan-2); }
.who small { color: var(--soft); font-weight: 400; }
.l-link, header.top button {
  background: none; border: 1px solid var(--line); color: var(--text);
  font: inherit; font-weight: 600; padding: 0.25rem 0.75rem; border-radius: 8px;
  cursor: pointer; box-shadow: none;
}
.l-link:hover, header.top button:hover { background: rgba(56, 232, 214, 0.15); border-color: var(--cyan); color: #fff; }

footer.foot {
  margin: 2rem 0 0; text-align: center; color: var(--soft); font-size: 0.9rem;
  background: rgba(4, 16, 15, 0.85); border-top: 1px solid var(--line);
}
footer.foot div { padding: 1.2rem; }

/* --- page ------------------------------------------------------------------ */
main {
  flex: 1;
  width: 100%; max-width: 1180px; margin: 0 auto; padding: 1.8rem 1.2rem 1rem;
}

h1, h2, h3 { font-family: var(--mono); color: #fff; line-height: 1.15; }
h1 { margin: 0 0 0.9rem; font-size: clamp(1.7rem, 4vw, 2.4rem); text-shadow: 0 2px 20px rgba(0, 0, 0, 0.7); }
h2 { margin: 0 0 0.8rem; font-size: 1.25rem; }
h3 { margin: 1.2rem 0 0.5rem; font-size: 1.05rem; }
body.app h2 { border-left: 4px solid var(--cyan); padding-left: 0.65rem; }

.eyebrow {
  margin: 0 0 0.6rem; color: var(--cyan); font-family: var(--mono);
  font-size: 0.85rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.14em;
}
.lead { font-size: 1.15rem; color: var(--text); max-width: 38rem; }
.crumbs { color: var(--soft); margin: 0 0 0.8rem; font-size: 0.95rem; }
.crumbs a { font-weight: 600; }
.muted, small.muted { color: var(--muted); }
.warn { color: var(--warn); font-weight: 700; }

code, .mono {
  font-family: var(--mono);
  background: var(--code-bg);
  color: var(--cyan-2);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  word-break: break-all;
}

/* --- buttons ----------------------------------------------------------- */
.button,
main button,
.l-btn {
  display: inline-block;
  text-decoration: none;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 1rem;
  padding: 0.55rem 1.05rem;
  border-radius: 10px;
  cursor: pointer;
  background: linear-gradient(180deg, #3df0dd, #1fb8a8);
  color: #03201d !important;
  border: 2px solid var(--cyan-2);
  box-shadow: 0 4px 16px rgba(31, 184, 168, 0.28);
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.button:hover,
main button:hover {
  background: linear-gradient(180deg, #6bf5e6, #2ecabb);
  color: #03201d !important;
  box-shadow: 0 4px 22px rgba(56, 232, 214, 0.4);
}
/* Quiet buttons: outlined, for secondary choices. */
.l-btn {
  background: rgba(4, 22, 21, 0.7); color: var(--text) !important;
  border: 2px solid var(--line); box-shadow: none; font-size: 1.05rem; padding: 0.75rem 1.3rem;
}
.l-btn:hover { border-color: var(--cyan); background: rgba(56, 232, 214, 0.14); color: #fff !important; }
.l-btn.primary {
  background: linear-gradient(180deg, #3df0dd, #1fb8a8); color: #03201d !important;
  border-color: var(--cyan-2);
  box-shadow: 0 0 0 0 rgba(56, 232, 214, 0.55), 0 6px 22px rgba(31, 184, 168, 0.35);
  animation: ring 3.2s ease-out infinite;
}
.l-btn.primary:hover { background: linear-gradient(180deg, #6bf5e6, #2ecabb); color: #03201d !important; }
@keyframes ring { 70%, 100% { box-shadow: 0 0 0 14px rgba(56, 232, 214, 0), 0 6px 22px rgba(31, 184, 168, 0.35); } }

/* Danger: dark red with a red edge, never the cyan of a safe action. */
.button.danger, button.danger, a.button.danger, main button.danger {
  background: var(--danger-bg);
  color: #ffd9d9 !important;
  border-color: var(--danger);
  box-shadow: none;
}
.button.danger:hover, button.danger:hover, a.button.danger:hover, main button.danger:hover {
  background: rgba(140, 24, 24, 0.75); color: #fff !important; box-shadow: 0 0 18px rgba(255, 123, 123, 0.3);
}
.inline { display: inline; }
/* A compact button for a table row (Resync), and the row's action cluster. */
main button.small, main a.button.small { font-size: 0.85rem; padding: 0.25rem 0.7rem; border-width: 1px; border-radius: 8px; box-shadow: none; }
td.row-actions { white-space: nowrap; }
td.row-actions > * { margin-right: 0.6rem; vertical-align: middle; }

/* --- cards / sections / notices ------------------------------------------- */
body.app section,
.panel,
.card,
.guilds li,
.danger-zone {
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.2rem;
  margin: 0 0 1.2rem;
  backdrop-filter: blur(6px);
}
.card, .guilds li { transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s; }
.card:hover, .guilds li:hover { border-color: var(--cyan); box-shadow: 0 0 28px rgba(56, 232, 214, 0.16); }
.panel { box-shadow: 0 0 60px rgba(56, 232, 214, 0.08); }
body.app section.danger-zone, .danger-zone {
  border-color: var(--danger);
  background: rgba(40, 8, 10, 0.78);
  box-shadow: 0 0 40px rgba(255, 123, 123, 0.08);
}
body.app section.master-note {
  border-color: var(--cyan);
  box-shadow: 0 0 40px rgba(56, 232, 214, 0.12);
}
body.app section.master-note h2 { font-size: 1.45rem; }
section, td { overflow: visible; }

.error, .notice {
  padding: 0.6rem 0.9rem; border-radius: 10px; margin: 0 0 1rem; font-weight: 600;
  border: 1px solid;
}
.error { background: var(--danger-bg); border-color: var(--danger); color: #ffd9d9; }
.notice { background: rgba(14, 70, 52, 0.55); border-color: var(--open); color: #c9f7e1; }

.tag {
  display: inline-block; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em;
  background: var(--tag-bg); border: 1px solid var(--ember); color: #ffd7ae; font-weight: 700;
  padding: 0.05rem 0.45rem; border-radius: 4px; vertical-align: middle; margin-right: 0.3rem;
}

/* --- forms ------------------------------------------------------------- */
textarea,
input[type="search"],
input[type="text"],
input[type="password"],
select {
  width: 100%;
  font: inherit;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--field);
  color: var(--text);
}
textarea::placeholder, input::placeholder { color: var(--muted); }
textarea:focus, input[type="search"]:focus, input[type="text"]:focus,
input[type="password"]:focus, select:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(56, 232, 214, 0.25);
}
td select { width: auto; padding: 0.25rem 0.4rem; }
textarea.mono { font-family: var(--mono); font-size: 0.9rem; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--cyan); }
form.stack { display: grid; gap: 0.8rem; max-width: 36rem; margin: 0.8rem 0; }
form.stack label { display: grid; gap: 0.25rem; font-weight: 700; }
form.stack label.check { display: block; font-weight: 400; }
form.wide { max-width: 52rem; }
form.search { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; margin-bottom: 0.8rem; }
form.search input[type="search"] { flex: 1; min-width: 180px; }
form.search input[type="text"] { width: 6rem; flex: none; }
form textarea + button { margin-top: 0.4rem; }
fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 0.6rem 0.9rem; }
legend { color: var(--cyan-2); font-family: var(--mono); font-weight: 700; padding: 0 0.3rem; }
.counter { font-weight: 400; }
.actions { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; }
.preview {
  border: 1px solid var(--line); border-radius: 12px; padding: 0.2rem 1rem 0.6rem;
  background: var(--field); max-width: 52rem;
}
.preview h3 { margin-bottom: 0.2rem; }

/* --- tables ------------------------------------------------------------ */
table { border-collapse: collapse; width: 100%; }
th, td {
  text-align: left; vertical-align: top; padding: 0.4rem 0.55rem;
  border-bottom: 1px solid var(--line-soft);
}
thead th {
  font-family: var(--mono); font-size: 0.85rem; font-weight: 700; color: var(--cyan-2);
  border-bottom: 1px solid var(--line);
}
table.kv th { width: 13rem; font-weight: 700; color: var(--soft); }
table.kv ul { margin: 0.3rem 0 0; padding-left: 1.2rem; }

/* --- server list --------------------------------------------------------- */
.refresh-list { margin-top: -0.4rem; }
.guild-group { margin: 1.4rem 0; }
.guilds {
  list-style: none; padding: 0; margin: 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 1.1rem;
}
.guilds li { margin: 0; display: flex; align-items: center; gap: 0.7rem; }
.guilds a { font-weight: 700; font-size: 1.1rem; text-decoration: none; }
.guilds a:hover { text-decoration: underline; }
.guilds .button {
  margin-left: auto; padding: 0.25rem 0.85rem; font-size: 0.95rem; text-decoration: none;
}
.guild-icon, .guild-initials {
  width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line);
  vertical-align: middle; margin-right: 0.6rem; object-fit: cover;
}
.guilds .guild-icon, .guilds .guild-initials { margin-right: 0; flex: none; }
h1 .guild-icon, h1 .guild-initials { width: 48px; height: 48px; }
.guild-initials {
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--teal-2), var(--teal));
  font-family: var(--mono); font-weight: 800; font-size: 0.95rem; color: var(--cyan-2);
}
.avatar {
  width: 22px; height: 22px; border-radius: 50%; vertical-align: middle;
  margin-right: 0.35rem; border: 1px solid var(--line);
}
.avatar.big { width: 40px; height: 40px; }
.pager { display: flex; gap: 1rem; justify-content: center; font-weight: 700; }

/* --- timeline and notes --------------------------------------------------- */
ol.timeline { list-style: none; padding: 0; margin: 0; }
ol.timeline li {
  border-left: 4px solid var(--teal-2); padding: 0.4rem 0.8rem; margin-bottom: 0.6rem;
  background: rgba(56, 232, 214, 0.05); border-radius: 0 10px 10px 0;
}
ol.timeline li.kind-note { border-left-color: var(--cyan); }
ol.timeline li.kind-audit { border-left-color: var(--ember); }
ol.timeline li.kind-rules { border-left-color: var(--open); }
ol.timeline li.kind-whitelist { border-left-color: var(--cyan-2); }
.when { color: var(--muted); font-size: 0.85rem; margin-right: 0.4rem; font-family: var(--mono); }
.body { white-space: pre-wrap; margin-top: 0.2rem; }

body.app section.notes .log-note, .log-note {
  border-left: 4px solid var(--cyan); padding: 0.5rem 0.8rem; margin: 0.8rem 0;
  background: rgba(56, 232, 214, 0.05); border-radius: 0 10px 10px 0;
}
.log-note .muted { margin: 0 0 0.3rem; }

details {
  background: rgba(56, 232, 214, 0.05); border: 1px solid var(--line-soft);
  border-radius: 10px; padding: 0.5rem 0.8rem; margin: 0.6rem 0;
}
summary { cursor: pointer; font-weight: 700; color: var(--cyan-2); }
details.doc { margin: 0.45rem 0 0; }
pre.doc {
  white-space: pre-wrap; word-break: break-word; font-family: var(--sans); font-size: 0.95rem;
  line-height: 1.5; background: var(--field); border: 1px solid var(--line); border-radius: 10px;
  padding: 0.8rem; margin: 0.5rem 0 0; max-height: 24rem; overflow: auto; color: var(--text);
}

/* Rendered / Raw segmented control for Markdown views (rules, etc.). */
.view-toggle {
  display: inline-flex;
  border: 2px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  margin: 0.5rem 0 0;
}
.view-toggle a {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.3rem 0.9rem;
  text-decoration: none;
  color: var(--soft);
  background: rgba(4, 22, 21, 0.7);
  border-right: 1px solid var(--line);
}
.view-toggle a:last-child { border-right: 0; }
.view-toggle a:hover { color: #fff; background: rgba(56, 232, 214, 0.14); }
.view-toggle a.is-active {
  background: linear-gradient(180deg, #3df0dd, #1fb8a8);
  color: #03201d;
}
.view-toggle a:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; z-index: 1; }
.md-rendered {
  background: var(--field); border: 1px solid var(--line); border-radius: 10px;
  padding: 0.8rem 1rem; margin: 0.5rem 0 0; max-height: 24rem; overflow: auto;
}
body.app .md-rendered h1, body.app .md-rendered h2, body.app .md-rendered h3,
body.app .md-rendered h4, body.app .md-rendered h5, body.app .md-rendered h6,
body.app .note-body h1, body.app .note-body h2, body.app .note-body h3,
body.app .note-body h4, body.app .note-body h5, body.app .note-body h6 {
  font-family: var(--sans); font-weight: 800; color: #fff; margin: 0.8rem 0 0.35rem;
  border-left: 0; padding-left: 0;
}
.md-rendered h1, .note-body h1 { font-size: 1.35rem; }
.md-rendered h2, .note-body h2 { font-size: 1.2rem; }
.md-rendered h3, .note-body h3 { font-size: 1.05rem; }
.md-rendered h1:first-child, .md-rendered h2:first-child, .md-rendered h3:first-child,
.note-body h1:first-child, .note-body h2:first-child, .note-body h3:first-child { margin-top: 0; }
.md-rendered small, .note-body small {
  display: block; font-size: 0.8rem; color: var(--muted); margin: 0.25rem 0;
}
.post-heading { font-family: var(--mono); font-weight: 800; margin: 0.5rem 0 0; color: #fff; }

.status-pending { color: var(--warn); font-weight: 700; }
.status-done { color: var(--open); font-weight: 700; }
.status-failed { color: var(--danger); font-weight: 700; }
.status-cancelled { color: var(--muted); }

.note-body { margin: 0.4rem 0; }
.note-body p { margin: 0.4rem 0; }
.note-body p:first-child { margin-top: 0; }
.note-body p:last-child { margin-bottom: 0; }
.note-body a { font-weight: 600; }
.note-body pre, .note-body code { font-family: var(--mono); }
.note-body pre {
  background: var(--field); border: 1px solid var(--line); border-radius: 10px;
  padding: 0.6rem 0.8rem; overflow: auto;
}
.note-body ul, .note-body ol { margin: 0.4rem 0; padding-left: 1.4rem; }
.note-body blockquote {
  margin: 0.4rem 0; padding-left: 0.8rem; border-left: 3px solid var(--cyan); color: var(--soft);
}
details.edit-note { background: transparent; border: 0; padding: 0; margin: 0.6rem 0 0; }
details.edit-note summary {
  display: inline-block; font-family: var(--mono); font-weight: 800; color: var(--text);
  background: rgba(4, 22, 21, 0.7); border: 1px solid var(--line); border-radius: 10px;
  padding: 0.3rem 0.8rem; list-style: none; cursor: pointer;
}
details.edit-note summary:hover { border-color: var(--cyan); background: rgba(56, 232, 214, 0.14); }
details.edit-note summary::-webkit-details-marker { display: none; }
details.edit-note[open] summary { margin-bottom: 0.6rem; }

/* Discord ID tooltips: name visible, ID on hover/focus, selectable. */
.has-id {
  position: relative; display: inline; border-bottom: 1px dotted var(--muted);
  cursor: help; text-decoration: none;
}
a.has-id { color: var(--cyan-2); }
a.has-id:hover { color: #fff; }
.has-id .id-tip {
  position: absolute; left: 0; top: calc(100% + 6px); z-index: 20; display: none;
  padding: 0.25rem 0.55rem; background: #02100f; color: var(--cyan-2);
  border: 1px solid var(--cyan); border-radius: 8px; box-shadow: 0 0 20px rgba(56, 232, 214, 0.25);
  font-family: var(--mono); font-size: 0.85rem; font-weight: 700; letter-spacing: 0;
  white-space: nowrap; user-select: all; pointer-events: auto;
}
.has-id:hover .id-tip, .has-id:focus .id-tip,
.has-id:focus-visible .id-tip, .has-id:focus-within .id-tip { display: block; }

/* --- hosting and servers ------------------------------------------------ */
.platforms { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.platform-form { margin: 0; display: inline; }
main button.platform {
  font-family: var(--mono); font-weight: 800; font-size: 0.9rem; padding: 0.4rem 0.75rem;
  border-radius: 10px; box-shadow: none;
}
main button.platform.on { background: rgba(14, 90, 64, 0.7); color: #c9f7e1 !important; border-color: var(--open); }
main button.platform.off { background: rgba(4, 22, 21, 0.7); color: var(--muted) !important; border-color: var(--line); }
main button.platform:hover { filter: brightness(1.25); box-shadow: none; }

.chip {
  display: inline-block; font-family: var(--mono); font-size: 0.8rem; font-weight: 800;
  padding: 0.05rem 0.5rem; border-radius: 6px; border: 1px solid var(--line);
  background: rgba(4, 22, 21, 0.7); color: var(--soft);
}
.chip.java, .chip.done, .chip.set { background: rgba(14, 90, 64, 0.7); border-color: var(--open); color: #c9f7e1; }
.chip.bedrock { background: rgba(20, 60, 110, 0.6); border-color: #6fa8e8; color: #cfe4ff; }
.chip.pending, .chip.unset { background: var(--tag-bg); border-color: var(--ember); color: #ffd7ae; }
.chip.failed { background: var(--danger-bg); border-color: var(--danger); color: #ffd9d9; }

/* In-place updates: a small spinner beside "Working…" and busy forms */
.spinner {
  display: inline-block; width: 0.9em; height: 0.9em; vertical-align: -0.1em;
  border: 2px solid var(--cyan); border-right-color: transparent; border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
form.busy { opacity: 0.6; }
[data-live-region] { transition: opacity 0.2s; }

@media (max-width: 760px) {
  main { padding: 1.2rem 0.9rem 0.5rem; }
  table.kv th { width: auto; }
  /* Wide data tables scroll sideways inside the card instead of the whole page. */
  table:not(.kv) { display: block; overflow-x: auto; }
  .bar { justify-content: center; }
}

/* --- motion and contrast preferences ----------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .art img, .glow, .l-btn.primary { animation: none; }
  .spinner { animation: none; border-right-color: var(--cyan); }
  .card, .l-btn, .guilds li { transition: none; }
  .card:hover { transform: none; }
  html { scroll-behavior: auto; }
}
@media (prefers-contrast: more) {
  :root { --soft: #d3ece8; --muted: #c4dedb; --line: rgba(143, 246, 234, 0.7); }
  .veil { background: rgba(4, 16, 15, 0.9); }
}
.foot .version { white-space: nowrap; }
.foot .copy { display: block; margin-top: 0.45rem; }


label.check code {
  white-space: nowrap;
}

/* Linked extra accounts on the user page (#40). */
.extras label.check { display: block; font-weight: 400; }
.extras .error-text { color: var(--danger); }
.extras-list td form.inline button { padding: 0.2rem 0.7rem; }
/* Adding and editing extras on the dashboard (#64). */
.extras ul.states, .extra-requests ul { margin: 0; padding-left: 0; list-style: none; }
.extras .state { font-size: 0.8em; padding: 0 0.4em; border-radius: 0.3em; border: 1px solid var(--muted); white-space: nowrap; }
.extras .state-whitelisted, .extras .state-done { border-color: var(--open); color: var(--open); }
.extras .state-pending, .extras .state-not-yet { border-color: var(--warn); color: var(--warn); }
.extras .state-failed { border-color: var(--danger); color: var(--danger); }
.extras td.actions details { margin-bottom: 0.3rem; }
.extras details.edit-extra label, .extras details.add-extra label { display: block; margin: 0.3rem 0; }


/* Published member docs at /docs. Article typography, not the boxed notes preview. */
main.docs { max-width: 52rem; }
.docs-list { list-style: none; margin: 1rem 0 0; padding: 0; }
.docs-list li { margin: 0 0 1rem; padding: 0 0 1rem; border-bottom: 1px solid var(--line-soft); }
.docs-list li:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: 0; }
.docs-list a { font-weight: 700; font-size: 1.1rem; text-decoration: none; }
.docs-list p { margin: 0.35rem 0 0; color: var(--soft); }
.docs-page .crumbs { margin-bottom: 1rem; }
.docs-body h1 { font-size: clamp(1.5rem, 3.5vw, 2rem); }
.docs-body h2 { margin-top: 1.8rem; }
.docs-body h3 { margin-top: 1.3rem; }
.docs-body p, .docs-body ul, .docs-body ol { margin: 0.7rem 0; }
.docs-body li { margin: 0.25rem 0; }
.docs-body a { font-weight: 600; }
.docs-body blockquote {
  margin: 0.9rem 0; padding: 0.2rem 0 0.2rem 0.9rem;
  border-left: 3px solid var(--cyan); color: var(--soft);
}
.docs-body pre,
.docs-diagram {
  background: var(--field); border: 1px solid var(--line); border-radius: 10px;
  padding: 0.8rem 1rem; overflow: auto; margin: 1rem 0;
}
.docs-diagram { padding: 0.9rem 1rem 1rem; }
.docs-diagram figcaption {
  font-family: var(--mono); font-size: 0.85rem; font-weight: 700;
  color: var(--cyan); letter-spacing: 0.06em; text-transform: uppercase;
  margin: 0 0 0.6rem;
}
.docs-diagram-src {
  margin: 0; padding: 0; background: transparent; border: 0;
  font-family: var(--mono); font-size: 0.9rem; line-height: 1.45; white-space: pre-wrap;
}
.docs-body img {
  display: block; max-width: 100%; height: auto; margin: 0.8rem 0;
  border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}
.docs-body code { word-break: break-word; }

.docs-table-wrap {
  overflow-x: auto;
  margin: 1rem 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--field);
}
.docs-table-wrap table {
  display: table;
  margin: 0;
  width: 100%;
  border-collapse: collapse;
}
.docs-body th, .docs-body td {
  padding: 0.65rem 0.8rem;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
  text-align: left;
}
.docs-body thead th {
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--cyan-2);
  background: rgba(56, 232, 214, 0.08);
  border-bottom: 1px solid var(--line);
}
.docs-body tbody tr:last-child td { border-bottom: 0; }
