:root {
  --bg: #f4f6f8; --card: #ffffff; --ink: #1d2733; --muted: #5d6b7a; --line: #dde3e9;
  --accent: #2f6fdb; --chip: #eef2f6;
  --ok: #1f8a4c; --ok-bg: #e3f5ea; --warn: #9a6200; --warn-bg: #fdf1d8;
  --info: #2a5db0; --info-bg: #e2ecfb; --bad: #b3261e; --bad-bg: #fbe4e2;
  --idle: #5d6b7a; --idle-bg: #eceff3; --evo: #0f7a78; --evo-bg: #daf3f2;
}
/* Dark follows the device unless the switch in the ribbon says otherwise. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12171d; --card: #1b222b; --ink: #e6ebf0; --muted: #9aa7b4; --line: #2c3642;
    --accent: #7aa7ff; --chip: #26303b;
    --ok: #6fd39a; --ok-bg: #173424; --warn: #f0c060; --warn-bg: #3a2e12;
    --info: #8db4ff; --info-bg: #1c2c47; --bad: #ff8a80; --bad-bg: #3d1c1a;
    --idle: #a9b4bf; --idle-bg: #262e38; --evo: #6fd8d3; --evo-bg: #143533;
  }
}
:root[data-theme="dark"] {
    --bg: #12171d; --card: #1b222b; --ink: #e6ebf0; --muted: #9aa7b4; --line: #2c3642;
    --accent: #7aa7ff; --chip: #26303b;
    --ok: #6fd39a; --ok-bg: #173424; --warn: #f0c060; --warn-bg: #3a2e12;
    --info: #8db4ff; --info-bg: #1c2c47; --bad: #ff8a80; --bad-bg: #3d1c1a;
    --idle: #a9b4bf; --idle-bg: #262e38; --evo: #6fd8d3; --evo-bg: #143533;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.wrap { max-width: 2560px; margin: 0 auto; padding: 0 16px; }
header { background: var(--card); border-bottom: 1px solid var(--line); padding: 16px 0; }
h1 { margin: 0; font-size: 22px; }
.sub { color: var(--muted); font-size: 13px; }
.titlebar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.who { color: var(--muted); font-size: 13px; display: flex; gap: 10px; align-items: center; }
.link { border: 0; background: none; color: var(--accent); font: inherit; cursor: pointer; padding: 0; }
.btn { border: 1px solid var(--line); background: var(--card); color: var(--ink); font: inherit; font-weight: 600;
  padding: 8px 14px; border-radius: 10px; cursor: pointer; }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.danger { color: var(--bad); }
.btn:disabled { opacity: .5; cursor: default; }

/* sign-in */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login-card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 28px 24px;
  width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 12px; text-align: center; align-items: center; }
.login-card p { margin: 0; color: var(--muted); font-size: 14px; }
.login-card input { width: 100%; height: 44px; padding: 0 12px; font: inherit; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink); }
.login-card .btn { width: 100%; height: 44px; }
.err { color: var(--bad); font-size: 13px; min-height: 18px; }

/* header stats */
.stats { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.stat { background: var(--chip); border-radius: 10px; padding: 8px 12px; min-width: 120px; }
.stat b { display: block; font-size: 18px; }
.stat span { color: var(--muted); font-size: 12px; }
.stat.edit { border: 1px dashed var(--line); font: inherit; color: inherit; text-align: left; cursor: pointer; }
.stat.edit:hover { border-color: var(--accent); }
.stat .pen { font-style: normal; font-size: 13px; color: var(--accent); font-weight: 400; }
.stat input { width: 110px; font: inherit; font-size: 17px; font-weight: 700; padding: 2px 6px; border-radius: 6px;
  border: 1px solid var(--accent); background: var(--card); color: var(--ink); display: block; }
nav.tabs { display: flex; gap: 4px; margin-top: 14px; }
nav.tabs button { border: 0; background: none; color: var(--muted); font: inherit; font-weight: 600;
  padding: 8px 14px; border-radius: 8px; cursor: pointer; }
nav.tabs button.on { background: var(--accent); color: #fff; }
main { padding: 16px 0 40px; }
footer { margin-top: 24px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* filters */
.controls { display: flex; align-items: flex-end; gap: 10px; margin-bottom: 14px; }
.dd { display: flex; flex-direction: column; gap: 3px; flex: 0 1 180px; min-width: 0; }
.dd span { color: var(--muted); font-size: 12px; font-weight: 600; }
.controls select, .controls input[type=search] { width: 100%; height: 40px; padding: 0 10px; font: inherit; border-radius: 10px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink); }
.controls select { cursor: pointer; }
.controls select.set { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.controls input[type=search] { flex: 1 1 220px; min-width: 0; margin-left: auto; }
.controls .add { height: 40px; white-space: nowrap; }
.count { color: var(--muted); font-size: 13px; margin: 4px 0 10px; }

/* tiles */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.tile { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px 10px 12px;
  display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; font: inherit; color: inherit;
  text-align: center; transition: transform .12s, box-shadow .12s; }
.tile:hover, .tile:focus-visible { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.12); outline: none; }
.tile .rank { position: absolute; top: 8px; left: 8px; margin: 0; }
.tile .iv { position: absolute; top: 8px; right: 8px; font-size: 13px; }
.tile .dot { position: absolute; bottom: 10px; right: 10px; }
.tile .name { font-size: 16px; font-weight: 700; }
.tile .mini { font-size: 12.5px; color: var(--muted); }
.tile .mini b { color: var(--ink); }
.pic { width: 110px; height: 110px; object-fit: contain; margin-top: 14px; }
.pic.big { width: 190px; height: 190px; margin: 0; }
.pic.small { width: 64px; height: 64px; margin: 0; }
.pic.shadow { filter: drop-shadow(0 0 7px #8a3fd8) drop-shadow(0 0 3px #5a1fa0); }
.pic.lucky { filter: drop-shadow(0 0 8px #f2c230); }
.pic.missing { display: flex; align-items: center; justify-content: center; border-radius: 50%;
  background: var(--chip); color: var(--muted); font-size: 42px; font-weight: 700; }
.pic.small.missing { font-size: 24px; }
.rank { display: inline-block; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700;
  border-radius: 6px; padding: 1px 7px; margin-right: 6px; vertical-align: 2px; }
.iv { font-weight: 700; padding: 2px 8px; border-radius: 8px; background: var(--chip); white-space: nowrap; }
.iv.hi { color: var(--ok); } .iv.mid { color: var(--warn); } .iv.lo { color: var(--bad); }
.tags { display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; }
.tag { font-size: 11.5px; padding: 2px 8px; border-radius: 999px; background: var(--chip); color: var(--muted); font-weight: 600; }
.tag.type { color: #fff; text-transform: capitalize; }
.empty { color: var(--muted); padding: 30px 0; text-align: center; }

/* status colors */
.s-ready { color: var(--ok); background: var(--ok-bg); } .s-fix { color: var(--warn); background: var(--warn-bg); }
.s-check { color: var(--info); background: var(--info-bg); } .s-candy { color: var(--idle); background: var(--idle-bg); }
.s-evolve { color: var(--evo); background: var(--evo-bg); } .s-replace { color: var(--bad); background: var(--bad-bg); }
.s-later { color: var(--idle); background: var(--idle-bg); }

/* pop-up */
.modal-bg { position: fixed; inset: 0; background: rgba(8,12,18,.55); display: flex; align-items: center; justify-content: center;
  padding: 16px; z-index: 50; }
.modal { background: var(--card); color: var(--ink); border-radius: 18px; width: 100%; max-width: 580px; max-height: 92vh; max-height: 92dvh;
  overflow-y: auto; padding: 18px 20px 22px; position: relative; display: flex; flex-direction: column; gap: 12px; }
/* The close button stays pinned to the top of the pop-up while it scrolls. */
.modal .close { position: sticky; top: 0; align-self: flex-end; flex: none; margin: -6px -8px -34px 0; width: 40px; height: 40px;
  border-radius: 50%; border: 0; background: var(--chip); color: var(--ink); font-size: 22px; cursor: pointer; z-index: 3;
  box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.modal h2 { margin: 0; font-size: 20px; }
.hero { display: flex; flex-direction: column; align-items: center; gap: 6px; padding-top: 6px; }
.hero .name { font-size: 24px; font-weight: 700; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.facts.one { grid-template-columns: 1fr; }
.fact { background: var(--chip); border-radius: 10px; padding: 8px 10px; text-align: center; }
.fact b { display: block; font-size: 18px; }
.fact span { font-size: 12px; color: var(--muted); }
.fact.good b { color: var(--ok); } .fact.bad b { color: var(--bad); }
.section-lbl { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.mvrow { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mv { border-radius: 12px; padding: 8px 12px; background: var(--chip); border: 2px solid transparent; position: relative; }
.mv span { display: block; font-size: 11.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.mv b { display: block; font-size: 16px; margin-top: 1px; }
.mv i { position: absolute; top: 7px; right: 9px; font-style: normal; font-size: 11px; font-weight: 700; }
.mv.best { border-color: var(--accent); } .mv.best i { color: var(--accent); }
.mv.good { border-color: var(--ok); background: var(--ok-bg); } .mv.good i { color: var(--ok); font-size: 15px; }
.mv.bad { border-color: var(--warn); background: var(--warn-bg); }
.mv.unk b { color: var(--muted); font-weight: 600; }
.mv.wide { grid-column: 1 / -1; }
.todo { display: flex; flex-wrap: wrap; gap: 8px; }
.chipbig { font-size: 14px; font-weight: 700; padding: 7px 12px; border-radius: 10px; }
.chipbig.plain { background: var(--chip); color: var(--ink); font-weight: 600; }
.actions { display: flex; gap: 8px; justify-content: space-between; flex-wrap: wrap; margin-top: 4px; }

/* edit form */
.form { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 12px; }
.form label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); font-weight: 600; min-width: 0; }
.form label.wide { grid-column: 1 / -1; }
.form input, .form select, .form textarea { width: 100%; height: 40px; padding: 0 10px; font: inherit; font-size: 15px; color: var(--ink);
  border-radius: 10px; border: 1px solid var(--line); background: var(--bg); }
.form textarea { height: 320px; padding: 10px; font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.checks label { flex-direction: row; align-items: center; gap: 6px; background: var(--chip); padding: 6px 10px; border-radius: 8px;
  color: var(--ink); font-size: 14px; }
.checks input { width: auto; height: auto; }

/* raids */
.tier { margin: 18px 0 8px; font-size: 16px; }
.raidgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.raid { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px; display: flex; flex-direction: column;
  align-items: center; gap: 4px; cursor: pointer; font: inherit; color: inherit; text-align: center; }
.raid { position: relative; }
.raid:hover { border-color: var(--accent); }
/* when this boss leaves, in the corner where it doesn't push the picture or the name around */
.boss-clock { position: absolute; top: 6px; right: 7px; font-style: normal; font-size: 11px; font-weight: 800;
  font-variant-numeric: tabular-nums; color: var(--muted); background: var(--chip); border-radius: 999px;
  padding: 2px 6px; line-height: 1.35; }
.boss-clock.ends-red { color: var(--bad); }
/* the top 50, folded away under the page that uses it */
.t50 { background: var(--card); border: 1px solid var(--line); border-radius: 14px; margin: 14px 0 6px; }
.t50 > summary { cursor: pointer; padding: 12px 14px; font-weight: 700; font-size: 15px; list-style: none; }
.t50 > summary::-webkit-details-marker { display: none; }
.t50 > summary::before { content: "▸ "; color: var(--muted); }
.t50[open] > summary::before { content: "▾ "; }
.t50 > summary:hover { color: var(--accent); }
.t50-body { padding: 0 12px 12px; }

/* how likely a shiny is */
.shiny-odds { display: flex; flex-direction: column; gap: 2px; background: var(--chip); border-radius: 12px; padding: 8px 12px; }
.shiny-odds b { font-size: 15px; color: var(--warn); }
.shiny-odds b small { font-size: 12px; font-weight: 600; opacity: .85; }
.shiny-odds span { font-size: 12px; color: var(--muted); }
.shiny-odds.none b { color: var(--muted); }
.shiny-tbl { border-collapse: collapse; width: 100%; margin: 6px 0 12px; }
.shiny-tbl th { text-align: left; padding: 6px 8px; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.shiny-tbl td { padding: 7px 8px; border-top: 1px solid var(--line); vertical-align: top; }
.shiny-tbl td.odds { white-space: nowrap; font-weight: 800; color: var(--warn); }
.shiny-tbl td.pct { white-space: nowrap; color: var(--muted); font-variant-numeric: tabular-nums; }
.shiny-tbl tr.unknown td.odds { color: var(--muted); font-weight: 600; }
.shiny-tbl td span.sub { display: block; font-size: 12px; }
.g-shiny { font-style: normal; color: var(--warn); font-size: 11.5px; white-space: nowrap; }
.egg-shiny-line, .rocket-shiny { margin: 2px 0 8px; }
.egg-shiny-line em, .rocket-shiny em { opacity: .8; font-size: 12px; }

/* eggs */
.egg-shiny { position: absolute; top: 5px; left: 8px; font-style: normal; font-size: 13px; color: var(--warn); }
.egg-cp { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.rar { font-size: 9px; letter-spacing: 1px; color: var(--muted); line-height: 1; }
.egg-season { margin: 2px 0 14px; }
.egg-season .ends-red { color: var(--bad); }
.egg-season .ends-amber { color: var(--warn); }
.egg-season .ends-green { color: var(--ok); }
.boss-clock.ends-amber { color: var(--warn); }
.boss-clock.ends-green { color: var(--ok); }
.raid .pic { margin-top: 0; width: 84px; height: 84px; }
.raid b { font-size: 14px; }
.teamrow { display: flex; align-items: center; gap: 10px; background: var(--chip); border-radius: 12px; padding: 6px 10px; }
.teamrow .who2 { flex: 1; min-width: 0; }
.teamrow .who2 b { display: block; }
.teamrow .who2 span { font-size: 12.5px; color: var(--muted); }
.mult { font-weight: 700; font-size: 13px; color: var(--ok); white-space: nowrap; }

/* guide */
.guide-actions { display: flex; justify-content: flex-end; margin-bottom: 10px; }
.guide { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 4px 18px 16px; margin-bottom: 14px; }
.guide h2 { font-size: 18px; margin: 16px 0 8px; }
.guide h3 { font-size: 15px; margin: 14px 0 6px; }
.guide table { border-collapse: collapse; width: 100%; font-size: 14px; margin: 6px 0; }
.guide th, .guide td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.guide th { color: var(--muted); font-weight: 600; font-size: 12.5px; }
.guide code { background: var(--chip); padding: 1px 5px; border-radius: 5px; font-size: 13px; }
.guide ul, .guide ol { padding-left: 22px; margin: 6px 0; }
.tablewrap { overflow-x: auto; }

@media (max-width: 700px) {
  .controls { flex-wrap: wrap; }
  .dd { flex: 1 1 28%; }
  .controls input[type=search] { flex: 1 1 55%; margin-left: 0; }
}
@media (max-width: 520px) {
  .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .pic { width: 88px; height: 88px; }
  .stat { min-width: 0; flex: 1 1 45%; }
  .modal-bg { align-items: flex-end; padding: 0; }
  /* dvh = the part of the screen you can actually see, so the browser's address bar never covers the top */
  .modal { border-radius: 18px 18px 0 0; max-height: 88vh; max-height: 88dvh; padding-top: 14px; }
  .pic.big { width: 150px; height: 150px; }
  .form { grid-template-columns: 1fr 1fr; }
}

/* screenshot update */
.pickbtn { display: inline-flex; align-items: center; justify-content: center; height: 48px; align-self: stretch; }
.chklist { display: flex; flex-direction: column; gap: 8px; }
.chk { display: grid; grid-template-columns: 24px 110px 1fr; align-items: center; gap: 8px; background: var(--chip);
  border-radius: 12px; padding: 10px 12px; cursor: pointer; }
.chk input { width: 20px; height: 20px; }
.chk-lbl { font-size: 13px; color: var(--muted); font-weight: 600; }
.chk-val s { color: var(--muted); }
.chk-val b { font-size: 16px; }

/* status dots + color key */
:root { --pow: #7b4fd6; --pow-bg: #efe8fc; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --pow: #b99bff; --pow-bg: #2c2240; } }
:root[data-theme="dark"] { --pow: #b99bff; --pow-bg: #2c2240; }
.s-power { color: var(--pow); background: var(--pow-bg); }
.dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; flex: none; }
.dot.s-ready { background: var(--ok); } .dot.s-power { background: var(--pow); } .dot.s-fix { background: var(--warn); }
.dot.s-check { background: var(--info); } .dot.s-candy { background: var(--idle); } .dot.s-evolve { background: var(--evo); }
.dot.s-replace { background: var(--bad); } .dot.s-later { background: transparent; box-shadow: inset 0 0 0 2px var(--idle); }
.mons-layout { display: grid; grid-template-columns: 210px 1fr; gap: 18px; align-items: start; }
.mons-main { min-width: 0; }
.legend { position: sticky; top: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.legend-title { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
.legend-item { display: grid; grid-template-columns: 14px 1fr; column-gap: 8px; align-items: center; text-align: left;
  border: 1px solid transparent; background: none; color: var(--ink); font: inherit; padding: 6px 8px; border-radius: 10px; cursor: pointer; }
.legend-item:hover:not(:disabled) { background: var(--chip); }
.legend-item.on { background: var(--chip); border-color: var(--accent); }
.legend-item:disabled { opacity: .45; cursor: default; }
.legend-name { font-weight: 700; font-size: 14px; }
.legend-name i { font-style: normal; color: var(--muted); font-weight: 600; font-size: 12px; margin-left: 2px; }
.legend-says { grid-column: 2; font-size: 12px; color: var(--muted); line-height: 1.3; }
@media (max-width: 860px) {
  .mons-layout { grid-template-columns: 1fr; }
  .legend { position: static; flex-direction: row; flex-wrap: wrap; gap: 6px; padding: 10px; }
  .legend-title { width: 100%; margin-bottom: 0; }
  .legend-item { display: inline-flex; gap: 6px; padding: 5px 9px; background: var(--chip); }
  .legend-says { display: none; }
  .legend-name { font-size: 13px; }
}

/* basic info + suggestions + bulk add */
.s-basic { color: var(--muted); background: var(--chip); }
.dot.s-basic { background: transparent; box-shadow: inset 0 0 0 2px var(--info); }
.suggest { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; margin-bottom: 12px; }
.suggest-title { font-weight: 700; margin-bottom: 8px; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.suggest-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.suggest-item { flex: 0 0 150px; display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center;
  background: var(--chip); border: 1px solid transparent; border-radius: 12px; padding: 8px; font: inherit; color: inherit; cursor: pointer; }
.suggest-item:hover { border-color: var(--accent); }
.suggest-item span { font-size: 11.5px; color: var(--muted); line-height: 1.25; }
.progress { height: 8px; background: var(--chip); border-radius: 99px; overflow: hidden; }
.progress div { height: 100%; width: 0; background: var(--accent); transition: width .3s; }
.bulkgroup { border: 1px solid var(--line); border-radius: 12px; padding: 6px 10px; }
.bulkgroup summary { font-weight: 700; cursor: pointer; padding: 4px 0; }
.bulkrow { display: grid; grid-template-columns: 22px 48px 1fr auto; grid-template-rows: auto auto; column-gap: 8px; align-items: center;
  padding: 6px 0; border-top: 1px solid var(--line); cursor: pointer; }
.bulkrow .pic.small { width: 44px; height: 44px; grid-row: 1 / 3; grid-column: 2; }
.bulkrow input { width: 18px; height: 18px; grid-row: 1 / 3; }
.bulk-name { grid-column: 3; } .bulk-name .tag { margin-left: 4px; }
.bulk-cp { grid-column: 4; font-weight: 700; font-size: 14px; }
.bulk-why { grid-column: 3 / 5; font-size: 12px; color: var(--muted); }
.bulkrow.unknown .bulk-why { color: var(--warn); }
.bulkrow.check .bulk-why { color: var(--warn); font-weight: 600; }

/* compact ribbon: tabs left, stats middle, account + version right */
header.ribbon { display: flex; align-items: center; gap: 16px; padding: 8px 16px; flex-wrap: wrap;
  position: sticky; top: 0; z-index: 40; }
.ribbon-left { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 8px; }
.brand h1 { font-size: 18px; white-space: nowrap; }
header.ribbon nav.tabs { margin: 0; }
header.ribbon .stats { margin: 0 auto; flex-wrap: nowrap; }
header.ribbon .stat { padding: 4px 10px; min-width: 0; }
header.ribbon .stat b { font-size: 16px; }
header.ribbon .stat span { font-size: 11px; }
.ribbon-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
/* With the Pokémon list skipped there's no count in the middle to hold the right-hand side out, so pin it. */
body.no-roster header.ribbon .ribbon-right { margin-left: auto; }
.rev-row { display: inline-flex; align-items: center; gap: 5px; }
.rev-badge { font: inherit; font-size: 12px; font-variant-numeric: tabular-nums; padding: 2px 9px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--chip); color: var(--ink); cursor: pointer; }
.rev-badge:hover { border-color: var(--accent); }
.rev-badge.rev-stale { background: #f0a500; color: #12240c; font-weight: 700; animation: revPulse 2.2s ease-in-out infinite; }
@keyframes revPulse { 0%,100% { box-shadow: 0 0 0 0 rgba(240,165,0,.75); } 50% { box-shadow: 0 0 0 7px rgba(240,165,0,0); } }
@media (prefers-reduced-motion: reduce) { .rev-badge.rev-stale { animation: none; } }
.rev-again { width: 20px; height: 20px; padding: 0; border-radius: 50%; border: 1px solid var(--line); background: var(--chip);
  color: var(--ink); font: italic 600 12px/1 Georgia, serif; cursor: pointer; }
.rev-again:hover { border-color: var(--accent); }
.wn-list { display: flex; flex-direction: column; gap: 10px; }
.wn-rev { background: var(--chip); border-radius: 12px; padding: 8px 12px; }
.wn-rev-head { display: flex; gap: 10px; align-items: baseline; margin-bottom: 4px; }
.wn-rev-num { font-weight: 800; } .wn-rev-date { color: var(--muted); font-size: 12px; }
.wn-item { display: flex; gap: 8px; align-items: baseline; }
.wn-kind { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 6px; background: var(--info-bg); color: var(--info); white-space: nowrap; }
.wn-added { background: var(--ok-bg); color: var(--ok); } .wn-fixed { background: var(--warn-bg); color: var(--warn); }
@media (max-width: 860px) {
  header.ribbon { gap: 8px; padding: 8px 12px; }
  header.ribbon .stats { order: 3; width: 100%; margin: 0; flex-wrap: wrap; }
  header.ribbon .stat { flex: 1 1 22%; }
  .ribbon-left { flex: 1 1 auto; gap: 8px; }
  header.ribbon nav.tabs button { padding: 6px 10px; }
}

/* installed app: keep clear of the phone's notch and home bar */
header.ribbon { padding-top: max(8px, env(safe-area-inset-top)); }
main { padding-bottom: max(40px, env(safe-area-inset-bottom)); }

/* hand edit */
.actions-right { display: inline-flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.step { display: grid; grid-template-columns: 44px 1fr 44px; gap: 6px; }
.step input, .step select { text-align: center; min-width: 0; }
.stepbtn { height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--chip); color: var(--ink);
  font-size: 22px; font-weight: 700; line-height: 1; cursor: pointer; touch-action: manipulation; }
.stepbtn:active { background: var(--accent); color: #fff; }
.lbl-sm { display: block; font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.checks .toggle { cursor: pointer; }
.checks .toggle:has(input:checked) { background: var(--accent); color: #fff; }

/* editing inside the pop-up */
.hint { text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--muted); margin-left: 6px; }
.fact.editable { cursor: text; border: 1px dashed var(--line); }
.fact.editable:focus-within { border-color: var(--accent); }
.fact-in { width: 100%; border: 0; background: transparent; color: var(--ink); font: inherit; font-size: 18px; font-weight: 700;
  text-align: center; padding: 0; outline: none; }
.fact-in::placeholder { color: var(--muted); }
.mv.pick { cursor: pointer; }
.mv.pick select { display: block; width: 100%; margin-top: 1px; border: 0; background: transparent; color: var(--ink);
  font: inherit; font-size: 16px; font-weight: 700; padding: 0; appearance: none; -webkit-appearance: none; cursor: pointer; outline: none; }
.mv.pick select option, .mv.pick select optgroup { background: var(--card); color: var(--ink); }
.mv.pick:focus-within { box-shadow: 0 0 0 2px var(--accent); }
.mv.pick.unk { border-color: var(--info); border-style: dashed; }
.toast { position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: var(--card); padding: 8px 16px; border-radius: 999px; font-weight: 700; font-size: 14px;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 80; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* move menu, in the app's own style */
.modal { position: relative; }
button.mv.pick { font: inherit; color: inherit; text-align: left; width: 100%; }
.mv.pick.open { box-shadow: 0 0 0 2px var(--accent); }
.move-menu { position: absolute; z-index: 60; max-height: 320px; overflow-y: auto; padding: 6px;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 32px rgba(0,0,0,.35);
  animation: mmIn .12s ease-out; }
@keyframes mmIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.mm-head { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: 8px 10px 4px; }
.mm-item { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; color: var(--ink); font: inherit;
  font-size: 15px; font-weight: 600; text-align: left; padding: 9px 10px; border-radius: 10px; cursor: pointer; }
.mm-item:hover, .mm-item:focus-visible { background: var(--chip); outline: none; }
.mm-item.on { background: var(--info-bg); color: var(--info); }
.mm-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.mm-name { flex: 1; }
.mm-check { font-weight: 800; }
.mm-clear { color: var(--muted); font-weight: 500; border-top: 1px solid var(--line); border-radius: 0 0 10px 10px; margin-top: 4px; }
.mm-empty { padding: 10px; color: var(--muted); font-size: 13px; }

/* missing information: red outline + "Needed" */
.need { border: 2px solid var(--bad) !important; background: var(--bad-bg) !important; position: relative; }
.need::after { content: "Needed"; position: absolute; top: -9px; left: 10px; background: var(--bad); color: #fff;
  font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; padding: 1px 7px; border-radius: 99px; }
.mv.pick.need b { color: var(--bad); }
.fact.need .fact-in::placeholder { color: var(--bad); }

.facts.two { grid-template-columns: 1fr 1fr; }

/* second charged move */
.mv.plain { border-color: var(--line); }
.add-move { grid-column: 1 / -1; justify-self: start; border: 1px dashed var(--line); background: none; color: var(--muted);
  font: inherit; font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 10px; cursor: pointer; }
.add-move:hover { border-color: var(--accent); color: var(--accent); }
.mvrow > .mv.pick[data-field="charged2_now"] { grid-column: 1 / -1; }

/* raid power next to a move name */
.mv b .pw, .mv b em.pw { float: right; font-style: normal; font-weight: 800; font-size: 15px; color: var(--muted);
  margin-left: 8px; font-variant-numeric: tabular-nums; }
.mv.good b .pw { color: var(--ok); }
.mm-pw { font-size: 13px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 28px; text-align: right; }

/* "type yes" confirmation */
.confirm-bg { position: fixed; inset: 0; z-index: 90; background: rgba(8,12,18,.6); display: flex; align-items: center;
  justify-content: center; padding: 16px; }
.confirm { background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 16px; width: 100%; max-width: 380px;
  padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 20px 50px rgba(0,0,0,.45); }
.confirm h3 { margin: 0; font-size: 18px; }
.confirm p { margin: 0; color: var(--muted); font-size: 14px; }
.confirm label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.confirm input { height: 42px; padding: 0 12px; font: inherit; font-size: 16px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg); color: var(--ink); }
.btn.danger-solid { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.danger-solid:disabled { opacity: .4; }
.fact-in.hi { color: var(--ok); } .fact-in.mid { color: var(--warn); } .fact-in.lo { color: var(--bad); }

/* search + evolution line switch */
.controls .searchbox { flex: 1 1 260px; min-width: 0; display: flex; gap: 8px; align-items: center; margin-left: auto; }
.controls .searchbox input[type=search] { flex: 1 1 auto; margin: 0; }
.evo-toggle { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 10px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--card); color: var(--muted); font-size: 13px; font-weight: 600; white-space: nowrap; cursor: pointer; }
.evo-toggle:has(input:checked) { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.evo-toggle input { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; }
@media (max-width: 700px) { .controls .searchbox { flex: 1 1 100%; } }
@media (max-width: 1300px) { .controls { flex-wrap: wrap; } .controls .searchbox { flex: 1 1 100%; order: 10; margin-left: 0; } }

/* use the whole screen: roomier search on wide screens */
.controls .searchbox { flex: 1 1 360px; }
@media (min-width: 1600px) { .wrap { padding: 0 24px; } }

/* Shiny / Lucky / Shadow / Purified switches in the pop-up */
.tag-toggles { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 8px; }
.tag-tog { border: 1px dashed var(--line); background: none; color: var(--muted); font: inherit; font-size: 12px; font-weight: 600;
  padding: 3px 10px; border-radius: 999px; cursor: pointer; }
.tag-tog:hover { border-color: var(--accent); color: var(--accent); }
.tag-tog.on { border-style: solid; border-color: var(--accent); background: var(--info-bg); color: var(--info); }

/* four dropdowns: two by two on phones */
@media (max-width: 700px) { .dd { flex: 1 1 40%; } }

.suggest-title .left { font-size: 12px; font-weight: 700; color: var(--info); background: var(--info-bg); padding: 2px 8px;
  border-radius: 999px; margin: 0 4px; vertical-align: 2px; }

.hero .size { color: var(--muted); font-size: 13px; margin-top: 4px; }

/* Account button + menu (top right) */
.acct { position: relative; }
.acct-btn { border: 1px solid var(--line); background: var(--card); color: var(--ink); font: inherit; font-size: 14px;
  font-weight: 600; padding: 5px 12px; border-radius: 999px; cursor: pointer; }
.acct-btn:hover, .acct-btn[aria-expanded="true"] { border-color: var(--accent); color: var(--accent); }
.acct-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 70; min-width: 230px; padding: 6px;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 32px rgba(0,0,0,.35);
  display: flex; flex-direction: column; animation: mmIn .12s ease-out; }
.acct-menu[hidden] { display: none; }
.acct-who { padding: 8px 10px 10px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.acct-who b { display: block; color: var(--ink); font-size: 14px; word-break: break-all; margin-top: 2px; }
.acct-set { display: flex; gap: 9px; align-items: flex-start; padding: 8px 10px; margin-bottom: 4px; cursor: pointer;
  border-bottom: 1px solid var(--line); }
.acct-set:hover { background: var(--chip); }
.acct-set input { margin: 3px 0 0; flex: none; }
.acct-set span { font-size: 13.5px; font-weight: 600; }
.acct-set i { display: block; font-style: normal; font-weight: 500; font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.acct-menu button { border: 0; background: none; color: var(--ink); font: inherit; font-size: 14px; font-weight: 600;
  text-align: left; padding: 9px 10px; border-radius: 10px; cursor: pointer; }
.acct-menu button:hover, .acct-menu button:focus-visible { background: var(--chip); outline: none; }
#logoutBtn { color: var(--bad); }
/* landing page: accounts on this device */
.acct-list { width: 100%; display: flex; flex-direction: column; gap: 8px; }
.acct-list:empty { display: none; }
.acct-row { display: flex; gap: 6px; }
.acct-pick { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: inherit; font-weight: 600;
  padding: 11px 14px; border-radius: 12px; cursor: pointer; text-align: left; }
.acct-pick span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-pick:hover { border-color: var(--accent); }
.acct-pick.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.acct-pick em { font-style: normal; font-size: 12px; color: var(--info); background: var(--info-bg); padding: 2px 8px;
  border-radius: 999px; flex: none; }
.acct-forget { flex: none; width: 40px; border: 1px solid var(--line); background: none; color: var(--muted); font-size: 18px;
  border-radius: 12px; cursor: pointer; }
.acct-forget:hover { color: var(--bad); border-color: var(--bad); }

/* + Add and Bulk Add sit above the legend, in line with the dropdowns, so the filter row has more room */
.side { position: sticky; top: 12px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.side .legend { position: static; }
.side-actions { display: flex; gap: 8px; margin-top: 19px; }       /* 19px = the dropdown labels' height */
.side-actions .btn { flex: 1 1 0; height: 40px; padding: 0 8px; white-space: nowrap; }
@media (max-width: 860px) {
  .side { position: static; }
  .side-actions { margin-top: 0; }
}

/* Wider screens: the header, filters and left column stay put; only the Pokémon area scrolls. */
@media (min-width: 861px) {
  header.ribbon { position: sticky; top: 0; z-index: 30; }
  .mons-main .controls { position: sticky; top: var(--hdr, 72px); z-index: 20; background: var(--bg);
    padding: 16px 0 12px; margin-top: -16px; }
  .side { top: calc(var(--hdr, 72px) + 16px); max-height: calc(100vh - var(--hdr, 72px) - 24px);
    max-height: calc(100dvh - var(--hdr, 72px) - 24px); overflow-y: auto; }
  .side .side-actions { margin-top: 19px; }
}

/* Raids: which Pokémon is Mega Evolved now, and the Mega chips on the team */
.mega-now { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 10px 14px; margin-bottom: 12px; }
.mega-now label { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.mega-now select { height: 38px; padding: 0 10px; font: inherit; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg); color: var(--ink); min-width: 200px; }
.mega-chip { font-style: normal; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; margin-left: 6px;
  background: #e85d9e; color: #fff; vertical-align: 2px; white-space: nowrap; }
.mega-chip.now { background: var(--info-bg); color: var(--info); }

/* Raids: swap your current Mega in */
.mega-swap { margin-top: 6px; }
.swap-out { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; color: var(--muted); margin-top: 8px; }
.swap-pick { display: inline-flex; align-items: center; gap: 6px; background: var(--chip); color: var(--ink); font-weight: 600;
  padding: 5px 10px 5px 5px; border-radius: 999px; }
.swap-pick b { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--accent);
  color: #fff; font-size: 12px; }

/* Guide: level-up picks */
.g-dust { color: var(--muted); font-size: 14px; margin-bottom: 8px; }
.g-dust b { color: var(--ink); }
.g-sec { margin-bottom: 22px; }
.g-sec h2 { margin: 6px 0 2px; font-size: 20px; }
.g-sec > .sub { margin: 0 0 10px; }
.g-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.g-card { display: flex; flex-direction: column; gap: 8px; text-align: left; font: inherit; color: var(--ink); cursor: pointer;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.g-card:hover { border-color: var(--accent); }
.g-top { display: flex; gap: 10px; align-items: center; }
.g-head { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.g-head b { font-size: 16px; }
.g-head span { font-size: 13px; color: var(--muted); }
.g-head strong { color: var(--ok); }
.g-cost { display: flex; gap: 8px; flex-wrap: wrap; font-size: 13px; font-weight: 600; }
.g-cost span { background: var(--chip); padding: 3px 9px; border-radius: 999px; }
.g-cost .good { color: var(--ok); }
.g-cost .bad { color: var(--bad); }
.g-tip { font-size: 12.5px; color: var(--muted); }
.g-moves { font-size: 12.5px; color: var(--muted); }
.g-moves.mega-plus { color: var(--ink); font-weight: 600; }
.g-where { display: flex; flex-direction: column; gap: 4px; }
.g-where.none { font-size: 12.5px; color: var(--muted); }
.g-src { font-size: 12.5px; line-height: 1.35; padding: 4px 8px; border-radius: 8px; background: var(--chip); }
.g-src b { margin-right: 4px; }
.g-src.now { background: rgba(80, 200, 120, .14); }
.g-src.now b { color: var(--ok); }
.g-src.soon b { color: var(--info); }
.guide-notes { margin-top: 10px; }
.guide-notes summary { cursor: pointer; color: var(--muted); font-weight: 600; padding: 6px 0; }
@media (max-width: 520px) { .g-grid { grid-template-columns: 1fr; } }

/* Guide: level range switch */
.g-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.g-bar .g-dust { margin: 0; }
.seg { display: inline-flex; background: var(--chip); border: 1px solid var(--line); border-radius: 12px; padding: 3px; gap: 3px; }
.seg button { border: 0; background: none; color: var(--muted); font: inherit; font-weight: 700; font-size: 14px; padding: 7px 14px;
  border-radius: 9px; cursor: pointer; }
.seg button.on { background: var(--accent); color: #fff; }
.seg button i { font-style: normal; font-weight: 600; opacity: .75; margin-left: 4px; }

/* Guide: top attackers you're missing */
.g-miss { cursor: default; }
.g-miss[data-id] { cursor: pointer; }
.g-miss .rank { font-size: 12px; margin-right: 4px; vertical-align: 2px; }
.g-head .tag, .g-head .type { margin-right: 6px; }
.g-tip.evo { color: var(--info); font-weight: 600; }

/* Raids: how many trainers */
.tier-how { font-size: 13px; font-weight: 600; color: var(--muted); margin-left: 8px; }
.trainers { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; margin-left: 6px;
  background: var(--info-bg); color: var(--info); }
.trainers-note { margin-top: 4px; text-align: center; }

/* Dynamax tab */
.max-soon { margin: 22px 0 4px; font-size: 20px; }
.teamrow.alt { opacity: .7; }

/* the next best move when the best one is Elite-only */
.alt-note { font-size: 13px; color: var(--muted); margin: -2px 0 4px; }
.alt-note b { color: var(--ink); }

/* "Lick 5 or Shadow Claw 6" on one line inside a best-move bubble */
.mv b.best-or { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 6px; }
.mv b.best-or em { font-style: normal; }
.mv b.best-or .pw-in { font-weight: 800; font-size: 14px; color: var(--muted); }
.mv b.best-or .or { font-weight: 600; font-size: 14px; color: var(--muted); margin: 0 2px; }
/* Best moves for Dynamax: the Max Attack each fast move makes, under its name. */
.mv .mx-makes { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.mv.best .mx-makes { color: var(--ink); font-weight: 600; }
.max-tips { margin-top: 6px; line-height: 1.45; }
.max-tips b { color: var(--ink); }

/* Form switch (Regular / Alolan / Galarian ...) */
.form-lbl { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; align-self: center; margin-right: 2px; }

/* Bulk Add: review a kept recording, and the regional form picker */
.review-run { width: 100%; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; margin: 8px 0; text-align: left; }
.formpick { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 2px 0 8px 30px; }
.fp-tile { width: 90px; border-radius: 8px; border: 1px solid var(--line); }
.fp-q { font-size: 12.5px; color: var(--muted); }
.fp { display: flex; flex-direction: column; align-items: center; gap: 2px; border: 1px solid var(--line); background: var(--card);
  color: var(--ink); border-radius: 10px; padding: 4px 8px; cursor: pointer; font: inherit; font-size: 12px; font-weight: 600; }
.fp img { width: 44px; height: 44px; object-fit: contain; }
.fp.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.fp.hint:not(.on) { border-style: dashed; border-color: var(--accent); }
.btn.small { padding: 5px 10px; font-size: 13px; }
.teamrow .dyn-yes { margin-left: auto; white-space: nowrap; }

/* Dynamax / Mega symbols on a tile's picture */
.tile .badges { position: absolute; top: 44px; left: 10px; display: flex; flex-direction: column; gap: 5px; }
.badge { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  box-shadow: 0 1px 4px rgba(0,0,0,.35), 0 0 0 2px var(--card); }
.badge svg { width: 18px; height: 18px; }
.badge.dmax { background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.35), 0 0 0 2px #e8458e; }
.badge.dmax svg { width: 21px; height: 18px; }
.badge.mega { background: none; box-shadow: none; border-radius: 0; height: 32px; }
.badge.mega svg { width: 25px; height: 32px; filter: drop-shadow(0 1px 2px rgba(0,0,0,.45)); }
.badge.mega.off { opacity: .38; filter: saturate(.5); }
@media (max-width: 640px) { .tile .badges { top: 38px; left: 6px; } .badge { width: 24px; height: 24px; } .badge svg { width: 15px; height: 15px; } }
@media (max-width: 640px) { .badge.dmax svg { width: 18px; height: 15px; } }
@media (max-width: 640px) { .badge.mega { height: 28px; } .badge.mega svg { width: 21px; height: 27px; } }
.max-catch { margin-top: 14px; }
.max-catch summary { cursor: pointer; font-weight: 700; color: var(--muted); }

/* Tile: CP big at the top like the game, level as a chip beside the type, a bigger picture */
.tile .cptop { font-size: 22px; font-weight: 800; line-height: 1; margin-top: 2px; letter-spacing: .2px; color: var(--ink); white-space: nowrap; }
.tile .cptop small { font-size: 12px; font-weight: 700; color: var(--muted); margin-right: 3px; letter-spacing: .5px; }
.tile .pic { width: 128px; height: 128px; margin-top: 0; }
.tile .tag.lv { color: var(--ink); }
@media (max-width: 520px) {
  .tile .cptop { font-size: 19px; }
  .tile .cptop small { font-size: 11px; }
  .tile .pic { width: 104px; height: 104px; }
}
/* The CP has the top line to itself; rank and IV sit just under it, at the picture's sides */
.tile .rank { top: 38px; left: 8px; }
.tile .iv { top: 38px; right: 8px; }
.tile .badges { top: 66px; left: 8px; }
.tile .cptop { margin-top: 0; }
@media (max-width: 640px) { .tile .rank, .tile .iv { top: 34px; } .tile .badges { top: 60px; left: 6px; } }

/* Guide → Top 50 */
.g-tip.have { color: var(--ok); font-weight: 600; }
.g-tip.miss { color: var(--bad); font-weight: 600; }
.g-card.g-have { border-color: rgba(80, 200, 120, .45); }
.g-head .rank { color: #fff; font-size: 12px; }

/* Guide → Improve */
.imp-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.imp-form label { display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.imp-form input { width: 120px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--chip);
  color: var(--ink); font: inherit; font-size: 15px; font-weight: 700; padding: 0 10px; }
.imp-form .btn { height: 38px; }
.imp-steps { margin: 0; padding-left: 20px; font-size: 13px; display: flex; flex-direction: column; gap: 3px; }
.imp-steps li.short { color: var(--bad); }
.imp-steps li.note { color: var(--muted); list-style: circle; }
.g-tip.bad { color: var(--bad); font-weight: 600; }
@media (max-width: 520px) { .imp-form label { flex: 1 1 45%; } .imp-form input { width: 100%; } .imp-form .btn { flex: 1 1 100%; } }

/* ─── phone-size screens ─────────────────────────────────────────── */
.acct-ico { display: none; width: 16px; height: 16px; vertical-align: -3px; }
.dots-help { display: none; width: 22px; height: 22px; padding: 0; margin-left: 6px; border-radius: 50%; vertical-align: middle;
  border: 1px solid var(--line); background: var(--chip); cursor: pointer; align-items: center; justify-content: center; gap: 2px; }
.dots-help i { width: 5px; height: 5px; border-radius: 50%; }
.dots-help .d1 { background: var(--ok); } .dots-help .d2 { background: var(--pow); } .dots-help .d3 { background: var(--warn); }
.dots-help:hover, .dots-help:focus-visible { border-color: var(--accent); outline: none; }
.legend-pop { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; }
.legend-pop .legend-item { display: grid; grid-template-columns: 14px 1fr; background: none; padding: 8px 10px; }
.legend-pop .legend-says { display: block; }
.legend-pop .legend-name { font-size: 15px; }
@media (max-width: 860px) {
  .legend { display: none; }                         /* the dots key is the round button next to Status */
  .dots-help { display: inline-flex; }
}
@media (max-width: 640px) {
  /* Brand on the left, account + version on the right of the same line; the header scrolls away with the page */
  header.ribbon { position: relative; gap: 8px; }
  .ribbon-left { width: 100%; }
  .brand h1 { font-size: 17px; }
  .ribbon-right { position: absolute; top: max(8px, env(safe-area-inset-top)); right: 12px; flex-direction: row; align-items: center; gap: 6px; }
  .acct-btn { font-size: 13px; padding: 4px 10px; }
  header.ribbon nav.tabs { width: 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  header.ribbon nav.tabs::-webkit-scrollbar { display: none; }
  header.ribbon nav.tabs button { white-space: nowrap; flex: none; padding: 6px 11px; }
  header.ribbon .stats { gap: 6px; }
  header.ribbon .stat { flex: 1 1 0; padding: 4px 8px; }
  header.ribbon .stat b { font-size: 15px; }
  header.ribbon .stat span { font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
  .side-actions .btn { height: 44px; }
}
@media (max-width: 420px) {
  .acct-txt { display: none; }                       /* just the person icon */
  .acct-ico { display: inline-block; }
  .brand img { width: 22px; height: 22px; }
}
.dd > span { display: flex; align-items: center; min-height: 20px; }
.dots-help { width: 20px; height: 20px; }

/* Phone: the four filters and "Evolution line" fold away behind a Filters button next to the search */
.filters-btn { display: none; height: 40px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); font: inherit; font-weight: 700; white-space: nowrap; cursor: pointer;
  align-items: center; gap: 6px; }
.filters-btn[aria-expanded="true"] { border-color: var(--accent); color: var(--accent); }
.filters-btn i { font-style: normal; font-size: 12px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--accent); color: #fff; display: inline-flex; align-items: center; justify-content: center; }
.filters-btn i[hidden] { display: none; }
.count-row { display: flex; align-items: center; gap: 8px; }
.count-row .dots-help { display: none; margin: 0 0 6px; }
@media (max-width: 640px) {
  .filters-btn { display: inline-flex; }
  .controls { gap: 8px; }
  .controls .searchbox { order: -1; }                  /* search first */
  .controls:not(.open) .dd, .controls:not(.open) .evo-toggle { display: none; }
  .controls.open .searchbox { flex-wrap: wrap; }
  .controls.open .evo-toggle { order: 5; flex: 1 1 100%; justify-content: center; }
  .count-row .dots-help { display: inline-flex; }
}

/* Events by the clock */
.tier-now { color: var(--bad); }
.tier-now .tier-how { color: var(--muted); }
.ev-live { background: var(--card); border: 1px solid var(--bad); border-radius: 12px; padding: 10px 12px; margin-bottom: 12px; }
.ev-soon { display: flex; flex-direction: column; gap: 6px; }
.ev-item { display: flex; gap: 10px; flex-wrap: wrap; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; font-size: 14px; }
.ev-item b { min-width: 170px; }
.ev-item { flex-direction: column; gap: 8px; }
.ev-head { display: flex; gap: 10px; flex-wrap: wrap; align-items: baseline; }
.ev-bosses { display: flex; flex-wrap: wrap; gap: 10px; }
.ev-boss { display: flex; flex-direction: column; align-items: center; gap: 3px; width: 96px; text-align: center; font-size: 12.5px; font-weight: 600; }
.ev-boss .tags { justify-content: center; }
.ev-boss { width: 130px; }
.ev-boss .tags { flex-wrap: nowrap; }

/* Events → Other events */
.ev-on { border-color: var(--bad); }
.ev-now { color: var(--bad); }
.ev-head .tag { align-self: center; }
.ev-bonus { display: flex; flex-wrap: wrap; gap: 6px; }

/* Evolve, from a Pokémon's pop-up */
.evo-row { display: flex; flex-wrap: wrap; gap: 8px; }
.evo-btn { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 104px; padding: 8px 10px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink); font: inherit; border-radius: 12px; cursor: pointer; }
.evo-btn:hover, .evo-btn:focus-visible { border-color: var(--accent); outline: none; }
.evo-btn img { width: 48px; height: 48px; object-fit: contain; }
.evo-btn b { font-size: 14px; }
.evo-btn span { font-size: 11.5px; color: var(--muted); }
.evo-cost.good { color: var(--ok); } .evo-cost.bad { color: var(--bad); }

/* Just evolved: what to update */
.evolved-note { background: var(--ok-bg); border: 1px solid var(--ok); border-radius: 12px; padding: 10px 12px;
  margin: 10px 0; font-size: 13.5px; line-height: 1.45; }
.evolved-do { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.fact-in.evo-need, .mv.pick.evo-need { box-shadow: 0 0 0 2px var(--ok); border-radius: 8px; }

/* Saved for a Battle League */
.tag-tog.league.on { border-color: var(--info); color: var(--info); }
.lg-tag { background: var(--info-bg); color: var(--info); }
.mega-chip.saved { background: var(--info-bg); color: var(--info); }
.stitch-wrap { display: flex; flex-direction: column; gap: 2px; margin-top: 10px; }
.stitch-wrap img { width: 100%; border-radius: 8px; }

/* a recording being read on the server */
.job-pill { position: relative; overflow: hidden; border: 1px solid var(--line); background: var(--chip); color: var(--ink);
  font: inherit; font-size: 12.5px; font-weight: 700; padding: 4px 10px; border-radius: 999px; cursor: pointer; white-space: nowrap;
  display: flex; align-items: center; justify-content: center; }
.job-pill i { font-style: normal; color: var(--muted); font-weight: 600; margin-left: 6px; }
/* on a computer it gets the empty space between the stats and Account, and room to say what it's doing */
@media (min-width: 861px) {
  .job-pill { flex: 0 1 300px; min-width: 200px; height: 40px; padding: 0 16px; font-size: 14px; border-radius: 12px; margin-left: 12px; }
}
@media (max-width: 860px) { .job-pill { margin-left: auto; } }
@media (max-width: 640px) { .job-pill { order: 2; margin: 0 0 0 auto; font-size: 12px; } }
.job-pill .job-bar { position: absolute; inset: 0 auto 0 0; background: var(--accent); opacity: .25; }
.job-pill span { position: relative; }
.job-pill.done { border-color: var(--ok); color: var(--ok); }
.job-pill.done i { font-style: normal; color: var(--muted); font-weight: 600; }
.job-pill.bad { border-color: var(--bad); color: var(--bad); }
.job-live { margin: 12px 0; }
.job-live .progress { height: 10px; }
.where-read { display: flex; gap: 8px; align-items: flex-start; background: var(--chip); border-radius: 12px; padding: 10px 12px;
  margin: 8px 0; font-size: 13px; line-height: 1.4; cursor: pointer; }
.where-read input { width: 18px; height: 18px; margin-top: 1px; accent-color: var(--accent); }

/* "Something else…" on the check screen: pick any Pokémon */
.fp.any { border-style: dashed; }
.fp-any-ico { font-size: 20px; }
.any-list { display: flex; flex-direction: column; gap: 4px; max-height: 50vh; overflow-y: auto; margin-top: 10px; }
.any-row { display: flex; align-items: center; gap: 10px; background: var(--chip); border: 1px solid transparent; color: var(--ink);
  font: inherit; border-radius: 10px; padding: 6px 10px; cursor: pointer; text-align: left; }
.any-row:hover, .any-row:focus-visible { border-color: var(--accent); outline: none; }
.any-row img { width: 40px; height: 40px; object-fit: contain; }
#anyQ { width: 100%; height: 42px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--ink);
  font: inherit; font-size: 16px; padding: 0 12px; }

/* Guide → Moves */
.mv-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.mv-bar input[type=search] { flex: 1 1 260px; min-width: 0; height: 40px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); font: inherit; padding: 0 12px; }
.mv-bar select { height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--ink);
  font: inherit; padding: 0 10px; cursor: pointer; }
.mv-card { gap: 6px; cursor: default; }
.mv-row { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; font-size: 13px; }
.mv-row b { min-width: 74px; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
.mv-row b i { font-style: normal; color: var(--ok); font-weight: 800; letter-spacing: 0; text-transform: none; }
.mv-chip { display: inline-block; background: var(--chip); border-radius: 999px; padding: 2px 9px; font-size: 12.5px;
  font-weight: 600; margin-right: 5px; }
.mv-chip.elite { background: rgba(240,165,0,.16); color: #f0a500; }
.mv-alt { font-size: 12px; color: var(--muted); }
.mv-yours { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.mv-mine { background: var(--chip); border-radius: 8px; padding: 2px 8px; cursor: pointer; }
.mv-mine.good { color: var(--ok); } .mv-mine.bad { color: var(--warn); }

/* Events → Rocket */
.rk-boss { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-bottom: 14px; }
.rk-boss h2 { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.rk-title { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.rk-slot { display: flex; gap: 10px; align-items: flex-start; margin: 6px 0; flex-wrap: wrap; }
.rk-slot > b { min-width: 74px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; padding-top: 6px; }
.rk-mon { width: 104px; }
.rk-catch { font-size: 11px; font-weight: 700; color: var(--ok); }
.rk-grunt { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; margin-bottom: 8px; }
.rk-grunt summary { cursor: pointer; font-weight: 700; display: flex; align-items: center; gap: 10px; list-style: none; }
.rk-grunt summary::-webkit-details-marker { display: none; }
.rk-grunt summary::after { content: "▾"; margin-left: auto; color: var(--muted); font-size: 12px; }
.rk-grunt[open] summary::after { content: "▴"; }
.rk-head { display: flex; align-items: center; gap: 12px; }
.rk-head h2 { margin: 0; }
.rk-face { width: 64px; height: 64px; object-fit: contain; flex: none; }
.rk-face.sm { width: 34px; height: 34px; }
.rk-quote { margin: 2px 0 0; font-style: italic; font-weight: 600; color: var(--ink); }
.rk-g-type { flex: none; min-width: 72px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.rk-find { width: 100%; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--card);
  color: var(--ink); font: inherit; padding: 0 12px; margin-bottom: 10px; }
@media (max-width: 560px) {
  .rk-face { width: 52px; height: 52px; }
  .rk-g-type { min-width: 0; }
  .rk-grunt summary { flex-wrap: wrap; row-gap: 2px; }
  .rk-grunt summary .rk-quote { flex: 1 1 100%; font-size: 13px; }
}

/* Max Moves: the three levels on a Dynamax Pokémon */
.maxmoves { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 6px 0 2px; }
.mm-one { display: inline-flex; align-items: center; gap: 4px; }
.mm-one b { font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.mm-lv { width: 24px; height: 24px; border-radius: 7px; border: 1px solid var(--line); background: var(--card);
  color: var(--muted); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; padding: 0; }
.mm-lv.on { background: var(--dmax, #e1197f); border-color: var(--dmax, #e1197f); color: #fff; }
.job-chip { font-style: normal; font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em;
  border-radius: 999px; padding: 1px 7px; margin-left: 6px; background: var(--chip); color: var(--muted); }
.job-chip.attack { background: rgba(225,25,127,.16); color: #e1197f; }
.job-chip.heal { background: rgba(46,182,125,.16); color: var(--ok); }
.job-chip.shield { background: rgba(90,140,255,.16); color: #5a8cff; }

/* The check screen, section by section */
.bulkgroup > summary { display: flex; align-items: center; gap: 9px; }
.bulkgroup .sec-n { flex: none; width: 21px; height: 21px; border-radius: 50%; background: var(--chip); color: var(--muted);
  font-size: 11.5px; font-weight: 800; display: grid; place-items: center; }
.bulkgroup > summary b { font-weight: 700; }
.bulkgroup > summary i { font-style: normal; color: var(--muted); font-size: 12.5px; }
.bulkgroup .sec-tick { margin-left: auto; color: var(--ok); font-weight: 800; opacity: 0; }
.bulkgroup.done .sec-tick { opacity: 1; }
.bulkgroup.done .sec-n { background: rgba(46,182,125,.18); color: var(--ok); }
.sec-says { font-size: 12.5px; color: var(--muted); margin: 2px 0 8px; }
.sec-end { display: flex; justify-content: flex-end; padding: 8px 0 2px; }

.dmax-mark { display: inline-flex; width: 16px; height: 16px; flex: none; }
.dmax-mark svg { width: 100%; height: 100%; }

/* Does the scan match what the game says you have? */
.tally { border-radius: 10px; padding: 8px 11px; margin-bottom: 10px; font-size: 13.5px; border: 1px solid var(--line); }
.tally.ok { background: rgba(46,182,125,.12); border-color: rgba(46,182,125,.35); }
.tally.near { background: rgba(240,165,0,.12); border-color: rgba(240,165,0,.35); }
.tally.bad { background: rgba(232,90,90,.12); border-color: rgba(232,90,90,.35); }

.bulkgroup.quiet > summary { opacity: .75; }
.bulkgroup.quiet .sec-n { background: rgba(46,182,125,.18); color: var(--ok); }

/* What CP you'll catch a boss at */
.catch-cp { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: baseline; font-size: 13px; }
.catch-cp span { display: inline-flex; align-items: baseline; gap: 6px; background: var(--chip); border-radius: 10px; padding: 4px 10px; }
.catch-cp span.boosted { background: rgba(90,140,255,.16); }
.catch-cp i { font-style: normal; font-size: 11.5px; color: var(--muted); }
.catch-cp em { font-style: normal; font-size: 11.5px; color: var(--muted); }

/* The boss beside its shiny */
.two-pics { display: flex; gap: 18px; align-items: flex-end; justify-content: center; }
.two-pics span { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.two-pics i { font-style: normal; font-size: 11.5px; color: var(--muted); }

/* A Pokémon beside its shiny, in a list */
.pair { position: relative; display: inline-flex; align-items: flex-end; gap: 2px; }
.pair .pic { width: 46px; height: 46px; }
.pair-star { position: absolute; right: -4px; top: -2px; font-style: normal; font-size: 11px; color: #f0a500; }

/* Rocket, laid out like the raids */
.rk-grid .rk-card { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.rk-card .rk-face { width: 64px; height: 64px; }
.rk-get { display: flex; flex-direction: column; align-items: center; gap: 0; }
.rk-get i { font-style: normal; font-size: 11px; color: var(--muted); }
.rk-hero .rk-face.big { width: 112px; height: 112px; }
.rk-hero .rk-quote { margin: 4px 0 0; }

/* Nobody's keeping IVs: don't show space where one would be */
body.no-ivs .iv { display: none; }
body.no-ivs label.fact:has([data-field="iv"]), body.no-ivs label.fact:has([data-field="ivs"]) { display: none; }
body.no-ivs .bulkrow .iv, body.no-ivs option[value="iv"] { display: none; }

/* The light/dark switch */
.theme-btn { border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 10px;
  width: 34px; height: 34px; font-size: 15px; line-height: 1; cursor: pointer; padding: 0; }
.theme-btn:hover { background: var(--chip); }

/* A Pokémon in a list that opens when you tap it */
.ev-boss.ev-tap { cursor: pointer; border-radius: 12px; padding: 4px; margin: -4px; }
.ev-boss.ev-tap:hover, .ev-boss.ev-tap:focus-visible { background: var(--chip); outline: none; }
.chipbig small { font-weight: 400; color: var(--muted); margin-left: 4px; }

/* What to raise on a Dynamax Pokémon, under its name */
.who2 .why, .who2 .plan { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; line-height: 1.35; }
.who2 .plan b { color: var(--ink); }
.who2 .plan i { font-style: normal; opacity: .7; }
.who2 .plan.done { opacity: .7; }

/* More than two pictures (normal, shiny, Mega, shiny Mega): an even grid rather than a row that breaks 3 + 1 */
.two-pics.many { display: grid; width: 100%; justify-items: center;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; align-items: end; }
.two-pics.many span { width: 100%; }
.two-pics.many .pic.big { width: 100%; max-width: 128px; height: auto; aspect-ratio: 1; }
@media (max-width: 640px) {
  .two-pics.many { grid-template-columns: repeat(2, 1fr); }
  .two-pics.many .pic.big { max-width: 110px; }
}

/* Guide → Search: strings to paste into the game */
.srch-tips { display: flex; flex-wrap: wrap; gap: 8px 14px; margin: 8px 0 12px; font-size: 12px; color: var(--muted); }
.srch-tips code { background: var(--chip); border-radius: 6px; padding: 1px 6px; color: var(--ink); }
.srch-h { margin: 16px 0 8px; font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.srch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.srch { position: relative; display: flex; flex-direction: column; gap: 4px; text-align: left; cursor: pointer;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; color: var(--ink); }
.srch:hover { border-color: var(--accent); }
.srch.copied { border-color: var(--ok); }
/* the Copy label sits in the top-right corner, so a search long enough to wrap keeps clear of it */
.srch code { font-size: 13px; font-weight: 700; color: var(--accent); word-break: break-all; line-height: 1.35;
  padding-right: 44px; }
.srch b { font-size: 13px; }
.srch span { font-size: 12px; color: var(--muted); line-height: 1.4; }
.srch-copy { position: absolute; top: 8px; right: 10px; font-style: normal; font-size: 11px; color: var(--muted); }
.srch.copied .srch-copy { color: var(--ok); }

/* Six tabs don't fit a phone: the strip scrolls sideways rather than the whole page */
@media (max-width: 760px) {
  .g-bar .seg { display: flex; max-width: 100%; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .g-bar .seg::-webkit-scrollbar { display: none; }
  .g-bar .seg button { white-space: nowrap; flex: none; padding: 7px 11px; }
}

/* Super Mega raids: the shield rule, which decides the raid before it starts */
.shields { display: flex; flex-direction: column; gap: 5px; margin: 12px 0 4px; padding: 10px 12px;
  border: 1px solid var(--warn); border-radius: 12px; background: var(--warn-bg); }
.shields b { font-size: 14px; }
.shields span { font-size: 12.5px; line-height: 1.45; color: var(--ink); }
.shields .ok-line { color: var(--ok); font-weight: 700; }
.shields .warn-line { color: var(--warn); font-weight: 700; }

/* Events → Posters */
.poster-add { justify-content: flex-start; margin-bottom: 12px; }
.poster-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.poster { margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
  cursor: pointer; display: flex; flex-direction: column; }
.poster:hover { border-color: var(--accent); }
.poster img { width: 100%; display: block; background: var(--chip); }
.poster figcaption { padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; }
.poster figcaption b { font-size: 13px; }
.poster figcaption span { font-size: 11.5px; color: var(--muted); }
.poster-big img { width: 100%; border-radius: 12px; display: block; }
.poster-head { display: flex; flex-direction: column; gap: 2px; margin: 10px 0 4px; }
.poster-head span { font-size: 12px; color: var(--muted); }

/* Posters arriving on their own, out of Discord */
.dsc { border: 1px solid var(--line); background: var(--card); border-radius: 14px; padding: 10px 14px; margin-bottom: 12px; }
.dsc.on { display: flex; flex-direction: column; gap: 4px; border-color: var(--ok); }
.dsc.on b { font-size: 14px; } .dsc.on span { font-size: 12.5px; color: var(--muted); }
.dsc summary { cursor: pointer; font-weight: 700; }
.dsc-steps { margin: 8px 0 12px; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.dsc-steps li > b { display: block; font-size: 13px; }   /* only the heading, not the bold words in the text */
.dsc-steps li span { font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.dsc-f { display: flex; align-items: center; gap: 10px; margin: 6px 0; }
.dsc-f span { font-size: 12.5px; color: var(--muted); min-width: 90px; }
.dsc-f input { flex: 1 1 auto; max-width: 420px; }
.dsc .warn-line { color: var(--warn); }

/* "Work out missing levels": the summary in the are-you-sure */
.lv-sum { margin: 6px 0 10px; padding-left: 20px; display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
.lv-sum i { color: var(--muted); font-style: normal; }

/* "takes ×0.63" on a healer or a shield: green when it resists, red when the boss hits it hard */
.mult.bad { color: var(--bad); }

/* an attacker the boss is strong against: its damage on paper isn't what it lands */
.mult .takes-bad { display: block; font-size: 10.5px; font-weight: 600; color: var(--bad); }

/* "teach it this move" sits with the other advice but reads as its own thing */
.who2 .plan.swap { color: var(--ink); }
.who2 .plan.swap i { display: block; color: var(--muted); font-size: 11px; }

/* how a Rocket counter does against the Pokémon that actually beats people */
.mult .takes-good { display: block; font-size: 10.5px; font-weight: 600; color: var(--ok); }

/* Guide → Search: the builder — same controls as the filters at the top of the Pokémon list */
.sb-box { margin-bottom: 14px; }
.sb-rows { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.sb-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sb-row select, .sb-row input[type="number"] { height: 38px; padding: 0 10px; font: inherit; border-radius: 10px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink); }
.sb-row select { cursor: pointer; }
.sb-row select.sb-join { flex: 0 0 76px; }
.sb-row .sb-join-first { flex: 0 0 76px; font-size: 13px; color: var(--muted); }
.sb-row select.sb-not { flex: 0 0 96px; }
.sb-row select.sb-key { flex: 0 1 280px; min-width: 170px; }
.sb-row input[type="number"] { width: 92px; }
.sb-dash { font-size: 13px; color: var(--muted); }
.sb-btn { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--chip);
  color: var(--muted); font-size: 18px; font-weight: 700; line-height: 1; cursor: pointer; padding: 0; }
.sb-add:hover { color: var(--accent); border-color: var(--accent); }
.sb-x:hover { color: var(--bad); border-color: var(--bad); }
.sb-first { justify-content: flex-start; }
.sb-out { margin: 10px 0; }
.sb-out .srch { width: 100%; }
.sb-keep { justify-content: flex-start; flex-wrap: wrap; gap: 8px; }
.sb-keep input[type="text"] { flex: 0 1 260px; height: 38px; padding: 0 10px; font: inherit; border-radius: 10px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink); }
.sb-saved { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.sb-open { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 1px; cursor: pointer;
  text-align: left; border: 1px solid var(--line); }
.sb-open:hover { border-color: var(--accent); }
.sb-open small { font-weight: 400; color: var(--muted); font-size: 11px; }

/* On a phone the criterion takes its own line and the rest sits underneath it */
@media (max-width: 640px) {
  .sb-row { padding: 8px; border: 1px solid var(--line); border-radius: 12px; gap: 8px; }
  .sb-row select.sb-key { flex: 1 1 100%; min-width: 0; }
  .sb-row select.sb-not, .sb-row select.sb-join { flex: 0 0 84px; }
  .sb-row .sb-join-first { display: none; }
  .sb-row input[type="number"] { flex: 1 1 64px; width: auto; min-width: 0; }
  .sb-row .sb-add { margin-left: auto; }
  .sb-keep input[type="text"] { flex: 1 1 100%; }
}

/* Events → Other events: a picture, what it is, when it runs, how long is left */
.ev-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.ev-day { margin: 16px 0 8px; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
/* A grid since 2.9.0, so an event's Pokémon (.ev-mons) can sit under the title on a wide screen and take the
   card's whole width on a phone, where beside the picture there was room for one tile a row. */
.ev-card { display: grid; grid-template-columns: auto minmax(0, 1fr) 76px; grid-template-areas: "pic body left" "pic mons left";
  column-gap: 12px; align-items: start; background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 10px; }
.ev-card > .ev-pic { grid-area: pic; }
.ev-card > .ev-body { grid-area: body; }
.ev-card > .ev-mons { grid-area: mons; min-width: 0; margin-top: 4px; }
.ev-card > .ev-left { grid-area: left; align-self: center; }
.ev-card.ev-on { border-color: var(--line); }
/* How close it is to ending, at a glance: red under a day, amber under two, green beyond that */
.ev-card.ends-red { border-color: var(--bad); }
.ev-card.ends-amber { border-color: var(--warn); }
.ev-card.ends-green { border-color: var(--ok); }
.ev-pic { width: 112px; height: 72px; object-fit: cover; border-radius: 10px; background: var(--chip); flex: 0 0 auto; }
.ev-pic.none { background: var(--chip); }
.ev-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ev-top { display: flex; align-items: center; gap: 8px; }
.ev-live-dot { font-size: 11px; font-weight: 800; color: var(--bad); letter-spacing: .03em; }
.ev-name { margin: 0; font-size: 15px; line-height: 1.3; }
.ev-name a { color: var(--ink); text-decoration: none; }
.ev-name a:hover { color: var(--accent); text-decoration: underline; }
.ev-when { font-size: 12.5px; color: var(--muted); }
.ev-left { display: flex; flex-direction: column; align-items: flex-end; justify-content: center; }
.ev-left .ev-count { font-size: 15px; font-variant-numeric: tabular-nums; }
.ev-left span { font-size: 11px; color: var(--muted); }
.ends-red .ev-left .ev-count, .ends-red .ev-live-dot { color: var(--bad); }
.ends-amber .ev-left .ev-count, .ends-amber .ev-live-dot { color: var(--warn); }
.ends-green .ev-left .ev-count, .ends-green .ev-live-dot { color: var(--ok); }
@media (max-width: 640px) {
  .ev-card { grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "pic body" "mons mons" "left left"; gap: 8px 10px; }
  .ev-card > .ev-mons { margin-top: 0; }
  .ev-pic { width: 84px; height: 56px; }
  .ev-left { align-items: flex-start; flex-direction: row; gap: 5px; width: 100%; }
  .ev-left span { align-self: center; }
}

/* Five tabs don't fit a phone at full width, and a tab you have to scroll to find isn't a tab. The bar still
   scrolls if it ever has to, but at this width it says "League" and sits tighter instead. */
nav.tabs .narrow-only { display: none; }
@media (max-width: 430px) {
  header.ribbon nav.tabs .wide-only { display: none; }
  header.ribbon nav.tabs .narrow-only { display: inline; }
  header.ribbon nav.tabs button { padding: 6px 7px; }
  header.ribbon nav.tabs { gap: 2px; }
}

/* Reference → Pokédex: look one up, get the whole line */
.dex-hits { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.dex-hit { display: flex; align-items: center; gap: 7px; background: var(--card); border: 1px solid var(--line);
  border-radius: 999px; padding: 4px 12px 4px 5px; cursor: pointer; font: inherit; color: inherit; }
.dex-hit:hover { border-color: var(--accent); }
.dex-hit .pic.small { width: 30px; height: 30px; margin: 0; }
.dex-hit b { font-size: 13.5px; }
.dex-line { display: flex; flex-direction: column; gap: 10px; }
/* the branch: a rail down the left of each set of children, with a tick out to each one */
.dex-node { position: relative; }
.dex-kids { margin: 10px 0 0 28px; padding-left: 22px; display: flex; flex-direction: column; gap: 10px; }
.dex-kids > .dex-node::before { content: ""; position: absolute; left: -22px; top: 0; bottom: 0;
  width: 1px; background: var(--line); }
.dex-kids > .dex-node:last-child::before { bottom: auto; height: 52px; }
.dex-kids > .dex-node::after { content: ""; position: absolute; left: -22px; top: 52px; width: 22px;
  height: 1px; background: var(--line); }
/* what the game asks for this stage, sitting with that stage rather than floating on the line */
.dex-needs { font-size: 13px; color: var(--warn); }
.dex-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.dex-card.on { border-color: var(--accent); }
.dex-main { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.dex-pics { flex: 0 0 auto; cursor: pointer; gap: 10px; align-items: flex-end; }
.dex-pics .pic.big { width: 92px; height: 92px; }
.dex-of { flex: 1 1 240px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.dex-of h4 { margin: 0; font-size: 16px; }
.dex-have { font-style: normal; font-size: 11.5px; font-weight: 700; color: var(--ok); background: var(--ok-bg);
  border-radius: 999px; padding: 1px 8px; }
.dex-cp { font-size: 12.5px; color: var(--muted); }
.dex-cp b { color: var(--ink); font-variant-numeric: tabular-nums; }
.dex-cp i { font-style: normal; }
@media (max-width: 520px) {
  .dex-pics .pic.big { width: 74px; height: 74px; }
  .dex-card { padding: 10px; }
}

/* Pokédex → Special evolutions: one row per evolution that needs a task */
.spec-bar select { flex: 1 1 170px; min-width: 0; }
.spec-list { display: flex; flex-direction: column; gap: 8px; }
.spec-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; }
.spec-pics { display: flex; align-items: center; gap: 2px; flex: none; }
.spec-pics .ev-tap { display: inline-flex; cursor: pointer; border-radius: 10px; }
.spec-pics .ev-tap:hover { background: var(--chip); }
.spec-pics .pic.small { width: 54px; height: 54px; }
.spec-arrow { font-style: normal; color: var(--muted); font-size: 15px; }
.spec-of { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.spec-of h4 { margin: 0; font-size: 15px; }
.spec-nick { font-size: 13px; color: var(--muted); }
.spec-nick b { color: var(--ink); }
/* Pokédex → Adventure Effect Pokémon: the same row as a special evolution, one picture, no button */
.adv-row { grid-template-columns: auto minmax(0, 1fr); align-items: start; }
.adv-for { font-size: 11px; font-weight: 700; color: var(--muted); background: var(--chip); border-radius: 999px;
  padding: 1px 8px; white-space: nowrap; vertical-align: middle; }
.adv-move { font-size: 14px; color: var(--muted); }
.adv-move b { color: var(--ink); }
.adv-does { font-size: 14px; line-height: 1.4; }
.adv-cost { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
/* a phone: the button tucks in under the words instead of taking a row of its own */
@media (max-width: 520px) {
  .spec-row { grid-template-columns: auto minmax(0, 1fr); gap: 6px 10px; padding: 8px 10px; }
  .spec-pics { grid-row: span 2; }
  .spec-pics .pic.small { width: 44px; height: 44px; }
  .spec-line { grid-column: 2; justify-self: start; }
}

/* the raid strength grade, so the number has a scale next to it */
.rg { display: inline-block; font-style: normal; font-weight: 800; font-size: 11px; line-height: 1.5;
  min-width: 17px; text-align: center; border-radius: 5px; padding: 0 4px; margin-left: 5px;
  background: var(--chip); color: var(--muted); letter-spacing: 0; }
.rg-a, .rg-b { background: var(--ok-bg); color: var(--ok); }
.rg-c { background: var(--info-bg); color: var(--info); }
.rg-e, .rg-f { opacity: .75; }

/* the other shapes a Pokémon takes: its Megas, and what it looks like Dynamaxed */
.dex-forms { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.dex-form { display: flex; align-items: center; gap: 8px; background: var(--chip); border-radius: 12px;
  padding: 5px 10px 5px 6px; }
.dex-form-pics { display: flex; }
.dex-form .pic.small { width: 38px; height: 38px; margin: 0; }
.dex-form b { display: block; font-size: 12.5px; }
.dex-form .tags { display: inline-flex; gap: 3px; }
.dex-form-of { display: block; font-size: 11.5px; color: var(--muted); }
.dex-form-of i { font-style: normal; font-weight: 700; color: var(--ink); }

/* the grade in a boss tile's corner, opposite the clock */
.tile-grade { position: absolute; top: 6px; left: 7px; font-style: normal; }
.tile-grade .rg { margin: 0; font-size: 11.5px; }
/* what it's worth in a fight, in a pop-up */
.worth { display: flex; flex-direction: column; gap: 2px; background: var(--chip); border-radius: 12px; padding: 8px 12px; }
.worth b { font-size: 15px; }
.worth span { font-size: 12px; color: var(--muted); }

/* ─── Side menu: the pages inside a tab (2.8.0) ───────────────────────────────
   The Bee apps' Settings menu, in this app's colours: a list down the left that folds away with the button in the
   bar above it (Brett, 2026-11-02: the second row of buttons under Events and the Pokédex was running out of room).
   On a phone, or any box under 760px wide, it slides in over the page instead, the page dimmed behind it. */
.snav-bar { display: flex; align-items: center; gap: 10px; min-width: 0; margin: 0 0 12px; }
.snav-btn { flex: none; width: 38px; height: 34px; display: inline-flex; align-items: center; justify-content: center;
  padding: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); cursor: pointer; }
.snav-btn:hover { border-color: var(--accent); }
.snav-btn svg { display: block; transform: scaleX(-1); }          /* the filled pane is on the menu's side */
.snav-btn .pane { opacity: .55; transition: opacity 160ms ease; }
.snav-btn[aria-expanded="false"] .pane { opacity: 0; }
.snav-title { min-width: 0; font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.snav-sep { color: var(--muted); font-weight: 500; margin: 0 6px; }
/* a tab with only one page has no menu, and no bar */
.snav-single > .snav-bar { display: none; }
.snav-single > .snav-wrap > .snav, .snav-single > .snav-wrap > .snav-dim { display: none; }

.snav-wrap { position: relative; display: flex; align-items: flex-start; gap: 16px; }
.snav-wrap > .snav-main { flex: 1 1 auto; min-width: 0; }
/* only while the menu is on its way past the left edge, so no card's shadow is ever cut */
.snav-wrap.snav-clip { overflow-x: clip; }
.snav { flex: 0 0 220px; width: 220px; position: sticky; top: calc(var(--hdr, 72px) + 8px); box-sizing: border-box;
  max-height: calc(100dvh - var(--hdr, 72px) - 24px); overflow-y: auto;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px;
  transition: margin-left 260ms cubic-bezier(.32,.72,0,1), visibility 0s linear 0s; }
.snav-wrap.is-closed > .snav { margin-left: -236px; visibility: hidden;
  transition: margin-left 260ms cubic-bezier(.32,.72,0,1), visibility 0s linear 260ms; }
.snav-group + .snav-group { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 10px; }
.snav-grp { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--muted);
  margin: 0 8px 5px; }
.snav button { display: flex; align-items: center; gap: 8px; width: 100%; margin: 1px 0; padding: 8px 10px;
  border: 0; border-radius: 7px; background: none; color: var(--ink); font: inherit; font-size: 14.5px; text-align: left; cursor: pointer; }
.snav button:hover:not(.on) { background: var(--chip); }
.snav button.on { background: var(--chip); color: var(--accent); font-weight: 700; box-shadow: inset 3px 0 0 var(--accent); }
.snav button i { margin-left: auto; font-style: normal; font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.snav button i.snav-live { color: var(--ok); }

/* narrow: over the page from the left, under the ribbon; a tap on the dimmed page, Escape or the button closes it */
.snav-dim { display: none; }
.snav-wrap.is-narrow > .snav { position: fixed; z-index: 45; top: var(--snav-top, 0px); bottom: 0; left: 0;
  width: min(280px, calc(100vw - 56px)); max-height: none; margin: 0; border-radius: 0 12px 12px 0; border-left: 0;
  padding-bottom: max(10px, env(safe-area-inset-bottom)); box-shadow: 0 0 30px rgba(0,0,0,.3); transform: none; visibility: visible;
  transition: transform 260ms cubic-bezier(.32,.72,0,1), visibility 0s linear 0s; }
.snav-wrap.is-narrow.is-closed > .snav { transform: translateX(calc(-100% - 8px)); visibility: hidden; box-shadow: none;
  transition: transform 260ms cubic-bezier(.32,.72,0,1), visibility 0s linear 260ms; }
.snav-wrap.is-narrow > .snav-dim { display: block; position: fixed; z-index: 44; top: var(--snav-top, 0px); left: 0; right: 0;
  bottom: 0; background: rgba(0,0,0,.38); opacity: 0; pointer-events: none; transition: opacity 260ms ease; }
.snav-wrap.is-narrow:not(.is-closed) > .snav-dim { opacity: 1; pointer-events: auto; }
.snav-wrap.is-narrow .snav button { min-height: 44px; font-size: 15px; }
.snav-instant > * { transition: none !important; }
@media (max-width: 640px) { .snav-btn { width: 44px; height: 40px; } }
@media (prefers-reduced-motion: reduce) {
  .snav, .snav-dim, .snav-btn .pane { transition-duration: 1ms !important; }
}

/* Events: an event's Pokémon from its LeekDuck page, by where you meet them (2.9.0) */
.ev-group + .ev-group { margin-top: 6px; }
.ev-mons > .ev-group:first-child .ev-group-lbl { margin-top: 0; }
.ev-group-lbl { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted);
  margin: 6px 0 2px; }
.ev-more { margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.ev-more a { color: var(--accent); }

/* A tapped Pokémon's evolution line, opened from the button under its picture (2.9.1). The Pokédex's rail,
   smaller: each stage normal and shiny, what it takes, the one you tapped outlined. */
.line-btn { white-space: nowrap; margin-top: 4px; font-size: 13.5px; padding: 6px 16px; border-radius: 999px; }
.line-btn i { font-style: normal; font-weight: 700; color: var(--muted); margin-left: 2px; }
.line-btn[aria-expanded="true"] { border-color: var(--accent); color: var(--accent); }
#monEvoLine { width: 100%; margin-top: 4px; }
.evo-line { gap: 8px; text-align: left; }
.evo-card { display: flex; gap: 12px; align-items: center; background: var(--bg); border: 1px solid var(--line);
  border-radius: 12px; padding: 8px 10px; }
.evo-card.on { border-color: var(--accent); }
.evo-pics { display: flex; gap: 6px; flex: 0 0 auto; cursor: pointer; }
.evo-pics > span { display: flex; flex-direction: column; align-items: center; gap: 1px; }
.evo-pics i { font-style: normal; font-size: 10.5px; color: var(--muted); }
.evo-of { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.evo-of b { font-size: 15px; }
.evo-of .tags { justify-content: flex-start; }
.evo-line .dex-kids { margin: 8px 0 0 20px; padding-left: 16px; gap: 8px; }
.evo-line .dex-kids > .dex-node::before { left: -16px; }
.evo-line .dex-kids > .dex-node:last-child::before { height: 46px; }
.evo-line .dex-kids > .dex-node::after { left: -16px; top: 46px; width: 16px; }
@media (max-width: 420px) {
  .evo-pics .pic.small { width: 52px; height: 52px; }
  .evo-line .dex-kids { margin-left: 10px; }
}
