/* The Control Room's look: the app's ink and arcade colours (ios/AmigosDS Tokens.swift), Funnel Display for titles. */
@font-face { font-family: "Funnel Display"; src: url("/admin/FunnelDisplay.ttf") format("truetype"); font-weight: 300 800; }
:root {
  --ink0: #0B0B20; --ink1: #161733; --ink2: #222449; --ink3: #333666;
  --text: #F4F3EE; --text2: #CFCDE6; --text3: #B2B1CF;
  --action: #FF1F8F; --live: #2BFF88; --score: #FFD21F; --social: #2AA8FF; --ai: #8F5BFF;
}
* { box-sizing: border-box; margin: 0; }
[hidden] { display: none !important; }
body { background: var(--ink0); color: var(--text); font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; min-height: 100vh; }
h1 { font-family: "Funnel Display", sans-serif; font-weight: 700; font-size: 30px; }
.quiet { color: var(--text3); }
.error { color: var(--action); min-height: 1.4em; font-weight: 600; }
.brand { display: flex; gap: 10px; align-items: center; font-family: "Funnel Display", sans-serif; font-weight: 800; font-size: 22px; }
.brand small { display: block; font: 600 11px -apple-system, sans-serif; letter-spacing: .08em; text-transform: uppercase; color: var(--text3); }
.mark { width: 30px; height: 30px; border-radius: 9px; background: var(--action); display: inline-block; }
.btn { font: inherit; font-weight: 700; border: 0; border-radius: 12px; padding: 12px 18px; min-height: 44px; background: var(--ink2); color: var(--text); cursor: pointer; }
.btn.hot { background: var(--action); color: #fff; }
.btn.small { padding: 6px 12px; min-height: 36px; font-size: 13px; }
.btn.link { background: none; color: var(--text2); }
.btn:disabled { opacity: .5; cursor: default; }
input, select { font: inherit; color: var(--text); background: var(--ink2); border: 1px solid var(--ink3); border-radius: 12px; padding: 11px 14px; min-height: 44px; }
input:focus, select:focus, .btn:focus-visible, a:focus-visible { outline: 2px solid var(--social); outline-offset: 2px; }
label { font-size: 13px; font-weight: 600; color: var(--text2); }

.signin { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.signin-card { width: min(400px, 100%); background: var(--ink1); border: 1px solid var(--ink2); border-radius: 20px; padding: 28px; display: grid; gap: 18px; }
.signin-card form { display: grid; gap: 10px; }

.shell { display: flex; min-height: 100vh; }
.side { width: 232px; flex: none; background: var(--ink1); border-right: 1px solid var(--ink2); padding: 22px 14px; display: flex; flex-direction: column; gap: 2px; }
.side .brand { padding: 0 10px 22px; }
.side a, .side .soon { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-radius: 10px; color: var(--text2); text-decoration: none; font-weight: 500; min-height: 40px; }
.side a:hover { background: var(--ink2); }
.side a.on { background: var(--ink2); color: var(--text); }
.side .soon { color: var(--ink3); }
.side .soon em { font-style: normal; font-size: 11px; color: var(--text3); opacity: .6; }
.who { margin-top: auto; padding: 14px 12px 0; border-top: 1px solid var(--ink2); display: grid; gap: 6px; font-size: 13px; overflow-wrap: anywhere; }
.main { flex: 1; min-width: 0; padding: 28px 32px; }
.main section { display: grid; gap: 16px; }

.card { background: var(--ink1); border: 1px solid var(--ink2); border-radius: 16px; padding: 16px 18px; overflow-x: auto; }
.pulse { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; }
.pulse .k { font-size: 12px; font-weight: 600; color: var(--text3); }
.pulse .v { font-family: "Funnel Display", sans-serif; font-weight: 700; font-size: 32px; margin-top: 4px; }

/* Step 2: the Overview. Each measure keeps its colour role: players social, new players live,
   plays action, Cades and AI ai, Coins score. */
h2 { font-family: "Funnel Display", sans-serif; font-weight: 700; font-size: 21px; line-height: 1.25; }
h3 { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text3); }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.page-head p { margin-top: 4px; font-size: 13px; }
#ov-error:empty, #safety-error:empty { display: none; }
.card-title { font-size: 17px; margin-bottom: 8px; }
.chip { display: inline-block; border-radius: 99px; padding: 3px 10px; font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.chip.ai { background: color-mix(in srgb, var(--ai) 22%, transparent); color: #CDB8FF; }

.brief { display: grid; gap: 10px; border-color: color-mix(in srgb, var(--ai) 45%, var(--ink2)); background: linear-gradient(135deg, color-mix(in srgb, var(--ai) 12%, var(--ink1)), var(--ink1) 60%); }
.brief-top { display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.brief ul { padding-left: 20px; display: grid; gap: 6px; color: var(--text2); }
.brief-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12px; }

.alerts { display: grid; gap: 8px; }
.alert { display: flex; gap: 10px; align-items: center; padding: 12px 16px; border-radius: 14px; background: var(--ink1); border: 1px solid var(--ink2); font-weight: 600; }
.alert .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.alert.red { border-color: color-mix(in srgb, var(--action) 55%, var(--ink2)); }
.alert.red .dot { background: var(--action); box-shadow: 0 0 10px var(--action); }
.alert.amber { border-color: color-mix(in srgb, var(--score) 45%, var(--ink2)); }
.alert.amber .dot { background: var(--score); }
.alert.calm { color: var(--text2); font-weight: 500; }
.alert.calm .dot { background: var(--live); }

.tile { font: inherit; color: inherit; text-align: left; cursor: pointer; display: grid; gap: 2px; min-height: 44px; }
.tile:hover { border-color: var(--ink3); }
.tile.on { border-color: var(--text3); }
.tile .v.social { color: var(--social); } .tile .v.live { color: var(--live); } .tile .v.action { color: var(--action); }
.tile .v.ai { color: #B596FF; } .tile .v.score { color: var(--score); }
.tile-foot { display: flex; gap: 8px; align-items: baseline; font-size: 12px; }
.delta { font-weight: 800; }
.delta.up { color: var(--live); } .delta.down { color: var(--action); } .delta.flat { color: var(--text3); }
.spark { width: 100%; height: 28px; margin-top: 8px; fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.spark polyline { vector-effect: non-scaling-stroke; }
.social { --tone: var(--social); } .live { --tone: var(--live); } .action { --tone: var(--action); } .ai { --tone: #B596FF; } .score { --tone: var(--score); }
.spark { stroke: var(--tone); }
.totals { font-size: 13px; margin-top: -6px; }

.chart-card { display: grid; gap: 12px; overflow: visible; }
.chart-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tab { font: inherit; font-size: 13px; font-weight: 600; color: var(--text2); background: none; border: 1px solid transparent; border-radius: 10px; padding: 8px 12px; min-height: 44px; cursor: pointer; }
.tab:hover { background: var(--ink2); }
.tab.on { background: var(--ink2); color: var(--text); border-color: var(--ink3); }
.tab:focus-visible { outline: 2px solid var(--social); outline-offset: 2px; }
.chart-frame { position: relative; }
.line-chart { display: block; width: 100%; height: 260px; touch-action: pan-y; }
.line-chart .grid { stroke: var(--ink2); stroke-width: 1; }
.line-chart .axis { fill: var(--text3); font-size: 11px; }
.line-chart .line { fill: none; stroke: var(--tone); stroke-width: 2.5; stroke-linejoin: round; }
.line-chart .area { fill: color-mix(in srgb, var(--tone) 14%, transparent); }
.line-chart .guide { stroke: var(--ink3); stroke-dasharray: 3 3; }
.line-chart .dot { fill: var(--tone); stroke: var(--ink1); stroke-width: 2; }
.tip { position: absolute; top: 0; transform: translateX(-50%); background: var(--ink2); border: 1px solid var(--ink3); border-radius: 10px; padding: 6px 10px; font-size: 12px; display: grid; pointer-events: none; white-space: nowrap; }
.tip b { font-size: 15px; }
.chart-sum { font-size: 13px; }
th.n, td.n { text-align: right; font-variant-numeric: tabular-nums; }
.row-form { display: flex; flex-wrap: wrap; gap: 10px; }
.row-form input[type=email] { flex: 1 1 240px; }
.row-form input:not([type]) { flex: 1 1 200px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 8px; border-top: 1px solid var(--ink2); vertical-align: top; }
th { border-top: 0; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text3); }
td .tag { display: inline-block; border-radius: 99px; padding: 2px 10px; font-size: 12px; font-weight: 700; background: var(--ink2); }
td .tag.owner { background: var(--action); color: #fff; }
td .tag.admin { background: var(--ai); color: #fff; }
tr.gone td { color: var(--text3); }
td select { min-height: 36px; padding: 6px 10px; }
td code { font-size: 12px; color: var(--text3); }

@media (max-width: 760px) {
  .shell { flex-direction: column; }
  .side { width: auto; flex-direction: row; flex-wrap: wrap; padding: 12px 16px; border-right: 0; border-bottom: 1px solid var(--ink2); }
  .side .brand { width: 100%; padding: 0 0 8px; }
  .side .soon { display: none; }
  .who { width: 100%; margin-top: 8px; }
  .main { padding: 20px 16px; }
}

/* Step 3: Safety. */
.side a .count { font-style: normal; font-size: 11px; font-weight: 800; background: var(--action); color: #fff; border-radius: 99px; padding: 1px 8px; }
a.alert { color: inherit; text-decoration: none; }
a.alert:hover { border-color: var(--text3); }
.cards { display: grid; gap: 14px; }
.report { display: grid; gap: 12px; }
.target { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.target-wrap { display: grid; gap: 6px; }
.target-wrap details { color: var(--text2); font-size: 14px; }
.target-wrap summary { cursor: pointer; color: var(--text3); font-weight: 600; min-height: 32px; display: flex; align-items: center; }
.tagline { color: var(--text2); font-style: italic; }
.chip.cade { background: color-mix(in srgb, var(--action) 22%, transparent); color: #FF8CC6; }
.chip.person { background: color-mix(in srgb, var(--social) 22%, transparent); color: #8CD3FF; }
.chip.plain { background: var(--ink2); color: var(--text2); text-transform: none; letter-spacing: 0; font-size: 12px; font-weight: 700; }
.reasons { display: flex; gap: 6px; flex-wrap: wrap; }
.small { font-size: 12px; }
.notes { display: grid; gap: 6px; }
blockquote { border-left: 3px solid var(--ink3); padding: 4px 12px; color: var(--text2); }
blockquote.appeal { border-color: var(--social); }
.ai-box { display: grid; gap: 6px; padding: 12px 14px; border-radius: 12px; background: color-mix(in srgb, var(--ai) 10%, var(--ink1)); border: 1px solid color-mix(in srgb, var(--ai) 35%, var(--ink2)); justify-items: start; }
.ai-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.verdict { font-weight: 800; font-size: 13px; }
.verdict.red { color: var(--action); } .verdict.amber { color: var(--score); } .verdict.calm { color: var(--live); }
.decide { display: grid; gap: 10px; border-top: 1px solid var(--ink2); padding-top: 12px; }
.row-buttons { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.decide-form { display: grid; gap: 10px; }
.decide-form label { display: grid; gap: 6px; }
textarea { font: inherit; color: var(--text); background: var(--ink2); border: 1px solid var(--ink3); border-radius: 12px; padding: 11px 14px; resize: vertical; width: 100%; }
textarea:focus { outline: 2px solid var(--social); outline-offset: 2px; }
