:root {
  --bg: #f4f5f8; --fg: #151a23; --muted: #646d7b; --line: #e1e4ea;
  --panel: #ffffff; --soft: #f0f3fa;
  --accent: #3a5bd9; --accent2: #7b4ff0; --btn1: #3a5bd9; --btn2: #7b4ff0;
  --gold: #b97f0a; --hit: #0f8a5f; --danger: #c0352b;
  --ring: rgba(58, 91, 217, .25); --glow: rgba(58, 91, 217, .10);
  --shadow: 0 1px 2px rgba(20, 26, 35, .06), 0 4px 16px rgba(20, 26, 35, .06);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1017; --fg: #e8ebf1; --muted: #98a1b0; --line: #252b37;
    --panel: #151a23; --soft: #1c2231;
    --accent: #8aa6ff; --accent2: #b893ff; --btn1: #4565e6; --btn2: #7d55f0;
    --gold: #f2c14e; --hit: #4cd494; --danger: #ff8b80;
    --ring: rgba(138, 166, 255, .30); --glow: rgba(124, 156, 255, .09);
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 20px rgba(0, 0, 0, .35);
  }
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; color: var(--fg);
  background: var(--bg) radial-gradient(1200px 420px at 50% -140px, var(--glow), transparent) no-repeat;
  font: 16px/1.55 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); text-underline-offset: 3px; }

/* Header band, dark in both modes */
header { position: sticky; top: 0; z-index: 10; display: flex; justify-content: space-between;
  align-items: center; gap: 12px; padding: 10px 20px; color: #fff;
  background: linear-gradient(90deg, #0f1a33, #1d2b55 60%, #2b2463);
  box-shadow: 0 2px 12px rgba(10, 15, 30, .25); }
header nav { display: flex; gap: 16px; align-items: center; }
header a, header button.link { color: #dfe6ff; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none;
  font-weight: 800; font-size: 21px; letter-spacing: -.02em; }
.brand img { width: 30px; height: 30px; }
.me { display: inline-flex; align-items: center; gap: 8px; color: #c9d2ee; font-size: 14px; }

main { max-width: 1040px; margin: 0 auto; padding: 24px 16px 56px; }
h1 { font-size: 30px; font-weight: 800; letter-spacing: -.02em; margin: 6px 0 18px;
  background: linear-gradient(90deg, var(--fg) 40%, var(--accent2));
  -webkit-background-clip: text; background-clip: text; color: transparent; }
h2 { display: flex; align-items: center; gap: 10px; font-size: 19px; margin: 40px 0 12px; }
h2::before { content: ""; width: 4px; height: 20px; border-radius: 2px;
  background: linear-gradient(var(--btn1), var(--btn2)); }
h4 { margin: 16px 0 4px; }

/* Forms */
label { display: block; margin: 12px 0; color: var(--muted); font-size: 14px; font-weight: 500; }
input, select, textarea, button { font: inherit; color: var(--fg); }
input, select, textarea { display: block; width: 100%; margin-top: 5px; padding: 10px 12px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--ring); }
textarea { resize: vertical; }
input[type=file] { padding: 7px; }
input[type=file]::file-selector-button { margin-right: 10px; padding: 6px 12px; border: 0;
  border-radius: 8px; background: var(--soft); color: var(--fg); font: inherit; cursor: pointer; }
button { padding: 10px 18px; border: 0; border-radius: 10px; font-weight: 600; color: #fff;
  background: linear-gradient(135deg, var(--btn1), var(--btn2)); cursor: pointer;
  box-shadow: 0 2px 8px rgba(58, 91, 217, .25); transition: transform .1s, box-shadow .15s, filter .15s; }
button:hover { filter: brightness(1.08); box-shadow: 0 4px 14px rgba(58, 91, 217, .35); }
button:active { transform: translateY(1px); }
button:disabled { opacity: .5; cursor: default; box-shadow: none; filter: none; }
button.link { padding: 0; background: none; box-shadow: none; color: var(--accent);
  font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
button.link:hover { filter: none; box-shadow: none; }
button.danger { color: var(--danger); }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.row label { margin: 0; flex: 1 1 200px; }
.row input.grow { flex: 1 1 180px; min-width: 0; margin: 0; }
.row input { width: auto; margin: 0; }
.row label input, .row label select { width: 100%; margin-top: 5px; }
label.check { display: flex; gap: 6px; align-items: center; flex: 0 0 auto; }
label.check input { width: auto; margin: 0; }
form.inline { display: inline; margin-left: 10px; }

/* Panels */
.card, .panel, .box, details { background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: var(--shadow); }
.card { padding: 20px; }
.card input.title { font-size: 24px; font-weight: 700; letter-spacing: -.01em;
  border-color: transparent; background: transparent; padding-left: 6px; }
.card input.title:hover { border-color: var(--line); }
.add { padding: 8px; margin-bottom: 4px; }
.add input.grow { border-color: transparent; background: transparent; }
.box { max-width: 440px; margin: 48px auto; padding: 28px; }
.hero { text-align: center; margin-bottom: 6px; }
.hero img { width: 64px; height: 64px; }
.hero p { margin: 4px 0 0; color: var(--muted); font-size: 14px; letter-spacing: .02em; }
.box h1 { text-align: center; }
.box button { width: 100%; margin-top: 8px; }
.small { color: var(--muted); font-size: 14px; }
.flash { background: var(--soft); border-left: 4px solid var(--accent); border-radius: 8px;
  padding: 10px 14px; overflow-wrap: anywhere; }

/* Opportunity list */
.filters { display: flex; flex-wrap: wrap; gap: 6px; margin: 16px 0 18px; }
.filters a { padding: 5px 13px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--panel); color: var(--muted); font-size: 14px; text-decoration: none; }
.filters a:hover { color: var(--fg); border-color: var(--accent); }
.filters a.on { color: #fff; border-color: transparent;
  background: linear-gradient(135deg, var(--btn1), var(--btn2)); }
.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--soft); color: var(--muted); font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em; }
th:first-child, td:first-child { padding-left: 18px; }
th:last-child, td:last-child { padding-right: 18px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--soft); }
td a.open { color: var(--fg); font-weight: 600; text-decoration: none; }
td a.open:hover { color: var(--accent); }
.num { text-align: right; }
.hit { color: var(--hit); font-weight: 700; }
.hit::after { content: " ★"; color: var(--gold); }
.stage { display: inline-block; padding: 3px 10px; border-radius: 999px; white-space: nowrap;
  font-size: 12.5px; font-weight: 600; background: var(--soft); color: var(--muted); }
.s-researching { background: rgba(58, 91, 217, .13); color: var(--accent); }
.s-discussing { background: rgba(123, 79, 240, .14); color: var(--accent2); }
.s-go { background: rgba(15, 138, 95, .15); color: var(--hit); }
.s-parked { background: rgba(197, 139, 18, .15); color: var(--gold); }
.s-killed { background: rgba(192, 53, 43, .13); color: var(--danger); }
.empty { padding: 28px 18px; text-align: center; color: var(--muted); }

/* One opportunity */
details { margin: 12px 0; padding: 12px 16px; }
summary { cursor: pointer; font-weight: 600; }
details[open] summary { padding-bottom: 10px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.result { margin-top: 8px; overflow-wrap: anywhere; }
.docs { list-style: none; padding: 0; }
.docs li { margin: 8px 0; padding: 10px 14px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 10px; }
.comment { display: flex; gap: 12px; margin: 14px 0; }
.bubble { flex: 1; min-width: 0; padding: 10px 14px; overflow-wrap: anywhere;
  background: var(--panel); border: 1px solid var(--line); border-radius: 4px 14px 14px 14px;
  box-shadow: var(--shadow); }
.bubble p:last-child { margin-bottom: 0; }
.avatar { flex: 0 0 34px; width: 34px; height: 34px; border-radius: 50%; display: grid;
  place-items: center; color: #fff; font-weight: 700;
  background: linear-gradient(135deg, var(--btn1), var(--btn2)); }
.avatar.sm { flex-basis: 28px; width: 28px; height: 28px; font-size: 13px; }
.qr { display: block; width: fit-content; margin: 0 auto; padding: 4px; background: #fff;
  border-radius: 10px; line-height: 0; }
.qr svg { display: block; }
code { overflow-wrap: anywhere; }
@media (max-width: 600px) {
  .wide { display: none; }
  header { padding: 10px 16px; }
  h1 { font-size: 26px; }
  th, td { padding: 10px 8px; }
  th:first-child, td:first-child { padding-left: 14px; }
  th:last-child, td:last-child { padding-right: 14px; }
}
