/* The guard card (issue #14): one file for Trade Relay's own pages and for Trade Scout's read-only view, so the two
   can't drift. Served at /static/shared/guard-card.css (any site may load it); the shield is /static/shared/shield.svg,
   the same drawing as app.js SHIELD.

   Every colour is a Trade Relay token with its own value as the fallback: Trade Relay's pages set the tokens (or.css),
   a page that doesn't (Trade Scout) gets the same colours anyway.

   A guard row:  <div class="gr [off] [ro]"> [switch or lock] <div><b>Name</b> <span class="eff block|flat">…</span>
                 [<span class="tag yours|changed">…</span>] <div class="d">description</div></div>
                 <span class="rd ok|near|over|off|unknown">reading</span></div>
   `ro` (read only, Trade Scout): no switch column.  Section heads: <div class="gsec"><span>Before a trade</span></div> */

/* small tags beside a guard's name */
.tag { display: inline-block; border-radius: 4px; padding: 0 5px; font-size: 10px; font-weight: 700; letter-spacing: .04em; line-height: 16px; vertical-align: 1px; }
.tag.changed { color: var(--amber, #F0B37E); border: 1px solid var(--amber-bd, #6A4A20); background: var(--amber-bg, #3A2A12); }
.tag.yours { color: var(--purple, #C4A7FF); border: 1px solid var(--purple-bd, #4A3A7A); background: var(--purple-bg, #2A1F45); }

/* what the guard does: blocks entries, or flattens */
.eff { font-size: 11px; font-weight: 600; border-radius: 4px; padding: 0 6px; white-space: nowrap; line-height: 18px; display: inline-block; }
.eff.block { color: var(--amber, #F0B37E); border: 1px solid var(--amber-bd, #6A4A20); }
.eff.flat { color: var(--red, #F87171); border: 1px solid var(--red-bd, #5A2A2E); }
.eff.watch { color: var(--muted, #8B97A6); border: 1px solid var(--line2, #2E3E52); }

/* "Before a trade" / "During a trade" */
.gsec { display: flex; justify-content: space-between; font-size: 11px; letter-spacing: .08em; color: var(--muted, #8B97A6); margin: 12px 0 2px; font-weight: 600; text-transform: uppercase; }
.gsec span:last-child { letter-spacing: 0; font-weight: 400; text-transform: none; }

/* the live reading. Trade Relay's page uses ok / near / fired / off; the App API's levels (ok / near / over / off /
   unknown) work as they are */
.rd { font-family: var(--mono, "JetBrains Mono", ui-monospace, Consolas, monospace); font-size: 12px; text-align: right; white-space: nowrap; }
.rd.ok { color: var(--green, #3DD68C); } .rd.near { color: var(--amber, #F0B37E); }
.rd.fired, .rd.over { color: var(--red, #F87171); } .rd.off, .rd.unknown { color: var(--dim, #5C6878); }
.lock { color: var(--amber, #F0B37E); font-size: 13px; text-align: center; }

/* one guard */
.gr { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 7px 0; border-bottom: 1px solid var(--line, #222E3C); }
.gr .d { font-size: 12px; color: var(--muted, #8B97A6); } .gr.off b, .gr.off .d { opacity: .55; } .gr .sw { margin-top: 2px; }
.gr.ro { grid-template-columns: minmax(0, 1fr) auto; }

/* the shield (app.js SHIELD, shield.svg): on the Account Guards tab and title, and small beside a guarded account's
   name (app.js shield(), owner 2026-11-26) */
.shield { width: 13px; height: 13px; vertical-align: -2px; margin-right: 6px; fill: none; stroke: currentColor;
  stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.shield path:first-child { fill: rgba(76, 158, 255, .16); stroke: var(--blue, #4C9EFF); }
.shield .tick { stroke: var(--green, #3DD68C); }
h1.withshield .shield { width: 22px; height: 22px; vertical-align: -3px; margin-right: 8px; }
.gs { display: inline-block; margin-left: 4px; line-height: 0; vertical-align: -1px; cursor: default; }
.gs[hidden] { display: none; }
/* issue #24: the Passed badge, beside the shield (amber "Target reached" on Account Guards) */
.pm { display: inline-block; margin-left: 5px; padding: 0 5px; border-radius: 8px; font: 600 10px/15px system-ui, sans-serif;
  letter-spacing: .02em; color: #fff; background: #1f9d55; vertical-align: 1px; cursor: default; white-space: nowrap; }
.pm[hidden] { display: none; }
.pm.reached { background: #b7791f; }
.gs .shield { width: 11px; height: 11px; margin: 0; vertical-align: 0; }
/* the funded $ (owner, 2026-11-27): a purple dot right after the shield; SVG, so the $ is centred exactly */
.fd { display: inline-block; margin-left: 4px; line-height: 0; vertical-align: -1px; cursor: default; }
.fd[hidden] { display: none; }
.fd svg { width: 12px; height: 12px; }
.fd circle { fill: var(--purple-bg, #2A1F45); stroke: var(--purple-bd, #4A3A7A); stroke-width: 1.2; }
.fd path { fill: none; stroke: var(--purple, #C4A7FF); stroke-width: 1.3; stroke-linecap: round; }

@media (max-width: 760px) {
  .gr { grid-template-columns: 38px minmax(0, 1fr); } .gr .rd, .gr .eff { grid-column: 2; text-align: left; }
  .gr.ro { grid-template-columns: minmax(0, 1fr); } .gr.ro .rd, .gr.ro .eff { grid-column: 1; }
}
