/* ========================================================================
   Utility page shell. The quiet, paper side of the institution: one column,
   mono labels, ink type. Self-contained so utility pages never load the
   homepage stylesheet. Golden-ratio scale: 11 / 18 / 29 / 47.
   ======================================================================== */

:root {
  --u-paper: #f4eee4;
  --u-paper-2: #fbf7ef;
  --u-ink: #15120e;
  --u-muted: rgba(21, 18, 14, .58);
  --u-faint: rgba(21, 18, 14, .34);
  --u-line: rgba(21, 18, 14, .16);
  --u-gold: #d49a16;
  --u-blue: #2e79b7;
  --u-red: #c84235;
  --u-sans: system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --u-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --phi-1: 11px;
  --phi-2: 18px;
  --phi-3: 29px;
  --phi-4: 47px;
  --phi-5: 76px;
}

* { box-sizing: border-box; }

/* A utility pane: paper, ink, the site's type scale. */
.u-page {
  color: var(--u-ink);
  font-family: var(--u-sans);
  font-size: 17px;
  line-height: 1.618;
  -webkit-font-smoothing: antialiased;
  max-width: 1040px;
  margin: 0 auto;
  padding: var(--phi-5) clamp(22px, 6vw, 76px) var(--phi-5);
}

/* ------------------------------------------------------------- header -- */
.u-head {
  display: grid;
  gap: var(--phi-2);
  padding-bottom: var(--phi-3);
  margin-bottom: var(--phi-4);
  border-bottom: 1px solid var(--u-line);
}
.u-kicker {
  display: flex;
  align-items: center;
  gap: var(--phi-1);
  margin: 0;
  color: var(--u-muted);
  font-family: var(--u-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
}
.u-kicker a { color: inherit; text-decoration: none; }
.u-kicker a:hover { color: var(--u-ink); }
.u-kicker i { width: 18px; height: 1px; background: var(--u-line); }
.u-head h1 {
  margin: 0;
  font-size: clamp(29px, 3.2vw, 47px);
  font-weight: 500;
  letter-spacing: -.01em;
  line-height: 1.1;
}
.u-head p {
  max-width: 62ch;
  margin: 0;
  color: var(--u-muted);
  font-size: 18px;
}

/* ------------------------------------------------------------ content -- */
.u-section { margin-bottom: var(--phi-4); }
.u-section > h2 {
  margin: 0 0 var(--phi-2);
  color: var(--u-muted);
  font-family: var(--u-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
}

.u-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--phi-1);
  min-height: 44px;
  padding: 0 var(--phi-3);
  border: 1px solid var(--u-ink);
  border-radius: 0;
  background: var(--u-ink);
  color: var(--u-paper);
  font-family: var(--u-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .18s ease, color .18s ease;
}
.u-button:hover { background: var(--u-paper-2); color: var(--u-ink); }
.u-button:focus-visible { outline: 2px solid var(--u-blue); outline-offset: 3px; }
.u-button:disabled { opacity: .4; cursor: wait; }
.u-button--quiet { background: transparent; color: var(--u-ink); border-color: var(--u-line); }
.u-button--quiet:hover { border-color: var(--u-ink); }
.u-button--gold { background: var(--u-gold); border-color: var(--u-gold); color: var(--u-ink); }
.u-button--gold:hover { background: var(--u-paper-2); }
.u-button--big { min-height: 76px; padding: 0 var(--phi-5); font-size: 13px; }

.u-steps { margin: 0 0 var(--phi-3); padding-left: 1.4em; line-height: 1.7; }
.u-linkbox { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 8px; }
.u-linkbox code { flex: 1 1 260px; padding: 12px 14px; border: 1px solid var(--u-line); background: var(--u-paper-2); font-family: var(--u-mono); font-size: 13px; letter-spacing: .04em; user-select: all; overflow-wrap: anywhere; }
.u-status {
  margin: var(--phi-2) 0 0;
  color: var(--u-muted);
  font-family: var(--u-mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.u-status[data-tone="ok"] { color: #2f7a3a; }
.u-status[data-tone="bad"] { color: var(--u-red); }

/* --------------------------------------------------------------- form -- */
.u-form {
  display: grid;
  gap: var(--phi-2);
  max-width: 640px;
}
.u-field { display: grid; gap: 6px; }
.u-field[hidden], .u-section[hidden] { display: none; }
.u-field span {
  color: var(--u-muted);
  font-family: var(--u-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
}
.u-field input,
.u-field textarea,
.u-field select {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--u-line);
  border-radius: 0;
  background: var(--u-paper-2);
  color: var(--u-ink);
  font: inherit;
  font-size: 16px;
}
.u-field textarea { min-height: 96px; resize: vertical; }
.u-field input:focus,
.u-field textarea:focus,
.u-field select:focus { outline: 2px solid var(--u-blue); outline-offset: 1px; border-color: var(--u-ink); }

/* ---------------------------------------------------------------- list -- */
.u-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--u-line);
}
.u-list > li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--phi-2);
  align-items: start;
  padding: var(--phi-2) 0;
  border-bottom: 1px solid var(--u-line);
}
.u-list h3 { margin: 0 0 4px; font-size: 18px; font-weight: 600; }
.u-list h3 a { color: inherit; text-decoration: none; border-bottom: 1px solid var(--u-line); }
.u-list h3 a:hover { border-color: var(--u-ink); }
.u-list p { margin: 0; color: var(--u-muted); }
.u-meta {
  margin-top: 6px;
  color: var(--u-faint);
  font-family: var(--u-mono);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.u-empty {
  padding: var(--phi-3) 0;
  color: var(--u-faint);
  font-family: var(--u-mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.u-link-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--u-muted);
  font-family: var(--u-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  cursor: pointer;
}
.u-link-button:hover { color: var(--u-red); }

/* --------------------------------------------------------------- table -- */
.u-table-wrap { overflow-x: auto; border-top: 1px solid var(--u-line); }
.u-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}
.u-table th {
  padding: 12px 14px 12px 0;
  border-bottom: 1px solid var(--u-line);
  color: var(--u-muted);
  font-family: var(--u-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .2em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}
.u-table td {
  padding: 12px 14px 12px 0;
  border-bottom: 1px solid var(--u-line);
  vertical-align: middle;
}
.u-table select {
  padding: 6px 8px;
  border: 1px solid var(--u-line);
  background: var(--u-paper-2);
  color: var(--u-ink);
  font: inherit;
  font-size: 14px;
}
.u-table .is-banned td { color: var(--u-faint); }
.u-pill {
  display: inline-block;
  padding: 3px 8px;
  border: 1px solid var(--u-line);
  font-family: var(--u-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.u-pill[data-tone="admin"] { border-color: var(--u-gold); color: #8a6410; }
.u-pill[data-tone="member"] { border-color: var(--u-blue); color: var(--u-blue); }
.u-pill[data-tone="open"] { border-color: #2f7a3a; color: #2f7a3a; }

.u-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--phi-2);
}
.u-card {
  padding: var(--phi-2);
  border: 1px solid var(--u-line);
  background: var(--u-paper-2);
}
.u-card h3 { margin: 0 0 6px; font-size: 18px; font-weight: 600; }
.u-card p { margin: 0; color: var(--u-muted); font-size: 15px; }

@media (max-width: 640px) {
  .u-page { padding-top: var(--phi-4); }
  .u-list > li { grid-template-columns: 1fr; }
}

/* ======================================================================
   Guild admin — working build: black on white, nothing decorative.
   Styling comes later. Scoped so it cannot leak into the rest of the shell.
   ====================================================================== */
.u-guild { max-width: 1200px; margin: 0 auto; padding: 24px; background: #fff; color: #000; font: 14px/1.45 system-ui, sans-serif; }
.u-guild h1 { margin: 0 0 4px; font-size: 20px; }
.u-guild h2 { margin: 24px 0 8px; font-size: 15px; }
.u-guild h3 { margin: 16px 0 6px; font-size: 14px; }
.u-guild .muted { color: #666; }
.u-guild .bar { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; margin: 12px 0 16px; padding: 10px 0; border-top: 1px solid #000; border-bottom: 1px solid #000; }
.u-guild .tabs button { background: none; border: 1px solid #000; padding: 5px 10px; cursor: pointer; font: inherit; }
.u-guild .tabs button[aria-selected="true"] { background: #000; color: #fff; }
.u-guild table { width: 100%; border-collapse: collapse; font-size: 13px; }
.u-guild th, .u-guild td { padding: 6px 8px; border-bottom: 1px solid #ccc; text-align: left; vertical-align: top; }
.u-guild th { border-bottom: 1px solid #000; font-weight: 600; white-space: nowrap; }
.u-guild tr.row { cursor: pointer; }
.u-guild tr.row:hover, .u-guild tr.row.is-selected { background: #f2f2f2; }
.u-guild tr.is-banned td { color: #999; text-decoration: line-through; }
.u-guild button, .u-guild select, .u-guild input, .u-guild textarea { font: inherit; color: #000; background: #fff; border: 1px solid #000; padding: 4px 8px; border-radius: 0; }
.u-guild button { cursor: pointer; }
.u-guild button.primary { background: #000; color: #fff; }
.u-guild button.linkish { border: 0; padding: 0; text-decoration: underline; }
.u-guild button:disabled { opacity: .4; cursor: default; }
.u-guild form.inline { display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-start; margin: 6px 0; }
.u-guild form.inline input[type=text] { flex: 1; min-width: 160px; }
.u-guild .panel { margin-top: 16px; padding: 16px; border: 1px solid #000; }
.u-guild .grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 24px; }
.u-guild .kv { display: grid; grid-template-columns: 120px 1fr; gap: 4px 10px; }
.u-guild .kv span:nth-child(odd) { color: #666; }
.u-guild .log { margin: 0; padding: 0; list-style: none; }
.u-guild .log li { padding: 6px 0; border-bottom: 1px solid #ddd; }
.u-guild .log small { color: #666; display: block; }
.u-guild .flag-red { font-weight: 700; }
.u-guild .flag-red::before { content: "RED  "; }
.u-guild .status { margin: 8px 0 0; min-height: 1.4em; }
.u-guild [hidden] { display: none !important; }
.u-guild code { font-family: ui-monospace, monospace; }

/* ---- project pulse cards on the dashboard ---- */
.pulse-jewel { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; vertical-align: baseline; }
.pulse-bar { height: 5px; border-radius: 3px; background: rgba(21,18,14,.08); overflow: hidden; margin: 10px 0 8px; }
.pulse-bar i { display: block; height: 100%; border-radius: 3px; }

/* ---- the workspace: tiles on a desk ---- */
.ws-page { max-width: none; }
.ws-bar { display: flex; gap: 10px; align-items: center; margin: 0 0 14px; position: relative; }
.ws-add-wrap { position: relative; }
.ws-menu {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 60;
  background: var(--parchment, #f5efe4); border: 1px solid rgba(21,18,14,.18);
  border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.18); padding: 6px; min-width: 170px;
  display: flex; flex-direction: column;
}
.ws-menu-item {
  background: none; border: 0; font: inherit; font-size: 13.5px; text-align: left;
  padding: 8px 12px; cursor: pointer; border-radius: 7px; color: inherit;
}
.ws-menu-item:hover { background: rgba(21,18,14,.06); }
.ws-board { position: relative; min-height: 400px; }
.ws-tile {
  position: absolute; display: flex; flex-direction: column;
  background: var(--parchment, #fbf7ef);
  border: 1px solid rgba(21,18,14,.16); border-radius: 12px;
  box-shadow: 0 3px 14px rgba(0,0,0,.08); overflow: hidden;
  min-width: 140px;
}
.ws-tile.lift { box-shadow: 0 14px 40px rgba(0,0,0,.22); z-index: 40; opacity: .96; }
.ws-tile-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 12px; cursor: grab; user-select: none; touch-action: none;
  font-size: 11px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase;
  color: rgba(21,18,14,.55); border-bottom: 1px solid rgba(21,18,14,.1);
  background: rgba(21,18,14,.025);
}
.ws-tile-head:active { cursor: grabbing; }
.ws-x { background: none; border: 0; font-size: 16px; line-height: 1; cursor: pointer; color: rgba(21,18,14,.4); padding: 0 2px; }
.ws-x:hover { color: rgba(21,18,14,.8); }
.ws-tile-body { flex: 1; min-height: 0; }
.ws-tile-body iframe { width: 100%; height: 100%; border: 0; display: block; }
.ws-native { overflow-y: auto; padding: 10px 14px; }
.ws-row { padding: 6px 0; font-size: 13.5px; line-height: 1.45; border-bottom: 1px solid rgba(21,18,14,.06); }
.ws-pulse-row b { display: flex; align-items: center; font-weight: 600; }
.ws-empty { padding: 18px 0; }
.ws-grip {
  position: absolute; right: 0; bottom: 0; width: 18px; height: 18px;
  cursor: nwse-resize; touch-action: none;
  background: linear-gradient(135deg, transparent 50%, rgba(21,18,14,.28) 50%);
  border-bottom-right-radius: 12px;
}

/* ===================== workspace, dressed ===================== */
/* Drafting paper under the tiles: a quiet dot grid that reads as intent. */
.ws-board {
  background-image: radial-gradient(rgba(21,18,14,.06) 1px, transparent 1px);
  background-size: 32px 32px;
  border: 1px solid rgba(21,18,14,.1);
  border-radius: 16px;
  padding: 2px;
}
.ws-bar { margin-bottom: 16px; }
.ws-bar .u-button {
  font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase;
  border-radius: 999px; padding: 8px 18px;
}
.ws-tile {
  border: 1px solid rgba(21,18,14,.14);
  border-radius: 14px;
  background: #fbf8f1;
  box-shadow:
    0 1px 2px rgba(21,18,14,.05),
    0 6px 22px rgba(21,18,14,.07);
  transition: box-shadow .22s ease, transform .22s ease;
}
.ws-tile:hover { box-shadow: 0 2px 4px rgba(21,18,14,.06), 0 12px 34px rgba(21,18,14,.11); }
.ws-tile.lift {
  transform: scale(1.004);
  box-shadow: 0 4px 10px rgba(21,18,14,.1), 0 26px 70px rgba(21,18,14,.22);
  opacity: 1;
}
.ws-tile-head {
  padding: 8px 14px;
  font-size: 10px; letter-spacing: .24em;
  color: rgba(21,18,14,.52);
  background: linear-gradient(rgba(21,18,14,.028), rgba(21,18,14,.012));
  border-bottom: 1px solid rgba(21,18,14,.09);
}
.ws-tile-title { display: inline-flex; align-items: center; gap: 8px; }
.ws-jewel { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex: none; }
.ws-x { transition: color .15s ease, transform .15s ease; }
.ws-x:hover { transform: scale(1.15); }
.ws-tile-body { background: #fdfbf6; }
.ws-native { padding: 12px 16px; }
.ws-row { border-bottom: 1px solid rgba(21,18,14,.055); padding: 7px 0; }
.ws-row .u-meta { font-size: 10.5px; letter-spacing: .06em; opacity: .75; }
.ws-empty { text-align: center; letter-spacing: .16em; font-size: 10.5px; text-transform: uppercase; }
.ws-grip {
  width: 22px; height: 22px;
  background:
    linear-gradient(135deg, transparent 62%, rgba(21,18,14,.22) 62%, rgba(21,18,14,.22) 68%, transparent 68%,
      transparent 76%, rgba(21,18,14,.22) 76%, rgba(21,18,14,.22) 82%, transparent 82%);
  border-bottom-right-radius: 14px;
  opacity: .7; transition: opacity .15s ease;
}
.ws-grip:hover { opacity: 1; }
.ws-menu { border-radius: 12px; padding: 8px; box-shadow: 0 6px 16px rgba(21,18,14,.1), 0 18px 50px rgba(21,18,14,.18); }
.ws-menu-item { font-size: 12.5px; letter-spacing: .04em; padding: 9px 14px; }
.pulse-bar { height: 4px; }
