:root {
  --bg: #0b1016; --panel: rgba(13, 19, 27, 0.94); --panel-solid: #0d131b; --line: #233041; --text: #e6edf5; --muted: #8fa1b5;
  --accent: #39d98a; --accent2: #4cb3ff; --warn: #ffb347; --bad: #ff6b6b; --raid: #ff4fd8;
  --radius: 10px; --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) { --panel: rgba(250, 252, 255, 0.96); --panel-solid: #fafcff; --line: #d3dce6; --text: #10202e; --muted: #50657a; }
}
.awcg-top, .awcg-panel, .awcg-modal, .awcg-toast { font: 14px/1.45 var(--font); color: var(--text); }
.awcg-top { position: fixed; top: 0; left: 0; right: 0; height: 56px; display: flex; align-items: center; gap: 8px; padding: 0 12px;
  background: var(--panel); border-bottom: 1px solid var(--line); z-index: 1000; backdrop-filter: blur(6px); }
.awcg-brand { font-weight: 700; letter-spacing: 0.02em; white-space: nowrap; margin-right: 6px; }
.awcg-brand b { color: var(--accent); }
.awcg-top nav { display: flex; gap: 4px; overflow-x: auto; flex: 1; scrollbar-width: none; }
.awcg-top nav::-webkit-scrollbar { display: none; }
.awcg-btn { background: transparent; color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; cursor: pointer;
  font: inherit; white-space: nowrap; }
.awcg-btn:hover { border-color: var(--accent2); }
.awcg-btn.on { background: var(--accent2); color: #001018; border-color: var(--accent2); }
.awcg-btn.primary { background: var(--accent); color: #00140a; border-color: var(--accent); font-weight: 600; }
.awcg-btn.raid { border-color: var(--raid); color: var(--raid); }
.awcg-btn:disabled { opacity: 0.5; cursor: default; }
.awcg-me { white-space: nowrap; color: var(--muted); }
.awcg-panel { position: fixed; top: 56px; right: 0; bottom: 0; width: 380px; max-width: 100vw; background: var(--panel-solid); border-left: 1px solid var(--line);
  z-index: 999; display: none; flex-direction: column; }
.awcg-panel.open { display: flex; }
.awcg-panel header { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.awcg-panel header h2 { margin: 0; font-size: 16px; }
.awcg-panel .body { padding: 12px 14px; overflow-y: auto; flex: 1; }
.awcg-panel h3 { font-size: 14px; margin: 14px 0 6px; }
.awcg-muted { color: var(--muted); font-size: 13px; }
.awcg-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; margin: 8px 0; }
.awcg-card a { color: var(--accent2); }
.awcg-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.awcg-list { list-style: none; padding: 0; margin: 0; }
.awcg-list li { padding: 8px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.awcg-list li:hover { color: var(--accent2); }
.awcg-tag { display: inline-block; font-size: 11px; padding: 1px 6px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); margin-left: 4px; }
.awcg-tag.new { color: var(--accent); border-color: var(--accent); }
.awcg-tag.raised { color: var(--warn); border-color: var(--warn); }
input.awcg-in, select.awcg-in, textarea.awcg-in { width: 100%; box-sizing: border-box; background: transparent; color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px; font: inherit; margin: 4px 0 8px; }
textarea.awcg-in { min-height: 90px; resize: vertical; }
label.awcg-check { display: flex; gap: 8px; align-items: flex-start; margin: 6px 0; font-size: 13px; }
.awcg-chat { display: flex; flex-direction: column; height: 100%; }
.awcg-msgs { flex: 1; overflow-y: auto; font-size: 13px; }
.awcg-msgs .m { padding: 3px 0; word-wrap: break-word; }
.awcg-msgs .m b { color: var(--accent2); }
.awcg-msgs .m.agent b { color: var(--accent); }
.awcg-modal { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.55); z-index: 1100; display: flex; align-items: center; justify-content: center; padding: 16px; }
.awcg-modal .box { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; width: 100%; max-width: 440px; padding: 18px; max-height: 90vh; overflow-y: auto; }
.awcg-modal h2 { margin: 0 0 8px; }
.awcg-toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 14px; z-index: 1200; max-width: 90vw; }
.awcg-toast.bad { border-color: var(--bad); }
.awcg-swatches { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 8px; }
.awcg-swatches button { width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; }
.awcg-swatches button.on { border-color: var(--text); }
/* The look locker: each robot a card; locked colours show the day they open. */
.awcg-locker { display: grid; gap: 8px; margin: 8px 0; }
.awcg-locker-base.on { border-color: var(--accent); }
.awcg-locker-base.locked .awcg-locker-head b { color: var(--muted); }
.awcg-swatches button.locked { opacity: .45; position: relative; cursor: help; }
.awcg-swatches button .awcg-lock { font-size: 10px; font-weight: 700; color: #fff; text-shadow: 0 0 2px #000, 0 0 2px #000; }
.awcg-scoreboard { position: fixed; left: 12px; top: 68px; z-index: 998; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px;
  font: 13px/1.3 var(--font); color: var(--text); }
.awcg-scoreboard b { color: var(--accent); font-size: 16px; }
/* The menu button shows only on phones (launch review: the menu was cut off at 390 px). */
.awcg-menu { display: none; }
.awcg-chat input.awcg-in { width: 100%; flex: none; }
@media (max-width: 640px) {
  .awcg-brand span { display: none; }
  .awcg-panel { width: 100vw; }
  .awcg-scoreboard { display: none; }
  .awcg-menu { display: inline-flex; }
  .awcg-top nav { display: none; position: fixed; top: 56px; left: 0; right: 0; flex-direction: column; gap: 6px; padding: 10px 12px;
    background: var(--panel-solid); border-bottom: 1px solid var(--line); overflow: visible; z-index: 1001; }
  .awcg-top.nav-open nav { display: flex; }
  .awcg-top nav .awcg-btn { width: 100%; text-align: left; min-height: 42px; font-size: 15px; }
  .awcg-top .awcg-me { max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
.awcg-btn.raid.on { background: var(--raid); color: #1a0016; border-color: var(--raid); }
.awcg-optional { margin-top: 14px; border-top: 1px solid rgba(255,255,255,.12); padding-top: 10px; }
.awcg-optional summary { cursor: pointer; font-weight: 600; }

/* Chat: messages you can act on, and why a channel is reading only. */
.awcg-msgs .m.can-act { cursor: pointer; }
.awcg-msgs .m.can-act:hover { background: rgba(57, 210, 192, .08); }
.awcg-why:empty { display: none; }

/* The first-visit welcome card. */
.awcg-welcome { position: fixed; left: 50%; bottom: 76px; transform: translateX(-50%); z-index: 1002; width: min(440px, calc(100vw - 32px)); box-sizing: border-box;
  background: var(--panel-solid); border: 1px solid var(--accent); border-radius: 12px; padding: 14px 16px; font: 14px/1.45 var(--font); color: var(--text);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45); }
.awcg-welcome b { font-size: 16px; display: block; margin: 0 24px 4px 0; }
.awcg-welcome p { margin: 0 0 10px; }
.awcg-welcome small { display: block; margin-top: 8px; }
.awcg-welcome-x { position: absolute; top: 8px; right: 8px; background: transparent; border: 0; color: var(--muted); font-size: 16px; cursor: pointer; }
