/* =========================================================================
   Guild site theme - dark stone, aged gold, Celtic interlace.
   ========================================================================= */

:root {
  --ink:        #0c0a08;
  --stone-900:  #141110;
  --stone-800:  #1c1815;
  --stone-700:  #26211c;
  --stone-600:  #332b24;
  --stone-500:  #463c32;

  --gold:       #c9a227;
  --gold-bright:#f0d98d;
  --gold-dim:   #7d6420;
  --parchment:  #e8dcc0;
  --text:       #d9cfbe;
  --text-dim:   #9a8f7d;
  --text-faint: #6f6656;

  --jade:       #4f9d8f;
  --blood:      #b8432f;
  --violet:     #9a7fbf;
  --azure:      #6f8fd0;
  --bone:       #cfc4a8;

  --ok:    #6fae5f;
  --warn:  #d9a441;
  --bad:   #c4513b;

  --radius: 3px;
  --shadow: 0 10px 30px rgba(0,0,0,.55);

  --font-display: 'Cinzel', Georgia, 'Times New Roman', serif;
  --font-body: 'Spectral', Georgia, serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', Consolas, monospace;

  --zoom: 1;
}

/*
 * BIG SCREENS. On a very large screen the whole site is drawn larger, the way
 * the browser's own zoom would draw it, so a 4K monitor at 100% scaling shows
 * the page a 1080p monitor does - the same proportion of the screen, words
 * that can be read from a chair - rather than a narrow column in a field of
 * background. One step at a time, and every step asks for height as well as
 * width, so an ultrawide (wide, not tall) is not blown up past its height.
 * Below the first step - laptops, 1080p and 1200p monitors, anything the
 * operating system already scales up - nothing changes.
 *
 *   screen, in CSS px      zoom   typically
 *   2400 x 1150 and up     1.25   1440p at 100%, 4K at 150%, 3440 x 1440
 *   2880 x 1380 and up     1.5    4K at 125%
 *   3360 x 1600 and up     1.75
 *   3700 x 1800 and up     2      4K at 100%
 *   4800 x 2300 and up     2.5    5K at 100%
 *   5800 x 2800 and up     3      8K
 *
 * Each step leaves the page at least about 1920 x 920 of the site's own pixels.
 *
 * --zoom repeats the number for the few rules measured in the screen itself.
 * Under zoom a vw or a vh is multiplied like a px - 100vh is twice the screen at
 * zoom 2 - so those rules divide by --zoom to keep meaning what they say. It is
 * all inside @supports, so a browser without zoom is never told to divide by a
 * zoom it is not drawing. Media queries are unaffected: they measure the screen
 * whatever the page's zoom, which is also why these steps cannot feed back on
 * themselves.
 */
@supports (zoom: 2) {
  @media (min-width: 2400px) and (min-height: 1150px) { :root { --zoom: 1.25; zoom: 1.25; } }
  @media (min-width: 2880px) and (min-height: 1380px) { :root { --zoom: 1.5; zoom: 1.5; } }
  @media (min-width: 3360px) and (min-height: 1600px) { :root { --zoom: 1.75; zoom: 1.75; } }
  @media (min-width: 3700px) and (min-height: 1800px) { :root { --zoom: 2; zoom: 2; } }
  @media (min-width: 4800px) and (min-height: 2300px) { :root { --zoom: 2.5; zoom: 2.5; } }
  @media (min-width: 5800px) and (min-height: 2800px) { :root { --zoom: 3; zoom: 3; } }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(201,162,39,.10), transparent 60%),
    linear-gradient(180deg, var(--stone-900), var(--ink) 60%);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Faint interlace weave over the whole page */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: .09;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60' viewBox='0 0 60 60'%3E%3Cg fill='none' stroke='%23c9a227' stroke-width='1'%3E%3Cpath d='M0,30 C15,30 15,0 30,0 C45,0 45,30 60,30'/%3E%3Cpath d='M0,30 C15,30 15,60 30,60 C45,60 45,30 60,30'/%3E%3C/g%3E%3C/svg%3E");
}

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ---- typography --------------------------------------------------------- */

h1, h2, h3, h4, .display {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--gold-bright);
  margin: 0 0 .5em;
  line-height: 1.25;
}

h1 { font-size: 1.9rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-bright); text-decoration: underline; text-underline-offset: 3px; }

code, kbd, pre { font-family: var(--font-mono); font-size: .875em; }
pre {
  background: var(--ink);
  border: 1px solid var(--stone-600);
  border-radius: var(--radius);
  padding: 12px 14px;
  overflow-x: auto;
}
code:not(pre code) {
  background: rgba(0,0,0,.4);
  border: 1px solid var(--stone-600);
  border-radius: 2px;
  padding: 1px 5px;
  color: var(--gold-bright);
}

hr.knot {
  border: 0;
  height: 30px;
  margin: 28px 0;
  background: center/auto 26px no-repeat
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='26' viewBox='0 0 120 26'%3E%3Cg fill='none' stroke='%237d6420' stroke-width='2'%3E%3Cpath d='M0,13 H36'/%3E%3Cpath d='M84,13 H120'/%3E%3Cpath d='M60,3 C69,12 69,16 60,23 C51,16 51,12 60,3 Z'/%3E%3Cpath d='M48,21 C49,10 55,6 63,9 C60,17 55,21 48,21 Z'/%3E%3Cpath d='M72,21 C71,10 65,6 57,9 C60,17 65,21 72,21 Z'/%3E%3C/g%3E%3C/svg%3E");
}

/* ---- the Celtic frame --------------------------------------------------- */

.panel {
  position: relative;
  background:
    linear-gradient(180deg, rgba(38,33,28,.92), rgba(20,17,16,.94));
  border: 26px solid transparent;
  border-image-source: url('/img/frame-celtic.svg');
  border-image-slice: 46;
  border-image-repeat: round;
  border-image-width: 26px;
  padding: 4px 18px 16px;
  margin: 0 0 26px;
  box-shadow: var(--shadow);
  z-index: 1;
}

/* A lighter box for dense content where the full frame is too busy */
.box {
  position: relative;
  background: linear-gradient(180deg, rgba(38,33,28,.7), rgba(20,17,16,.8));
  border: 1px solid var(--stone-600);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 16px;
  z-index: 1;
}
.box::before,
.box::after {
  content: '';
  position: absolute;
  width: 14px; height: 14px;
  border: 2px solid var(--gold-dim);
  pointer-events: none;
}
.box::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.box::after { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }

.panel > h2:first-child,
.panel > .panel-head { margin-top: 0; }

.panel-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--stone-600);
}
.panel-head h2 { margin: 0; flex: 1 1 auto; }
.panel-head .spacer { flex: 1 1 auto; }

.panel-icon {
  width: 34px; height: 34px;
  color: var(--gold);
  flex: 0 0 auto;
  filter: drop-shadow(0 0 6px rgba(201,162,39,.35));
}

/* ---- app shell ---------------------------------------------------------- */

.app { position: relative; z-index: 1; }

.boot {
  min-height: calc(70vh / var(--zoom));
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  color: var(--text-dim);
}
.boot-mark { width: 72px; height: 72px; color: var(--gold-dim); animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: .35; } 50% { opacity: .9; } }

.masthead {
  border-bottom: 2px solid var(--stone-700);
  background: linear-gradient(180deg, rgba(20,17,16,.96), rgba(12,10,8,.9));
  position: relative;
}
.masthead::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -6px;
  height: 6px;
  background: repeating-linear-gradient(90deg,
    var(--gold-dim) 0 10px, transparent 10px 22px);
  opacity: .5;
}

.masthead-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 16px 22px;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.crest {
  width: 58px; height: 58px;
  color: var(--gold);
  flex: 0 0 auto;
  filter: drop-shadow(0 2px 8px rgba(201,162,39,.4));
}

.brand { flex: 1 1 260px; min-width: 0; }
.brand h1 {
  font-size: clamp(1.15rem, calc(2.4vw / var(--zoom)), 1.75rem);
  margin: 0;
  text-shadow: 0 2px 10px rgba(0,0,0,.8);
}
.brand p {
  margin: 2px 0 0;
  color: var(--text-faint);
  font-style: italic;
  font-size: .9rem;
}

.whoami {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .875rem;
  flex: 0 0 auto;
}
.whoami .name { color: var(--parchment); font-weight: 600; }

/* ---- navigation --------------------------------------------------------- */

.nav {
  background: rgba(8,7,6,.75);
  border-bottom: 1px solid var(--stone-700);
}
/*
 * One row that WRAPS, never one that scrolls. It used to scroll sideways, and
 * with every menu showing - ten items, two with badges - it needed 1355 px of a
 * 1240 px column, so Admin sat past the edge behind a hairline scrollbar that
 * nobody could see, and a mouse wheel does not scroll sideways at all. The
 * spacing is tight enough that all ten fit one row at full width (about
 * 1210 px); anything narrower, or a menu added later, drops onto a second row
 * where it can be seen and clicked. Phones have their own two-row layout
 * further down.
 */
.nav-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 14px;
  display: flex;
  flex-wrap: wrap;
}
.nav a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  color: var(--text-dim);
  font-family: var(--font-display);
  font-size: .8rem;
  letter-spacing: .07em;
  text-transform: uppercase;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  transition: color .15s, border-color .15s, background .15s;
}
.nav a:hover { color: var(--gold-bright); background: rgba(201,162,39,.07); text-decoration: none; }
.nav a.active {
  color: var(--gold-bright);
  border-bottom-color: var(--gold);
  background: linear-gradient(180deg, rgba(201,162,39,.12), transparent);
}
.nav a svg { width: 17px; height: 17px; opacity: .85; }

/* Pending applications. Loud on purpose - this is the one nav item that is a
   queue, and an unread queue should nag. */
.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--bad);
  color: #fff;
  font-family: var(--font-body, inherit);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1;
  box-shadow: 0 0 0 1px rgba(0,0,0,.45), 0 0 10px rgba(196,81,59,.55);
  animation: badge-pulse 2.4s ease-in-out infinite;
}
.nav a:hover .nav-badge, .nav a.active .nav-badge { animation: none; }

@keyframes badge-pulse {
  0%, 100% { box-shadow: 0 0 0 1px rgba(0,0,0,.45), 0 0 10px rgba(196,81,59,.55); }
  50%      { box-shadow: 0 0 0 1px rgba(0,0,0,.45), 0 0 16px rgba(196,81,59,.95); }
}

@media (prefers-reduced-motion: reduce) {
  .nav-badge { animation: none; }
}

main {
  max-width: 1240px;
  margin: 0 auto;
  padding: 28px 22px 80px;
}

.site-foot {
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px 22px 40px;
  color: var(--text-faint);
  font-size: .8rem;
  text-align: center;
  border-top: 1px solid var(--stone-700);
}

/* ---- forms and controls -------------------------------------------------- */

label { display: block; font-size: .8rem; color: var(--text-dim); margin-bottom: 5px; letter-spacing: .04em; text-transform: uppercase; }

input[type=text], input[type=password], input[type=email], input[type=number],
input[type=search], input[type=datetime-local], input[type=date], select, textarea {
  width: 100%;
  background: var(--ink);
  border: 1px solid var(--stone-600);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-body);
  font-size: .95rem;
  padding: 9px 11px;
  transition: border-color .15s, box-shadow .15s;
}
textarea { font-family: var(--font-mono); font-size: .85rem; line-height: 1.65; resize: vertical; min-height: 140px; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,162,39,.16);
}
input::placeholder, textarea::placeholder { color: var(--text-faint); }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--gold) 50%), linear-gradient(135deg, var(--gold) 50%, transparent 50%); background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 30px; }

.field { margin-bottom: 14px; }
.field-row { display: flex; gap: 12px; flex-wrap: wrap; }
.field-row > .field { flex: 1 1 180px; margin-bottom: 14px; }
.hint { font-size: .78rem; color: var(--text-faint); margin-top: 4px; text-transform: none; letter-spacing: 0; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-display);
  font-size: .8rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 9px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--stone-500);
  background: linear-gradient(180deg, var(--stone-700), var(--stone-800));
  color: var(--text);
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.btn:hover { border-color: var(--gold-dim); color: var(--gold-bright); text-decoration: none; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary {
  border-color: var(--gold-dim);
  background: linear-gradient(180deg, #4a3c14, #2c2410);
  color: var(--gold-bright);
}
.btn-primary:hover { background: linear-gradient(180deg, #5d4a18, #3a2f14); box-shadow: 0 0 14px rgba(201,162,39,.25); }
.btn-danger { border-color: #6b2b20; color: #e79a8b; }
.btn-danger:hover { background: #3a1a14; border-color: var(--blood); color: #ffb3a3; }
.btn-sm { padding: 5px 10px; font-size: .7rem; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-dim); }
.btn-ghost:hover { border-color: var(--stone-500); }

.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* toggle switch used all over the permission grid */
.toggle { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; text-transform: none; letter-spacing: 0; margin: 0; }
.toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle .track {
  width: 38px; height: 21px; border-radius: 11px;
  background: var(--stone-700);
  border: 1px solid var(--stone-500);
  position: relative; flex: 0 0 auto;
  transition: background .18s, border-color .18s;
}
.toggle .track::after {
  content: '';
  position: absolute; top: 2px; left: 2px;
  width: 15px; height: 15px; border-radius: 50%;
  background: var(--text-faint);
  transition: transform .18s, background .18s;
}
.toggle input:checked + .track { background: rgba(201,162,39,.3); border-color: var(--gold); }
.toggle input:checked + .track::after { transform: translateX(17px); background: var(--gold-bright); }
.toggle input:focus-visible + .track { box-shadow: 0 0 0 3px rgba(201,162,39,.25); }
.toggle input:disabled + .track { opacity: .4; cursor: not-allowed; }
.toggle .label { font-size: .85rem; color: var(--text); }

/* ---- tables -------------------------------------------------------------- */

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th {
  text-align: left;
  font-family: var(--font-display);
  font-size: .72rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--gold-dim);
  padding: 8px 10px;
  border-bottom: 1px solid var(--stone-600);
  white-space: nowrap;
}
td { padding: 9px 10px; border-bottom: 1px solid rgba(51,43,36,.55); vertical-align: middle; }
tbody tr:hover { background: rgba(201,162,39,.05); }
td.num, th.num { text-align: right; font-family: var(--font-mono); }

/* ---- badges, pills, chips ------------------------------------------------ */

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--font-display);
  font-size: .66rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 10px;
  border: 1px solid currentColor;
  background: rgba(0,0,0,.35);
  white-space: nowrap;
}
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .74rem;
  padding: 2px 9px;
  border-radius: 3px;
  border: 1px solid var(--stone-500);
  background: rgba(0,0,0,.3);
  color: var(--text-dim);
  white-space: nowrap;
}
.chip.on { border-color: var(--gold-dim); color: var(--gold-bright); background: rgba(201,162,39,.12); }
.chip .val { font-family: var(--font-mono); font-size: .72rem; color: var(--parchment); }

/*
 * The one chip on a roster row you can press. It was the "+3" that opened a
 * row's folded tag chips; the fold is gone with the trophy case, and the class
 * is kept for what stands in the same place - the muted "Choose tags to show"
 * an owner is offered on a character with an empty case. It is a real <button>
 * so Tab and Enter reach it without any code of ours, and it wears .chip for
 * everything else - only the three things a button gets wrong are said here.
 * font: inherit because a button otherwise takes the browser's own face and
 * reads as a different typeface sitting among the chips; the size has to be
 * restated after it, since the shorthand resets that too. Hover borrows the
 * gold .chip.on wears, so the one chip you can press is the one that answers.
 */
button.chip-more { font: inherit; font-size: .74rem; cursor: pointer; }
button.chip-more:hover { border-color: var(--gold-dim); color: var(--gold-bright); }
button.chip-more:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(201,162,39,.25); }

.pill-inactive { color: var(--text-faint); border-color: var(--stone-500); }

/* ---- attendance meter ---------------------------------------------------- */

/*
 * A very dark bar with a very bright number printed over it. The number crosses
 * the fill and the empty track both, so both are dark: the bright tint clears
 * 6.5:1 on the lightest fill and 14:1 on the track. The status colour lives in
 * the border, the fill and the tint of the number.
 */
.att { display: inline-flex; align-items: center; }
.att-bar {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  width: 92px; height: 20px;
  background: #0e0c0a;
  border: 1px solid var(--att-edge, var(--stone-600));
  border-radius: 4px;
  overflow: hidden;
  flex: 0 0 auto;
}
.att-fill {
  position: absolute; inset: 0 auto 0 0;
  background: var(--att-fill);
  transition: width .4s;
}
.att-val {
  position: relative;
  font-family: var(--font-mono); font-size: .8rem; font-weight: 600;
  line-height: 1; letter-spacing: .02em;
  color: var(--att-ink);
  text-shadow: 0 1px 1px rgba(0,0,0,.6);
  font-variant-numeric: tabular-nums;
}
@media (prefers-reduced-motion: reduce) { .att-fill { transition: none; } }
.att-good { --att-fill: #2e5a24; --att-edge: #4d7a3f; --att-ink: #d8f5cc; }
.att-mid  { --att-fill: #6a4d0e; --att-edge: #8a6a1c; --att-ink: #ffe8b0; }
.att-low  { --att-fill: #7c2618; --att-edge: #9a3a28; --att-ink: #ffd3c7; }

/* ---- roster -------------------------------------------------------------- */

.roster-toolbar {
  display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end;
  margin-bottom: 20px;
}
.roster-toolbar .field { margin-bottom: 0; }
.seg {
  display: inline-flex;
  border: 1px solid var(--stone-600);
  border-radius: var(--radius);
  overflow: hidden;
}
.seg button {
  background: var(--stone-800);
  border: 0;
  color: var(--text-dim);
  font-family: var(--font-display);
  font-size: .74rem;
  letter-spacing: .07em;
  text-transform: uppercase;
  padding: 9px 14px;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.seg button + button { border-left: 1px solid var(--stone-600); }
.seg button:hover { color: var(--gold-bright); }
.seg button.on { background: linear-gradient(180deg, #4a3c14, #2c2410); color: var(--gold-bright); }

/* A table row for someone parked or retired - the standings, the raid sheet,
   and the roster's own rows. */
tr.is-inactive { opacity: .6; }

/* ---- roster: accounts and characters as rows ------------------------------- */

/* position: relative makes the table the containing block for anything absolutely
   positioned inside it - the visually hidden column labels. Without it their
   containing block was the panel OUTSIDE .table-wrap, so the scroll container
   could not clip them: the Actions label sat wherever the last column ended and
   pushed the whole page 400px wider than a phone. Scoped to the roster, rather
   than set on .table-wrap, so nothing elsewhere that is meant to spill out of
   its table is clipped by it. */
.roster-table { position: relative; }
.roster-table td { vertical-align: middle; }

/* An account row reads as the head of its group, with its characters under it. */
.acct-row td { border-bottom-color: var(--stone-600); background: rgba(0,0,0,.18); }
.acct-row td:first-child { box-shadow: inset 2px 0 0 var(--accent, var(--gold-dim)); }
.acct-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  background: none; border: 0; padding: 2px 0; margin: 0;
  color: inherit; font: inherit; cursor: pointer; text-align: left;
}
.acct-toggle .caret { color: var(--gold); width: 1em; display: inline-block; }
.acct-name { font-family: var(--font-display); font-size: 1rem; color: var(--parchment); }
.acct-toggle:hover .acct-name { color: var(--gold-bright); }

.char-sub-row td:first-child { padding-left: 34px; }

/* A character's name is the door into its sheet, so it looks like one. */
.name-btn {
  background: none; border: 0; padding: 0; margin: 0;
  font: inherit; font-weight: 600; font-size: .95rem;
  color: var(--parchment); cursor: pointer; text-align: left;
}
.name-btn:hover { color: var(--gold-bright); text-decoration: underline; text-underline-offset: 3px; }
.name-btn .main-star { color: var(--gold); font-size: .8em; }
.acct-toggle:focus-visible, .name-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 2px; }

.cell-sub { display: block; font-size: .76rem; color: var(--text-faint); }

/* ---- loot ------------------------------------------------------------------- */

.loot-table td { vertical-align: middle; }
.loot-thumb {
  width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
  object-fit: cover; border-radius: 4px;
  border: 1px solid var(--stone-600); background: var(--stone-900); color: var(--text-faint);
}
.loot-thumb .icon, .loot-thumb svg { width: 22px; height: 22px; }
/* The picture box (imagePicker in core.js): the item dialog, the character
   editor and the banner on Admin > Settings. Click, drop or paste. */
.image-drop {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 14px; text-align: center; cursor: pointer;
  border: 2px dashed var(--stone-500); border-radius: 6px;
  color: var(--text-dim); font-size: .9rem;
}
.image-drop-preview {
  display: block; max-width: 100%; max-height: 240px; margin: 0;
  border-radius: 6px; border: 1px solid var(--stone-600); background: var(--stone-900);
}
.image-drop:hover, .image-drop.over { border-color: var(--gold-dim); color: var(--parchment); }
.image-drop:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.loot-image {
  display: block; max-width: 100%; max-height: 240px; margin: 0 auto 12px;
  border-radius: 6px; border: 1px solid var(--stone-600); background: var(--stone-900);
}
.chips { display: flex; gap: 5px; flex-wrap: wrap; }
.roster-table .btn-row { justify-content: flex-end; flex-wrap: nowrap; gap: 5px; }

/* Visually hidden, still read aloud - a column heading a screen reader needs
   and a sighted reader does not. */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---- the character sheet: a drawer over the list ---------------------------- */

.drawer-back {
  position: fixed; inset: 0; z-index: 150;
  background: rgba(5,4,3,.62);
  display: flex; justify-content: flex-end;
}
.drawer {
  width: min(480px, 100%); height: 100%;
  overflow-y: auto;
  background: linear-gradient(180deg, var(--stone-800), var(--stone-900));
  border-left: 1px solid var(--gold-dim);
  box-shadow: var(--shadow);
  animation: drawerin .22s ease;
}
@keyframes drawerin { from { transform: translateX(40px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .drawer { animation: none; } }
.drawer-head {
  display: flex; align-items: center; gap: 12px;
  padding: 15px 20px;
  border-bottom: 1px solid var(--stone-600);
  position: sticky; top: 0; z-index: 1;
  background: var(--stone-800);
}
.drawer-head h2 { margin: 0; font-size: 1.15rem; flex: 1; font-family: var(--font-display); color: var(--parchment); }
.drawer-body { padding: 16px 20px 32px; }
.drawer-sub { margin: 0 0 4px; font-size: .86rem; color: var(--text-faint); }
.drawer-sub strong { color: var(--parchment); }
.drawer-section { margin-top: 20px; }
.drawer-h {
  margin: 0 0 8px;
  font-size: .72rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--gold);
}
.drawer-attendance { display: grid; gap: 8px; }
.drawer-att-row { display: grid; grid-template-columns: 5.5em 1fr; align-items: center; gap: 10px; }
.drawer-att-label { font-size: .8rem; color: var(--text-faint); font-family: var(--font-mono); }

.unclaimed-note {
  border-left: 3px solid var(--warn);
  background: rgba(217,164,65,.07);
  padding: 10px 14px;
  margin-bottom: 16px;
  font-size: .88rem;
}

/* ---- forums -------------------------------------------------------------- */

.board {
  display: flex; align-items: center; gap: 14px;
  padding: 15px 16px;
  border-bottom: 1px solid var(--stone-700);
}
.board:last-child { border-bottom: 0; }
.board:hover { background: rgba(201,162,39,.05); }
.board-icon { width: 30px; height: 30px; color: var(--gold-dim); flex: 0 0 auto; }
.board-body { flex: 1 1 auto; min-width: 0; }
.board-body h3 { margin: 0 0 2px; font-size: 1rem; }
.board-body p { margin: 0; font-size: .84rem; color: var(--text-faint); }
.board-stats { text-align: right; font-size: .78rem; color: var(--text-faint); white-space: nowrap; }

.thread-row { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-bottom: 1px solid rgba(51,43,36,.5); }
.thread-row:hover { background: rgba(201,162,39,.05); }
.thread-title { font-weight: 600; color: var(--parchment); }
.thread-title a { color: inherit; }
.thread-meta { font-size: .77rem; color: var(--text-faint); }

/* The excerpt around a post-text match. Clamped to two lines so a result list
   stays a list: an unclamped 160-character snippet in a proportional font wraps
   to three or four lines on a phone and buries the titles between them. */
.search-excerpt {
  font-size: .8rem;
  color: var(--text-faint);
  margin-top: 3px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Submit-only, so the button is part of the control rather than an afterthought
   beside it. */
.forum-search { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; }
.forum-search input { flex: 1 1 auto; min-width: 0; }

/* The pager reuses the .btn scale rather than inventing a link style, because
   its ends are SPANS - a disabled end must look like the live links it sits
   between and must not be clickable. */
.pager { display: flex; gap: 8px; align-items: center; justify-content: center; padding: 14px; flex-wrap: wrap; }
.pager .is-disabled { opacity: .45; pointer-events: none; }
.pager-at { font-size: .78rem; color: var(--text-faint); padding: 0 6px; white-space: nowrap; }

.post {
  display: grid;
  grid-template-columns: 190px 1fr;
  border: 1px solid var(--stone-600);
  border-radius: var(--radius);
  margin-bottom: 14px;
  overflow: hidden;
  background: rgba(20,17,16,.6);
}
@media (max-width: 700px) { .post { grid-template-columns: 1fr; } }
.post-author {
  background: rgba(0,0,0,.35);
  border-right: 1px solid var(--stone-700);
  padding: 14px;
  text-align: center;
}
.post-author .who { font-family: var(--font-display); color: var(--parchment); font-size: .95rem; }
.post-author .toon { font-size: .78rem; color: var(--gold-dim); }
/* min-width:0 lets the body column shrink below its longest word, and
   overflow-wrap:anywhere breaks a long link instead of pushing the post - and on
   a phone the author's name above it - off the side of the screen. */
.post > * { min-width: 0; }
.post-body { padding: 14px 18px; overflow-wrap: anywhere; }
.post-body > *:first-child { margin-top: 0; }
.post-body > *:last-child { margin-bottom: 0; }
.post-foot { font-size: .74rem; color: var(--text-faint); display: flex; gap: 10px; align-items: center; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--stone-700); }

/* ---- library ------------------------------------------------------------- */

.kind-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }

.page-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.page-card {
  display: block;
  padding: 15px 16px;
  border: 1px solid var(--stone-600);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(38,33,28,.7), rgba(18,15,13,.8));
  transition: border-color .15s, transform .15s;
}
.page-card:hover { border-color: var(--gold-dim); text-decoration: none; transform: translateY(-2px); }
.page-card h3 { margin: 0 0 5px; font-size: 1rem; }
.page-card p { margin: 0; font-size: .84rem; color: var(--text-dim); }
.page-card .tags { margin-top: 9px; display: flex; gap: 5px; flex-wrap: wrap; }

.prose { max-width: 74ch; overflow-wrap: anywhere; }
.prose h2 { margin-top: 1.6em; padding-bottom: .2em; border-bottom: 1px solid var(--stone-700); }
.prose h3 { margin-top: 1.4em; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li { margin: .3em 0; }
.prose blockquote {
  margin: 1em 0; padding: .6em 1.1em;
  border-left: 3px solid var(--gold-dim);
  background: rgba(201,162,39,.06);
  color: var(--text-dim); font-style: italic;
}
.prose table { margin: 1em 0; }
.prose img { max-width: 100%; height: auto; }
/*
 * A picture written into a post: ![alt](/its/address). Only ever a picture from
 * this site - the CSP allows no other source - so it is shown at the width of
 * the column and no larger, on its own line.
 */
.prose .post-image {
  display: block;
  margin: .8em 0;
  border: 1px solid var(--stone-700);
  border-radius: 6px;
  background: var(--stone-900);
}
/* The same thing pointing somewhere else, which can only be a link. */
.prose .img-link::before {
  content: "⧉";
  margin-right: .35em;
  opacity: .7;
}

/* ---- permission grid ----------------------------------------------------- */

.perm-module { border: 1px solid var(--stone-600); border-radius: var(--radius); margin-bottom: 12px; overflow: hidden; }
.perm-module-head {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px;
  background: rgba(0,0,0,.32);
  border-bottom: 1px solid var(--stone-700);
  flex-wrap: wrap;
}
.perm-module-head h3 { margin: 0; font-size: .95rem; }
.perm-module-head .desc { font-size: .8rem; color: var(--text-faint); flex: 1 1 100%; margin: 0; }
.perm-actions { display: grid; gap: 10px; padding: 13px 14px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.perm-action .help { font-size: .74rem; color: var(--text-faint); margin: 3px 0 0 47px; }

.role-list { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.role-card {
  border: 1px solid var(--stone-600);
  border-left: 3px solid var(--accent, var(--gold-dim));
  border-radius: var(--radius);
  padding: 13px 15px;
  background: rgba(20,17,16,.6);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.role-card:hover { background: rgba(201,162,39,.06); }
.role-card.on { border-color: var(--gold); background: rgba(201,162,39,.1); }
.role-card h3 { margin: 0 0 3px; font-size: 1rem; }
.role-card p { margin: 0; font-size: .8rem; color: var(--text-faint); }
.role-card .counts { margin-top: 8px; font-size: .74rem; color: var(--text-dim); display: flex; gap: 12px; }

/* ---- messages ------------------------------------------------------------ */

.alert { border-radius: var(--radius); padding: 11px 14px; margin-bottom: 16px; font-size: .89rem; border: 1px solid; }
.alert-error { background: rgba(184,67,47,.12); border-color: #6b2b20; color: #f0a494; }
.alert-ok { background: rgba(111,174,95,.12); border-color: #3e6135; color: #a9d69b; }
.alert-info { background: rgba(111,143,208,.1); border-color: #3c4a6b; color: #a8bde6; }
.alert-warn { background: rgba(217,164,65,.1); border-color: #6b551f; color: #e5c483; }

.empty { text-align: center; padding: 40px 20px; color: var(--text-faint); }
.empty svg { width: 54px; height: 54px; opacity: .3; margin-bottom: 12px; }

.toast-stack { position: fixed; bottom: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 9px; }
.toast {
  background: var(--stone-800);
  border: 1px solid var(--gold-dim);
  border-left-width: 3px;
  border-radius: var(--radius);
  padding: 11px 16px;
  font-size: .88rem;
  box-shadow: var(--shadow);
  animation: slidein .25s ease;
  max-width: 340px;
}
.toast.err { border-color: var(--blood); color: #f0a494; }
@keyframes slidein { from { opacity: 0; transform: translateX(30px); } }

/* ---- modal --------------------------------------------------------------- */

.modal-back {
  position: fixed; inset: 0; z-index: 150;
  background: rgba(5,4,3,.78);
  display: grid; place-items: center;
  padding: 20px;
  overflow-y: auto;
}
.modal {
  background: linear-gradient(180deg, var(--stone-800), var(--stone-900));
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: min(620px, 100%);
  max-height: calc(90vh / var(--zoom));
  overflow-y: auto;
  position: relative;
}
.modal-head {
  padding: 15px 20px;
  border-bottom: 1px solid var(--stone-600);
  display: flex; align-items: center; gap: 12px;
  position: sticky; top: 0;
  background: var(--stone-800);
  z-index: 1;
}
.modal-head h2 { margin: 0; font-size: 1.1rem; flex: 1; }
.modal-body { padding: 18px 20px; }
.modal-foot {
  padding: 14px 20px;
  border-top: 1px solid var(--stone-600);
  display: flex; gap: 10px; justify-content: flex-end;
  position: sticky; bottom: 0;
  background: var(--stone-800);
}

/* ---- the banner ------------------------------------------------------------ */

/*
 * The guild's own art, framed the way the rest of the hall is: a hairline of
 * dim gold with a ring of dark stone round it, the .box corner brackets, and a
 * shade that sinks the painted edges into the page instead of ending them in a
 * hard rectangle. The frame's background is what shows while the picture loads.
 */
.banner {
  position: relative;
  margin: 0 0 30px;
  z-index: 1;
  background: linear-gradient(180deg, var(--stone-800), var(--ink));
  border: 1px solid var(--gold-dim);
  box-shadow: var(--shadow), 0 0 0 5px rgba(12,10,8,.9), 0 0 0 6px rgba(125,100,32,.3);
}
.banner img { display: block; width: 100%; height: auto; }
.banner-shade {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(120% 100% at 50% 42%, transparent 64%, rgba(12,10,8,.5)),
    linear-gradient(180deg, transparent 76%, rgba(12,10,8,.4));
  box-shadow: inset 0 0 0 1px rgba(240,217,141,.07), inset 0 0 36px rgba(0,0,0,.4);
}
.banner::before, .banner::after {
  content: '';
  position: absolute;
  z-index: 2;
  width: 20px; height: 20px;
  border: 2px solid var(--gold);
  pointer-events: none;
  opacity: .8;
}
.banner::before { top: -8px; left: -8px; border-right: 0; border-bottom: 0; }
.banner::after { bottom: -8px; right: -8px; border-left: 0; border-top: 0; }

/* The member hall's strip: the top three-quarters of the picture - the name,
   and the party to the waist. 5:1 was tried first and cut through their faces. */
.banner-band img { aspect-ratio: 4 / 1; object-fit: cover; object-position: 50% 0; }

@media (max-width: 560px) {
  .banner { margin-bottom: 22px; }
  .banner::before, .banner::after { width: 14px; height: 14px; }
  .banner::before { top: -6px; left: -6px; }
  .banner::after { bottom: -6px; right: -6px; }
  /* A strip is a ribbon on a phone. The whole picture is barely taller. */
  .banner-band img { aspect-ratio: auto; }
}

/* An action whose module View is off counts for nothing, and looks it. */
.perm-action .perm-needs { display: none; margin: 2px 0 0 47px; font-size: .74rem; color: var(--warn); }
.perm-action.needs-view .perm-needs { display: block; }
.perm-action.needs-view .toggle .label, .perm-action.needs-view .help { opacity: .55; }

/* ---- the Hall: the welcome, and the portrait slideshow ------------------------ */

/* The slideshow's column is sized here, not by the card: a percentage width
   inside an auto track is a loop the browser settles at zero. */
.hall-welcome { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 420px); gap: 22px; align-items: center; }
.hall-welcome > :only-child { grid-column: 1 / -1; }
.hall-greeting > p:first-child { margin-top: 0; }

/*
 * A small framed card beside the welcome: the portrait on the left, the name
 * and its line on the right, crossfading. Framed like the banner - a dim gold
 * hairline, a ring of stone, the corner brackets - so the two read as one set.
 * The clock is the hairline along the bottom (see slideshow.js).
 */
.slideshow {
  position: relative;
  width: 100%;
  border: 1px solid var(--gold-dim);
  background: linear-gradient(180deg, rgba(28,24,21,.96), rgba(12,10,8,.96));
  box-shadow: var(--shadow), 0 0 0 4px rgba(12,10,8,.9), 0 0 0 5px rgba(125,100,32,.3);
  transition: opacity .3s ease, transform .3s ease;
}
.slideshow::before, .slideshow::after {
  content: ''; position: absolute; z-index: 4; width: 14px; height: 14px;
  border: 2px solid var(--gold); opacity: .75; pointer-events: none;
}
.slideshow::before { top: -6px; left: -6px; border-right: 0; border-bottom: 0; }
.slideshow::after { bottom: -6px; right: -6px; border-left: 0; border-top: 0; }
.slideshow.is-leaving { opacity: 0; transform: scale(.97); }

.slideshow-stage { position: relative; height: 180px; overflow: hidden; }
.slide {
  position: absolute; inset: 0; margin: 0;
  display: grid; grid-template-columns: 138px minmax(0, 1fr);
  opacity: 0; visibility: hidden;
  transition: opacity .9s ease, visibility 0s linear .9s;
}
.slide.is-on { opacity: 1; visibility: visible; transition: opacity .9s ease; }
/* The faces crossfade; the words do not. The leaving caption is gone before
   the new one arrives, so two names never sit on top of each other. */
.slide .slide-caption { opacity: 0; transition: opacity .25s ease; }
.slide.is-on .slide-caption { opacity: 1; transition: opacity .5s ease .45s; }
.slide-portrait { position: relative; overflow: hidden; background: var(--ink); border-right: 1px solid rgba(125,100,32,.5); }
/*
 * The portrait keeps its own aspect ratio: contained, never cropped, never
 * stretched. Behind it, the same picture covers the frame, blurred and dimmed,
 * so a portrait wider or taller than the frame sits in its own colours instead
 * of between black bars. The slow drift is on that backdrop, so the portrait
 * itself is shown whole at every moment of it.
 */
.slide-portrait img { display: block; position: absolute; inset: 0; width: 100%; height: 100%; }
.slide-portrait-main { object-fit: contain; }
.slide-portrait-fill {
  object-fit: cover;
  filter: blur(12px) brightness(.42) saturate(1.1);
  transform: scale(1.18);
}
/* A slow drift on each face's backdrop; paused with the clock. */
.slide.is-on .slide-portrait-fill { animation: slide-drift 9s ease-out both; }
@keyframes slide-drift { from { transform: scale(1.34); } to { transform: scale(1.18); } }
.slide-portrait::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  box-shadow: inset 0 0 26px rgba(0,0,0,.55), inset -12px 0 18px -10px rgba(0,0,0,.6);
}
.slide-caption {
  display: flex; flex-direction: column; justify-content: center; gap: 2px;
  padding: 14px 30px 26px 18px; min-width: 0;
}
.slide-name {
  font-family: var(--font-display); font-size: 1.15rem; line-height: 1.2;
  color: var(--gold-bright); overflow-wrap: anywhere;
  text-shadow: 0 2px 8px rgba(0,0,0,.7);
}
.slide-name .main-star { color: var(--gold); font-size: .75em; }
.slide-line { font-size: .86rem; color: var(--text); }
.slide-role { font-family: var(--font-display); font-size: .72rem; letter-spacing: .09em; text-transform: uppercase; }
.slide-account { margin-top: 5px; font-size: .78rem; color: var(--text-faint); }
.slide-account strong { color: var(--text-dim); font-weight: 600; }

/* Hiding it: there, but quiet until the frame is hovered or it has focus. */
.slideshow-hide {
  position: absolute; top: 5px; right: 5px; z-index: 3;
  width: 22px; height: 22px; padding: 0;
  display: grid; place-items: center;
  border: 0; border-radius: 50%; background: transparent;
  color: var(--text-faint); font-size: .7rem; line-height: 1; cursor: pointer;
  opacity: .3; transition: opacity .2s, color .2s, background .2s;
}
.slideshow:hover .slideshow-hide, .slideshow-hide:focus-visible { opacity: 1; }
.slideshow-hide:hover { color: var(--parchment); background: rgba(0,0,0,.5); }
.slideshow-hide:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.slideshow-hide:disabled { cursor: progress; }
@media (hover: none) { .slideshow-hide { opacity: .55; } }

.slideshow-dots {
  position: absolute; left: 138px; right: 0; bottom: 7px; z-index: 2;
  display: flex; justify-content: flex-start; gap: 2px; padding-left: 12px;
}
.slideshow-dot {
  width: 16px; height: 16px; padding: 0; border: 0; background: transparent; cursor: pointer;
  display: grid; place-items: center;
}
.slideshow-dot::after {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  border: 1px solid var(--gold-dim); background: transparent;
  transition: background .2s, border-color .2s, transform .2s;
}
.slideshow-dot:hover::after { border-color: var(--gold); }
.slideshow-dot[aria-current="true"]::after { background: var(--gold); border-color: var(--gold); transform: scale(1.15); }
.slideshow-dot:focus-visible { outline: 2px solid var(--gold); outline-offset: -1px; border-radius: 50%; }
.slideshow-count { font-family: var(--font-mono); font-size: .68rem; color: var(--text-faint); padding: 0 0 2px 6px; }

.slideshow-progress {
  position: absolute; left: 0; right: 0; bottom: 0; height: 2px; z-index: 2;
  background: rgba(125,100,32,.22); overflow: hidden; pointer-events: none;
}
.slideshow-progress::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, var(--gold-dim), var(--gold));
  transform: scaleX(0); transform-origin: left center;
}
.slideshow-progress.is-running::after { animation: slide-clock 7s linear forwards; }
@keyframes slide-clock { to { transform: scaleX(1); } }
.slideshow.is-paused .slideshow-progress::after,
.slideshow.is-paused .slide.is-on .slide-portrait-fill { animation-play-state: paused; }

/* Reduced motion: no drift, no fade, no clock - the dots still move it. */
.slideshow.is-still .slide, .slideshow.is-still .slide.is-on { transition: none; }
.slideshow.is-still .slide-portrait-fill { animation: none; }

@media (max-width: 760px) {
  .hall-welcome { grid-template-columns: minmax(0, 1fr); gap: 18px; }
}
@media (max-width: 420px) {
  .slideshow-stage { height: 160px; }
  .slide { grid-template-columns: 112px minmax(0, 1fr); }
  .slideshow-dots { left: 112px; }
  .slide-caption { padding: 12px 28px 24px 14px; }
  .slide-name { font-size: 1.02rem; }
}

/*
 * The dock: the same slideshow, small, in the bottom-left corner of the
 * Roster, Loot and Attendance pages. Only where there is room to spare a
 * corner - the ROOMY query in slideshow.js is the same one, and it does not
 * even fetch below it. Under the drawer, the modals and the toasts. The page
 * gains room at the bottom so the last rows can be scrolled clear of it.
 */
/*
 * The dock grows with the screen rather than in fixed steps. A box sized for a
 * laptop was a postage stamp on a 4K monitor, so its width is a share of the
 * screen - about a fifth of its width, never more than 60% of its height -
 * between 340 px and 820 px, and everything inside it is measured in the box's
 * own width (cqw, it being a size container): the stage is 40% as tall as the
 * box is wide, the portrait column four-fifths of that, and the words scale
 * with it. At 1280 x 760 it is the 340 x 136 it was; 1920 x 1080 gives about
 * 400 x 160, 2560 x 1440 about 540 x 215, and 3840 x 2160 about 800 x 320.
 *
 * Those are sizes on the SCREEN, and they stay so when a big screen zooms the
 * whole site (see BIG SCREENS at the top): every length here that is measured
 * in the screen is divided by --zoom, so the zoom multiplies it straight back.
 * The dock was already sized for the screen; zooming it too would have drawn
 * it twice as big on a 4K monitor.
 */
:root { --dock-w: calc(clamp(340px, min(21vw, 60vh), 820px) / var(--zoom)); }
.slideshow.is-dock {
  position: fixed; left: calc(clamp(18px, 1.1vw, 36px) / var(--zoom)); bottom: calc(clamp(18px, 1.1vw, 36px) / var(--zoom)); z-index: 90;
  width: var(--dock-w);
  container-type: inline-size;
  display: none;
  animation: dock-in .5s ease both;
}
@media (min-width: 1100px) and (min-height: 620px) {
  .slideshow.is-dock { display: block; }
  body.has-portrait-dock main { padding-bottom: calc(var(--dock-w) * .4 + 54px / var(--zoom)); }
}
@keyframes dock-in { from { opacity: 0; transform: translateY(12px); } }
.slideshow.is-dock.is-leaving { animation: none; }
.is-dock::before, .is-dock::after { width: calc(clamp(12px, .9vw, 24px) / var(--zoom)); height: calc(clamp(12px, .9vw, 24px) / var(--zoom)); }
.is-dock::before { top: calc(-5px / var(--zoom)); left: calc(-5px / var(--zoom)); }
.is-dock::after { bottom: calc(-5px / var(--zoom)); right: calc(-5px / var(--zoom)); }
.is-dock .slideshow-stage { height: 40cqw; }
.is-dock .slide { grid-template-columns: 32cqw minmax(0, 1fr); }
.is-dock .slide-caption { gap: .3cqw; padding: 3cqw 8.2cqw 4.2cqw 4.1cqw; }
.is-dock .slide-name { font-size: 4.9cqw; }
.is-dock .slide-line { font-size: 3.75cqw; }
.is-dock .slide-role { font-size: 3.1cqw; }
.is-dock .slide-account { margin-top: 1.2cqw; font-size: 3.4cqw; }
.is-dock .slideshow-hide { top: 1.2cqw; right: 1.2cqw; width: 6.5cqw; height: 6.5cqw; font-size: 2.3cqw; }
.is-dock .slideshow-progress { height: max(2px, .6cqw); }

/* ---- portraits: the character sheet, and Admin > Portraits ---------------------- */

.sheet-top { display: flex; gap: 14px; align-items: flex-start; }
.sheet-portrait {
  position: relative; flex: 0 0 auto; width: 104px; margin: 2px 0 4px;
  border: 1px solid var(--gold-dim); background: var(--ink);
  box-shadow: 0 0 0 3px rgba(12,10,8,.9), 0 0 0 4px rgba(125,100,32,.3);
}
/* The whole portrait at its own shape: a wide one is short, a tall one stops
   at a sensible height and is contained there rather than cropped. */
.sheet-portrait img { display: block; width: 100%; height: auto; max-height: 180px; object-fit: contain; }
/* Not what the guild sees yet, and the frame says so. */
.sheet-portrait.is-unapproved { border-style: dashed; border-color: var(--warn); }
.sheet-portrait.is-unapproved img { opacity: .8; }
.sheet-portrait figcaption {
  padding: 3px 4px; text-align: center;
  font-size: .64rem; letter-spacing: .04em; line-height: 1.3;
  color: var(--warn); background: rgba(12,10,8,.9);
}

.portrait-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.portrait-card {
  display: grid; grid-template-columns: 116px minmax(0, 1fr); gap: 14px;
  padding: 12px; border: 1px solid var(--stone-600); border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(38,33,28,.6), rgba(20,17,16,.7));
}
.portrait-card-image {
  display: block; align-self: start;
  border: 1px solid var(--gold-dim); background: var(--ink);
  box-shadow: 0 0 0 3px rgba(12,10,8,.9);
}
/* contain, not cover: an approver judges the whole picture, not a crop of it. */
.portrait-card-image img { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: contain; }
.portrait-card h3 { margin: 0 0 4px; font-size: 1rem; }
.portrait-card p { margin: 0 0 2px; }

/* ---- sign in ------------------------------------------------------------- */

.gate { min-height: calc(100vh / var(--zoom)); display: grid; place-items: center; padding: 30px 20px; position: relative; isolation: isolate; }

/*
 * The banner behind the sign-in card: far back, softened and dimmed, darkest
 * where the card stands so every word on it keeps its contrast.
 *
 * Only its lower part. A banner carries the guild's name across its top, and
 * a screen-filling crop of it put giant painted letters straight behind the
 * card's own heading. So the picture is drawn half as tall again as the screen
 * and anchored to the bottom: the top third - where the name is - sits above
 * the viewport, and what shows is the scene underneath it.
 */
.gate-art { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.gate-art img {
  position: absolute; left: 0; bottom: 0;
  width: 100%; height: 150%;
  object-fit: cover; object-position: 50% 100%;
  filter: blur(2.5px) brightness(.6);
  transform: scale(1.03);
  transform-origin: 50% 100%;
}
.gate-art::after {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 42% 60% at 50% 50%, rgba(12,10,8,.62), rgba(12,10,8,.22) 70%, rgba(12,10,8,.5)),
    linear-gradient(180deg, rgba(12,10,8,.35), rgba(12,10,8,.15) 40%, rgba(12,10,8,.5));
}
/* The words outside the card stand on the picture now, not on flat stone. */
.gate-art + .gate-card > h1,
.gate-art + .gate-card > .tagline,
.gate-art + .gate-card > .gate-switch { text-shadow: 0 1px 3px rgba(0,0,0,.95), 0 0 14px rgba(0,0,0,.85); }
.gate-art + .gate-card > .tagline,
.gate-art + .gate-card > .gate-switch { color: var(--text-dim); }
.gate-card { width: min(430px, 100%); }
.gate-crest { width: 92px; height: 92px; color: var(--gold); margin: 0 auto 14px; display: block; }
.gate h1 { text-align: center; font-size: 1.5rem; }
.gate .tagline { text-align: center; color: var(--text-faint); font-style: italic; margin: -6px 0 22px; }
.gate-switch { text-align: center; margin-top: 16px; font-size: .87rem; color: var(--text-faint); }

/* ---- misc ---------------------------------------------------------------- */

.stat-row { display: flex; gap: 22px; flex-wrap: wrap; margin-bottom: 6px; }
.stat .n { font-family: var(--font-display); font-size: 1.6rem; color: var(--gold-bright); display: block; line-height: 1.1; }
.stat .k { font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--text-faint); }

.muted { color: var(--text-faint); }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.mt0 { margin-top: 0; }
.mb0 { margin-bottom: 0; }
.grow { flex: 1 1 auto; }
.small { font-size: .82rem; }

.readonly-banner {
  display: flex; align-items: center; gap: 10px;
  border: 1px dashed var(--stone-500);
  border-radius: var(--radius);
  padding: 9px 14px;
  margin-bottom: 18px;
  font-size: .84rem;
  color: var(--text-faint);
}
.readonly-banner svg { width: 18px; height: 18px; flex: 0 0 auto; opacity: .6; }

@media (max-width: 560px) {
  .panel { border-width: 16px; border-image-width: 16px; padding: 4px 10px 12px; }
  main { padding: 20px 14px 60px; }
  .masthead-inner { padding: 12px 14px; gap: 12px; }
  .crest { width: 44px; height: 44px; }
  .nav-inner { padding: 0 14px; }
  .nav a { padding: 11px 12px; font-size: .74rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

.nav .sigil-art .mark, .panel-icon { opacity: 1; }

/* sigils used as small headings inside the flag editor */
.modal-body h3 > svg { width: 18px; height: 18px; flex: 0 0 auto; opacity: .8; }

/* ---- Admin > Database ------------------------------------------------------ */

.db-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 18px; align-items: start; }
.db-tables { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 12px; }
.db-tables h4 {
  margin: 0 0 4px; font-family: var(--font-display); font-size: .68rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--gold-dim);
}
.db-group { display: flex; flex-direction: column; }
.db-group button {
  display: flex; align-items: baseline; gap: 6px; width: 100%; text-align: left;
  background: none; border: 0; border-left: 2px solid transparent; color: var(--text-dim);
  font: inherit; font-size: .86rem; padding: 3px 8px; cursor: pointer;
}
.db-group button:hover { color: var(--gold-bright); }
.db-group button.on { color: var(--gold-bright); border-left-color: var(--gold); background: rgba(201,162,39,.07); }
.db-group button:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }
.db-count { margin-left: auto; font-family: var(--font-mono); font-size: .72rem; color: var(--text-faint); }
.db-ro { font-size: .62rem; color: var(--text-faint); text-transform: uppercase; letter-spacing: .06em; }
.db-picker { display: none; width: 100%; }

.db-grid { min-width: 0; }
.db-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 10px; }
.db-toolbar h3 { margin: 0; }
.db-toolbar .spacer { flex: 1 1 auto; }
.db-toolbar input[type=search] { width: min(260px, 100%); }
.db-wrap { max-height: calc(70vh / var(--zoom)); overflow: auto; border: 1px solid var(--stone-600); border-radius: var(--radius); }
.db-table { font-size: .82rem; }
.db-table thead th { position: sticky; top: 0; background: var(--stone-800); z-index: 1; padding: 0; }
.db-sort {
  background: none; border: 0; color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit;
  padding: 8px 10px; cursor: pointer; white-space: nowrap; width: 100%; text-align: left;
}
.db-sort:hover { color: var(--gold-bright); }
.db-fk { color: var(--text-faint); text-transform: none; letter-spacing: 0; font-family: var(--font-mono); font-size: .68rem; }
.db-pk { color: var(--gold); }
.db-cell {
  font-family: var(--font-mono); max-width: 280px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  padding: 6px 10px; color: var(--text-dim);
}
.db-editable { color: var(--text); cursor: pointer; }
.db-editable:hover { background: rgba(201,162,39,.1); box-shadow: inset 0 -1px 0 var(--gold-dim); }
.db-editable:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }
.db-null { color: var(--text-faint); font-style: italic; }
.db-actions { padding: 3px 8px; white-space: nowrap; }
.db-pager { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.db-pager .spacer { flex: 1 1 auto; }

@media (max-width: 760px) {
  .db-layout { grid-template-columns: minmax(0, 1fr); }
  .db-tables { position: static; }
  .db-group { display: none; }
  .db-picker { display: block; }
  .db-wrap { max-height: none; }
}

/* The "paid" marker on a raid: a link that opens the payout record. */
.paid-mark {
  display: inline-flex; align-items: center; gap: 4px;
  background: none; border: 0; padding: 0;
  font-family: var(--font-display); font-size: .68rem; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ok); cursor: pointer;
}
.paid-mark:hover { color: #a9d69b; text-decoration: underline; }
.paid-mark:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.paid-icon { width: 13px; height: 13px; opacity: .8; }

/* The Server Admin seat: one chip, with a key on it. */
.seat-chip { display: inline-flex; align-items: center; gap: 5px; }
.seat-key { width: 12px; height: 12px; opacity: .9; flex: 0 0 auto; }

/* The marking sheet, grouped by person: one heading row per account. */
.sheet-group td {
  background: rgba(201,162,39,.06);
  border-bottom: 1px solid var(--stone-600);
  font-family: var(--font-display);
  font-size: .74rem; letter-spacing: .06em;
  padding: 7px 10px;
}
.sheet-group td em { color: var(--text-faint); font-style: italic; }

/* A button that reads as a link: opens something about the row it sits in. */
.btn-link {
  background: none; border: 0; padding: 0; font: inherit; color: inherit;
  cursor: pointer; text-align: left;
}
.btn-link:hover { color: var(--gold-bright); text-decoration: underline; }
.btn-link:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ---- phones -------------------------------------------------------------- */

/*
 * The nav was one row that scrolled sideways, so on a phone it ran about two
 * and a half screens wide and everything past Attendance - Forums, Library,
 * the Applications queue with its badge, Admin - was off the edge with nothing
 * to say it was there. It wraps now, and the labels go under the icons, which
 * fits eight items into two rows at 375px.
 */
@media (max-width: 560px) {
  .nav-inner { flex-wrap: wrap; overflow-x: visible; gap: 0; }
  .nav a {
    flex-direction: column;
    gap: 3px;
    padding: 8px 10px;
    font-size: .62rem;
    letter-spacing: .06em;
    border-bottom-width: 2px;
  }
  .nav a svg { width: 19px; height: 19px; }
  /* The queue stays legible: a badge under a label is a second line, so it
     rides on the icon instead. */
  .nav a .nav-badge { position: absolute; transform: translate(14px, -6px); }
  .nav a { position: relative; }
  .brand h1 { font-size: 1.25rem; }
  /* The tagline is the one thing on the masthead a phone can spare. */
  .brand p { display: none; }
}

/*
 * The marking sheet stops being a table and becomes one card per character.
 *
 * Seven status buttons in a row need about 500px; a phone has 375. The table
 * scrolled sideways, so the Mark buttons and the Adjust column sat off the
 * right edge - which is to say an officer could not mark a raid from a phone,
 * which is where raids are marked from.
 */
@media (max-width: 700px) {
  .sheet-wrap { max-height: none; overflow-x: visible; border: 0; }
  .sheet-table thead { display: none; }
  .sheet-table tbody, .sheet-table tr, .sheet-table td { display: block; width: 100%; }
  .sheet-table tbody tr:not(.sheet-group) {
    border: 1px solid var(--stone-600);
    border-radius: var(--radius);
    margin: 0 0 10px;
    padding: 8px 10px;
    background: rgba(20,17,16,.5);
  }
  .sheet-table tbody tr:hover { background: rgba(20,17,16,.5); }
  .sheet-table td { border: 0; padding: 3px 0; }
  /* Name and class share the first line of the card. */
  .sheet-table td.sheet-who, .sheet-table td.sheet-class { display: inline-block; width: auto; }
  .sheet-table td.sheet-class { margin-left: 8px; font-size: .8rem; }
  .sheet-table td.sheet-class::before { content: '· '; }
  /* The seven buttons wrap into a grid instead of a single strip. */
  .sheet-table .seg {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
    border-radius: var(--radius);
    overflow: hidden;
  }
  /* 11px of padding puts the tap target at about 42px tall, which is a thumb. */
  .sheet-table .seg button { border-left: 1px solid var(--stone-600); border-top: 1px solid var(--stone-600); padding: 11px 6px; }
  .sheet-table td.adjust { text-align: left !important; padding-top: 6px; }
  .sheet-table td.adjust .adjust-word { display: inline; margin-left: 6px; }
  .sheet-table tr.sheet-group td { padding: 6px 0 4px; background: none; border-bottom: 1px solid var(--stone-600); }
  .sheet-table tr.sheet-group { border: 0; margin: 14px 0 8px; padding: 0; background: none; }
}

/* The Adjust button says "Adjust" only where it needs to: inside a phone card. */
.adjust-word { display: none; }

/* ---- the reference database ---------------------------------------------- */

/*
 * The facts table on an entry: label on the left, what is known on the right.
 * Narrow label column so a long capability description gets the room, and it
 * stacks rather than squeezes on a phone.
 */
.facts { width: 100%; border-collapse: collapse; margin: 12px 0; }
.facts th {
  width: 170px;
  text-align: left;
  vertical-align: top;
  padding: 6px 12px 6px 0;
  color: var(--text-dim);
  font-family: var(--font-display);
  font-size: .8rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-weight: 600;
}
.facts td { padding: 6px 0; border-bottom: 1px solid var(--stone-700); }

/* Screenshots on an entry - the item window, the mob, the spawn point. */
.ref-shots {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 16px 0 4px;
}
.ref-shot {
  margin: 0;
  max-width: 320px;
  background: var(--stone-900);
  border: 1px solid var(--stone-700);
  border-radius: 6px;
  padding: 8px;
}
.ref-shot img { display: block; max-width: 100%; height: auto; border-radius: 4px; }
.ref-shot figcaption { margin-top: 6px; font-size: .85rem; color: var(--text-dim); }

/* Linked entries, and the picker that adds one. */
.link-list { list-style: none; margin: 6px 0 0; padding: 0; }
.link-list li {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 5px 0;
  border-bottom: 1px solid var(--stone-700);
}
.link-results { max-height: 220px; overflow-y: auto; margin-bottom: 10px; }

@media (max-width: 560px) {
  .facts th { width: auto; display: block; padding-bottom: 0; border: 0; }
  .facts td { display: block; padding-top: 2px; }
  .ref-shot { max-width: 100%; }
}

/* ---- maps ---------------------------------------------------------------- */

/*
 * The drawing surface. Height in vh, so it divides by --zoom: under the
 * big-screen rule at the top of this file a vh is multiplied like a px, and a
 * map sized 70vh would be two screens tall on a 4K monitor.
 */
.map-stage { margin-top: 12px; }
.map-canvas {
  position: relative;
  height: calc(70vh / var(--zoom));
  min-height: 320px;
  background:
    radial-gradient(circle at 50% 40%, rgba(201,162,39,.05), transparent 70%),
    var(--ink);
  border: 1px solid var(--stone-600);
  border-radius: var(--radius);
  overflow: hidden;
}
.map-svg { width: 100%; height: 100%; touch-action: none; cursor: grab; display: block; }
.map-svg:active { cursor: grabbing; }

/* Lines are corridors unless a tag says otherwise. */
.map-way { fill: none; stroke: var(--gold-dim); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.map-way-wall { stroke: var(--stone-500); stroke-width: 3; }
.map-way-water { stroke: var(--azure); stroke-dasharray: 6 4; }

.map-marker { fill: var(--gold); stroke: var(--ink); stroke-width: 1; }
.map-marker-arrow { fill: var(--parchment); }
.map-marker-danger { fill: var(--blood); }
.map-marker-quest { fill: var(--jade); }
.map-label {
  fill: var(--text);
  font-family: var(--font-body);
  font-size: 11px;
  paint-order: stroke;
  stroke: var(--ink);
  stroke-width: 3px;      /* a halo, so a label stays readable over a line */
  stroke-linejoin: round;
}
.map-node a, a.map-node { cursor: pointer; }
a.map-node:hover .map-label { fill: var(--gold-bright); }
a.map-node:hover .map-marker { fill: var(--gold-bright); }

.map-north {
  position: absolute;
  top: 10px; right: 12px;
  color: var(--gold-dim);
  font-family: var(--font-display);
  font-size: .8rem;
  letter-spacing: .1em;
  pointer-events: none;
}
.map-reset { position: absolute; bottom: 10px; right: 12px; }

.map-filters { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; }
.map-filters h3 {
  font-size: .78rem;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.map-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: .9rem; cursor: pointer; }

/* The map editor's toolbar, and what being selected looks like. */
.map-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin: 10px 0;
  padding: 10px 12px;
  background: rgba(0,0,0,.25);
  border: 1px solid var(--stone-600);
  border-radius: var(--radius);
}
.map-toolbar-group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.map-toolbar-group select { width: auto; min-width: 140px; }
.map-dirty { color: var(--warn); }
.map-editing { cursor: crosshair; }
.map-way.is-selected { stroke: var(--gold-bright); stroke-width: 4; }
.map-node.is-selected .map-marker { stroke: var(--gold-bright); stroke-width: 2; }
.map-way-pending { stroke: var(--gold-bright); stroke-dasharray: 5 4; stroke-width: 2; }

/* A section inside the Map box: filters, or whatever is selected. */
.map-side { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--stone-700); }
.map-side h3 {
  font-size: .8rem;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 0 0 8px;
}

/* ---- the intake window (views/intake.js) ---------------------------------- */

.intake-layout { display: grid; grid-template-columns: minmax(190px, 250px) minmax(0, 1fr); gap: 18px; align-items: start; }
.intake-list { display: flex; flex-direction: column; gap: 4px; max-height: calc(72vh / var(--zoom)); overflow-y: auto; }
.intake-list-item {
  display: flex; flex-direction: column; gap: 2px;
  padding: 8px 10px; border: 1px solid transparent; border-radius: var(--radius); color: var(--text);
}
.intake-list-item:hover { border-color: var(--stone-500); text-decoration: none; }
.intake-list-item.active { border-color: var(--gold-dim); background: rgba(201,162,39,.08); }
.intake-list-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.intake-list-meta { display: flex; align-items: center; gap: 6px; font-size: .74rem; color: var(--text-faint); }
.intake-dot {
  flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%;
  background: var(--gold); animation: pulse 1.6s ease-in-out infinite;
}

.intake-chat { display: flex; flex-direction: column; min-width: 0; }
.intake-chat-head { display: flex; align-items: center; gap: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--stone-700); }
.intake-title { margin: 0; font-size: 1rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.intake-chat-head .spacer, .intake-status .spacer, .intake-approval-head .spacer, .intake-composer .spacer { flex: 1 1 auto; }
.intake-log {
  display: flex; flex-direction: column; gap: 10px;
  height: calc(58vh / var(--zoom)); min-height: 260px; padding: 14px 2px; overflow-y: auto;
}
.intake-empty .empty { padding: 30px 10px; }
.intake-user {
  align-self: flex-end; max-width: 85%; padding: 10px 12px;
  border: 1px solid var(--gold-dim); border-radius: 6px; background: rgba(201,162,39,.07);
}
.intake-user-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.intake-thumbs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.intake-thumbs img { display: block; height: 96px; max-width: 220px; object-fit: cover; border: 1px solid var(--stone-600); border-radius: 4px; }
.intake-agent { padding: 2px 4px; }
.intake-agent .prose { max-width: none; }
.intake-tool { padding: 3px 8px; font-size: .82rem; color: var(--text-dim); border-left: 2px solid var(--stone-600); }
.intake-tool.ok { border-left-color: var(--jade); }
.intake-tool.failed { border-left-color: var(--bad); }
.intake-tool-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.intake-tool-state { width: 1em; text-align: center; font-family: var(--font-mono); }
.intake-tool.ok .intake-tool-state { color: var(--ok); }
.intake-tool.failed .intake-tool-state, .intake-tool-error { color: var(--bad); }
.intake-tool-details summary { cursor: pointer; font-size: .72rem; color: var(--text-faint); }
.intake-tool-details pre, .intake-approval-detail {
  max-height: 320px; margin: 6px 0 0; padding: 8px 10px; overflow: auto;
  font-size: .76rem; white-space: pre-wrap; overflow-wrap: anywhere;
  background: var(--ink); border: 1px solid var(--stone-700); border-radius: var(--radius);
}
.intake-approval { padding: 10px 12px; border: 1px solid var(--warn); border-radius: 6px; background: rgba(217,164,65,.07); }
.intake-approval:not([data-status=pending]) { border-color: var(--stone-600); background: none; }
.intake-approval-head { display: flex; align-items: center; gap: 8px; }
.intake-approval-head svg { width: 18px; height: 18px; color: var(--warn); }
.intake-approval .btn-row { margin-top: 10px; }
.intake-approval .hint { margin: 0; }
.intake-note { font-size: .82rem; font-style: italic; text-align: center; color: var(--text-faint); }
.intake-error { padding: 8px 12px; color: #e79a8b; border: 1px solid var(--blood); border-radius: 6px; background: rgba(184,67,47,.08); }
.intake-status {
  display: flex; align-items: center; gap: 8px; padding: 6px 4px;
  font-size: .85rem; color: var(--text-dim); border-top: 1px solid var(--stone-700);
}
.intake-status[hidden], .intake-attachments[hidden] { display: none; }
.intake-composer { padding-top: 10px; border-top: 1px solid var(--stone-700); }
.intake-composer.over { outline: 2px dashed var(--gold-dim); outline-offset: 4px; }
.intake-composer .hint { margin: 0; }
textarea.intake-input { min-height: 90px; margin-bottom: 8px; font-family: var(--font-body); font-size: .95rem; }
.intake-attachments { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.intake-attachment {
  position: relative; display: grid; place-items: center; height: 72px; min-width: 72px; padding: 0 6px;
  background: var(--stone-900); border: 1px solid var(--stone-600); border-radius: 4px;
}
.intake-attachment.ready { padding: 0; }
.intake-attachment img { display: block; height: 70px; max-width: 160px; object-fit: cover; border-radius: 4px; }
.intake-attachment-remove {
  position: absolute; top: -8px; right: -8px; width: 22px; height: 22px; padding: 0;
  line-height: 1; color: var(--text); cursor: pointer;
  background: var(--stone-800); border: 1px solid var(--stone-500); border-radius: 50%;
}
.intake-attachment-remove:hover { color: #ffb3a3; border-color: var(--blood); }

@media (max-width: 760px) {
  .intake-layout { grid-template-columns: minmax(0, 1fr); }
  .intake-list { max-height: 170px; }
  .intake-log { height: calc(55vh / var(--zoom)); }
  .intake-user { max-width: 100%; }
}
