/* Item Values — public suggest/approve page. Self-contained (no framework, no shared bundle); the
   palette and header match ../mods/mods.css on purpose so the two pages read as one site. */

:root {
  --bg: #151816;
  --panel: #1d211e;
  --panel-2: #252a26;
  --line: #3a413b;
  --ink: #e4e8e1;
  --muted: #99a397;
  --accent: #8cc45e;
  --on-accent: #0f1a0b;
  --gold: #e0a23a;
  --emerald: #3fd47a;
  --ok: #7fbf6a;
  --bad: #d15c5c;
  --discord: #5865f2;
  --radius: 10px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { color-scheme: dark; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--sans); }
/* A crumbling stone-brick corner, bottom-left, behind everything — the same as ../mods/. */
body::before {
  content: ""; position: fixed; left: 0; bottom: 0; width: 1280px; height: 1040px; pointer-events: none; z-index: 0;
  background: url("bricks.svg") left bottom / contain no-repeat; opacity: 0.6;
  /* The wall dissolves away from the corner instead of ending on a hard edge. */
  -webkit-mask-image: radial-gradient(ellipse 100% 100% at 0 100%, #000 25%, rgba(0,0,0,0.5) 55%, transparent 85%);
          mask-image: radial-gradient(ellipse 100% 100% at 0 100%, #000 25%, rgba(0,0,0,0.5) 55%, transparent 85%);
}
.top, main, .foot { position: relative; z-index: 1; }
a { color: var(--accent); }
code { font-family: var(--mono); font-size: 0.92em; }
.sr { position: absolute; left: -9999px; }
.wrap { max-width: 960px; margin: 0 auto; padding: 0 20px; }

.top { padding: 40px 0 20px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, #1c211d, var(--bg)); }
.kicker { margin: 0 0 4px; color: var(--accent); text-transform: uppercase; letter-spacing: 0.12em; font-size: 12px; }
.kicker a { color: inherit; text-decoration: none; }
.kicker a:hover, .kicker a:focus-visible { text-decoration: underline; }
h1 { margin: 0 0 10px; font-size: 40px; font-weight: 700; line-height: 1.1; }
.lede { max-width: 72ch; margin: 0 0 14px; font-size: 18px; }
.lede em { color: var(--accent); font-style: normal; }
.help { margin: 0 0 18px; padding-left: 22px; }
.help li { margin: 2px 0; }
h3 { font-size: 18px; margin: 0; }

.banner { max-width: 72ch; margin: 0 0 18px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(0,0,0,0.35); color: var(--muted); font-size: 14px; }
.banner.bad { border-color: var(--bad); background: #2e1717; color: #ffc9c9; }

.user { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; min-height: 36px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); color: var(--ink); font: inherit; cursor: pointer; }
.btn:hover { border-color: var(--accent); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn.discord { background: var(--discord); border-color: var(--discord); color: #fff; font-weight: 600; }
.btn.small { padding: 4px 10px; font-size: 14px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.btn.primary:disabled { opacity: 0.4; cursor: not-allowed; }
.btn.ok { border-color: var(--ok); color: var(--ok); }
.btn.no { border-color: var(--bad); color: #ffb3b3; }
.btn.busy, .btn.busy:disabled { opacity: 1; cursor: progress; }
.btn.busy::before { content: ''; width: 0.8em; height: 0.8em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: btn-spin 0.7s linear infinite; }
@keyframes btn-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .btn.busy::before { animation: none; border-right-color: currentColor; opacity: 0.6; } }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px 6px 6px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); }
.chip img { width: 24px; height: 24px; border-radius: 50%; }
.chip .role { color: var(--gold); font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; }
.toast { padding: 6px 10px; border-radius: 8px; background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.toast.bad { border-color: var(--bad); color: #ffc9c9; }
.fine { color: var(--muted); font-size: 14px; }

.tools { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 20px 0 10px; position: sticky; top: 0; background: var(--bg); padding: 10px 0; z-index: 2; }
.search { flex: 1 1 320px; display: flex; gap: 8px; align-items: center; }
.search input { width: 100%; padding: 12px 14px; font: inherit; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.search input:focus { outline: none; border-color: var(--accent); }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tab { display: inline-flex; align-items: center; white-space: nowrap; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font: inherit; font-size: 14px; cursor: pointer; }
.tab .count { margin-left: 6px; color: var(--muted); font-size: 12px; }
.tab:hover { border-color: var(--accent); }
.tab[aria-selected="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.tab[aria-selected="true"] .count { color: #2c4a1a; }
.tab.queue { border-color: var(--gold); }
.tab.queue[aria-selected="true"] { background: var(--gold); border-color: var(--gold); }

.status { color: var(--muted); font-size: 14px; min-height: 1.5em; margin: 0 0 8px; }

.group { margin: 0 0 22px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.group > header { padding: 14px 18px; border-bottom: 1px solid var(--line); background: var(--panel-2); }
.group .count { color: var(--muted); font-weight: 400; font-size: 14px; margin-left: 8px; }
.group .why { margin: 6px 0 0; }
.group .note { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.sub-head { padding: 10px 18px; color: var(--muted); font-size: 14px; }

.row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 6px 14px; align-items: center; padding: 10px 18px; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
.row .item { display: flex; gap: 10px; align-items: center; min-width: 0; }
.row .icon { flex: 0 0 32px; width: 32px; height: 32px; }
.row .icon img { width: 32px; height: 32px; image-rendering: pixelated; display: block; }
.row .name { font-weight: 600; }
.row .id { font-family: var(--mono); font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.row .id .badge { margin-left: 8px; vertical-align: 1px; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; letter-spacing: 0.02em; text-transform: uppercase; }
.badge.approved { background: #1f3320; color: var(--ok); }
.badge.te-default { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.badge.dt-bridge { background: #2b2616; color: var(--gold); }
.badge.dynamic { background: #1b2940; color: #9db8ec; }
.badge.pending { background: #2b2616; color: var(--gold); }
.badge.rejected { background: #3a1e1e; color: var(--bad); }
/* A grouped item: locked with its kin, one value for all. A button, so it jumps to the group. */
.badge.locked { background: #1b2940; color: #9db8ec; border: 0; cursor: pointer; font: inherit; font-size: 11px; font-weight: 600; text-transform: none; letter-spacing: 0; }
.badge.locked:hover { background: #24365a; }
.locked-note { color: #9db8ec; }
/* A search hit collapsed to its group: group name up top, the matched items small underneath. */
.grouprow .gcount { color: #9db8ec; font-size: 12px; }
.matched { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; font-size: 13px; color: var(--muted); }
.mchip { display: inline-flex; align-items: center; gap: 4px; color: var(--ink); }
.row .mchip .icon { width: 18px; height: 18px; flex: 0 0 18px; }
.row .mchip .icon img { width: 18px; height: 18px; }
.locked-note strong { color: var(--ink); }

/* Groups tab */
.pgroup { border-bottom: 1px solid var(--line); }
.pgroup summary { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; padding: 12px 18px; cursor: pointer; list-style: none; }
.pgroup summary::-webkit-details-marker { display: none; }
.pgroup summary::before { content: '▸'; color: var(--muted); width: 1em; }
.pgroup[open] summary::before { content: '▾'; }
.pgroup .gname { font-weight: 600; font-size: 16px; }
.pgroup .gvalue { margin-left: auto; color: var(--emerald); font-weight: 700; font-variant-numeric: tabular-nums; cursor: help; }
.pgroup .gvalue.faded { color: var(--muted); font-weight: 500; font-style: italic; }
.gbody { display: grid; gap: 10px; padding: 0 18px 14px 34px; }
.members { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 4px 14px; font-size: 13px; }
.members li { display: flex; align-items: center; gap: 8px; min-width: 0; }
.members .icon { width: 20px; height: 20px; flex: none; }
.members .icon img { width: 20px; height: 20px; }
.members .mname { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.members code { color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.members .mval { margin-left: auto; color: var(--emerald); font-variant-numeric: tabular-nums; }
.proposal .psum { color: var(--ink); }
.proposal .psum strong { color: #9db8ec; }
.proposal.create .psum strong { color: var(--emerald); }
.pids { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; font-size: 12px; }
.chips { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.chip-id { padding: 1px 6px; border-radius: 6px; background: var(--panel-2); border: 1px solid var(--line); font-size: 11px; }
.gform input.wide { width: 100%; max-width: 360px; font-family: inherit; }
.gform textarea.ids { font-family: var(--mono); font-size: 13px; min-height: 72px; }
.asks.decided { padding: 0 18px 14px; border-left: 0; }
.value { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.value .em { color: var(--emerald); font-weight: 700; font-size: 18px; }
.value .six { display: block; color: var(--muted); font-size: 12px; }
.value.faded .em { color: var(--muted); font-weight: 500; }
/* A pending ask supersedes the current price: fade it and strike it through; the ask shows the proposal. */
.value.superseded { opacity: 0.45; }
.value.superseded .em { text-decoration: line-through; }
/* The approver's villager column: what Trade Everything actually pays for that value. */
.trade { display: block; margin-top: 2px; color: var(--gold); font-size: 12px; cursor: help; }
.trade.inline { display: inline; margin: 0; }
.trade.none { color: var(--bad); }
.acts { display: inline-flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

.asks { grid-column: 1 / -1; list-style: none; margin: 0; padding: 0 0 0 10px; border-left: 2px solid rgba(255,255,255,0.08); display: grid; gap: 6px; font-size: 14px; }
.ask { display: grid; gap: 4px; padding: 6px 0; border-top: 1px dashed rgba(255,255,255,0.06); }
.ask:first-child { border-top: 0; }
.ask-head { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.vote-bar { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: 13px; color: var(--muted); }
.vote-bar .tally-s { color: var(--ok); }
.vote-bar .tally-r { color: var(--bad); }
.vbtn { padding: 2px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); color: var(--ink); font: inherit; font-size: 13px; cursor: pointer; }
.vbtn.support:hover, .vbtn.support.on { border-color: var(--ok); }
.vbtn.reject:hover, .vbtn.reject.on { border-color: var(--bad); }
.vbtn.support.on { background: #1f3320; }
.vbtn.reject.on { background: #3a1e1e; }
.why-toggle { background: none; border: 0; color: var(--accent); cursor: pointer; font: inherit; font-size: 13px; padding: 0; }
.voices { list-style: none; margin: 0; padding: 0 0 0 10px; border-left: 2px solid rgba(255,255,255,0.08); display: grid; gap: 2px; font-size: 13px; }
.voice { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; color: var(--muted); }
.voice .mark { width: 1em; }
.voice.support .mark { color: var(--ok); }
.voice.reject .mark { color: var(--bad); }
.vote-panel { border-left-color: var(--line); }
.vote-panel.support { border-left-color: var(--ok); }
.vote-panel.reject { border-left-color: var(--bad); }
.ask .who { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); font-weight: 500; }
.ask .who img { width: 18px; height: 18px; border-radius: 50%; }
.ask .val { color: var(--emerald); font-weight: 700; font-size: 18px; }
.ask .text { color: var(--muted); }
.ask .mine { color: var(--gold); font-size: 12px; text-transform: uppercase; }
.ask .note { color: #ffc9c9; }
.ask .when { color: var(--muted); font-size: 12px; }

.panel { grid-column: 1 / -1; display: grid; gap: 8px; padding: 10px 0 4px 10px; border-left: 3px solid var(--accent); }
.panel .line { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.panel input[type="text"], .panel textarea { font: inherit; font-size: 14px; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.panel input[type="text"] { width: 8em; font-family: var(--mono); }
.panel input.num { width: 4em; text-align: right; }
.panel .trade-edit { color: var(--gold); }
.panel .trade-edit .fine { color: var(--muted); }
.panel .trade-edit .margin-note { color: var(--muted); font-size: 13px; font-style: italic; }
.panel input:focus, .panel textarea:focus { outline: none; border-color: var(--accent); }
.panel textarea { flex: 1 1 260px; min-height: 52px; resize: vertical; }
.panel .n { color: var(--muted); font-size: 12px; white-space: nowrap; }
.panel .err { color: #ffc9c9; font-size: 14px; }
.panel .conv { color: var(--muted); font-size: 13px; }
.row-note { grid-column: 1 / -1; font-size: 13px; color: var(--ok); }
.row-note:empty { display: none; }
.row-note.bad { color: var(--bad); }


.foot { padding: 30px 20px 50px; color: var(--muted); font-size: 14px; }
.foot a { text-decoration: none; }
.foot a:hover { text-decoration: underline; }

@media (max-width: 600px) {
  body::before { width: 600px; height: 488px; opacity: 0.4; }
  h1 { font-size: 30px; }
  .row { grid-template-columns: 1fr; }
  .value { text-align: left; }
  .acts { justify-content: flex-start; }
}
