/* Loud Bee Admin (design/admin-panel): the design guide's colors and type (design/tokens.json),
   laid out as the Penpot boards are: a dark ink sidebar, a white top bar, and white cards on cream.
   "blue" in the class names is the primary color, which for Loud Bee is its green. */
@font-face {
  font-family: "Nunito Sans";
  src: url("/assets/fonts/nunito-sans-latin.woff2") format("woff2");
  font-weight: 200 1000;
  font-display: swap;
}
:root {
  --ink: #223d36;
  --ink-soft: #335249;
  --blue: #285c4d;
  --blue-tint: #ddebe2;
  --paper: #faf8f0;
  --gold: #f6ce67;
  --gold-tint: #fff0bf;
  --white: #fff;
  --mint: #e8f1e9;
  --lilac: #eee9f6;
  --purple: #71648a;
  --coral: #f5dfd4;
  --muted: #5b7066;
  --faint: #7f928a;
  --line: #d9e0d6;
  --hair: #e6eae3;
  --row: #fbfaf6;
  --green: #2b6a50;
  --green-tint: #e2f1e6;
  --amber: #7a5600;
  --amber-tint: #fff0bf;
  --red: #a33a2b;
  --red-tint: #f8e1dc;
  --gray-tint: #eef1ec;
  --side-text: #c9d6cf;
  --heading: "Nunito Sans", system-ui, sans-serif;
  --body: "Nunito Sans", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--paper); color: var(--ink); font: 14px/1.45 var(--body); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--blue); text-decoration: none; font-weight: 700; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--heading); margin: 0; }
.hidden { display: none !important; }
/* Every icon is 18 points unless where it sits says otherwise. */
svg[viewBox="0 0 24 24"] { width: 18px; height: 18px; flex: none; }

/* ---------- the shell */
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar { background: var(--ink); color: var(--side-text); padding: 14px 12px 12px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; gap: 10px; align-items: center; padding: 0 6px 18px; color: var(--white); }
.brand img { width: 38px; height: 38px; }
.brand strong { display: block; font: 900 19px/1.1 var(--heading); }
.brand small { color: var(--gold); font-weight: 800; font-size: 10px; letter-spacing: 1.5px; }
.nav-group { margin: 12px 12px 6px; font-size: 10px; font-weight: 800; letter-spacing: 1px; color: var(--faint); text-transform: uppercase; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--side-text); font-weight: 600; text-decoration: none; margin-bottom: 4px; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.nav a:hover { background: var(--ink-soft); }
.nav a.active { background: var(--blue); color: var(--white); font-weight: 800; }
.nav a svg { width: 18px; height: 18px; flex: none; }
.nav .count { margin-left: auto; background: var(--gold); color: var(--ink); border-radius: 10px; padding: 1px 8px; font-size: 12px; font-weight: 800; }
.nav a.active .count { background: var(--white); }
.me { margin-top: auto; border-top: 1px solid var(--ink-soft); padding: 14px 4px 2px; display: flex; gap: 10px; align-items: center; color: var(--white); }
.me .who { flex: 1; min-width: 0; }
.me .who b { display: block; font-size: 14px; }
.me .who small { color: var(--side-text); text-transform: capitalize; }
.me button { background: none; border: 0; color: var(--side-text); font-weight: 700; font-size: 12px; }

.topbar { height: 64px; background: var(--white); border-bottom: 1px solid var(--hair); display: flex; align-items: center; gap: 16px; padding: 0 32px; position: sticky; top: 0; z-index: 5; }
.topbar .search { flex: 0 1 440px; position: relative; }
.topbar .search input { width: 100%; height: 36px; border: 1px solid var(--line); border-radius: 10px; background: var(--row); padding: 0 12px 0 36px; }
.topbar .search svg { position: absolute; left: 10px; top: 9px; width: 18px; color: var(--muted); }
.env { margin-left: auto; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 10px; padding: 7px 12px; font-weight: 700; font-size: 13px; }
.env::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--green); }
.env.prod::before { background: var(--red); }
.main { min-width: 0; }
.content { padding: 24px 32px 48px; max-width: 1240px; }

/* ---------- headers */
.crumbs { font-size: 13px; color: var(--muted); font-weight: 600; margin-bottom: 4px; display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs a { color: var(--muted); font-weight: 600; }
.crumbs span:last-child { color: var(--ink); font-weight: 700; }
.page-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.page-head .titles { flex: 1; min-width: 0; }
.page-head h1 { font-size: 28px; font-weight: 900; line-height: 1.2; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.page-head p { margin: 6px 0 0; color: var(--muted); }
.actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }

/* ---------- controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid transparent; background: var(--blue); color: var(--white); font-weight: 700; white-space: nowrap; }
.btn svg { width: 18px; height: 18px; }
.btn.secondary { background: var(--white); color: var(--ink); border-color: var(--line); }
.btn.danger { background: var(--red); }
.btn.danger-outline { background: var(--white); color: var(--red); border-color: var(--red); }
.btn.ghost { background: none; color: var(--blue); padding: 0 8px; }
.btn.small { height: 32px; padding: 0 12px; font-size: 13px; }
.btn:disabled { background: var(--gray-tint); color: var(--faint); border-color: transparent; cursor: default; }
.btn.wide { width: 100%; }
label.field { display: block; margin-bottom: 14px; }
label.field > span, .label { display: block; font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
input[type="text"], input[type="email"], input[type="date"], input[type="number"], input[type="search"], select, textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; background: var(--white); padding: 9px 12px; min-height: 40px;
}
textarea { resize: vertical; line-height: 1.5; }
/* Every dropdown draws its own chevron, so its text gets the same room on the right as on the
   left, and the arrow sits clear of the edge, in every browser. */
select {
  appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235b7066' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue); }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; display: flex; justify-content: space-between; gap: 12px; }
.row { display: flex; gap: 16px; }
.row > * { flex: 1; min-width: 0; }
.checkline { display: flex; align-items: flex-start; gap: 10px; margin: 8px 0; font-weight: 600; }
.checkline input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--blue); }
.segment { display: flex; background: var(--gray-tint); border-radius: 10px; padding: 4px; gap: 4px; }
.segment button { flex: 1; border: 0; background: none; border-radius: 8px; padding: 6px 10px; color: var(--muted); font-weight: 600; }
.segment button.on { background: var(--white); color: var(--ink); font-weight: 800; box-shadow: 0 0 0 1px var(--line); }

/* ---------- tabs and filters */
.tabs { display: flex; gap: 28px; border-bottom: 1px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.tabs button { background: none; border: 0; padding: 9px 0 10px; color: var(--muted); font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -1px; display: flex; gap: 8px; align-items: center; }
.tabs button.on { color: var(--blue); font-weight: 800; border-color: var(--blue); }
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.filters input[type="search"] { width: 440px; min-height: 40px; padding-left: 14px; }
.filters select { width: auto; min-height: 40px; padding: 8px 38px 8px 14px; }

/* ---------- chips */
.chip { display: inline-flex; align-items: center; gap: 6px; border-radius: 12px; padding: 2px 10px; font-size: 12px; font-weight: 700; white-space: nowrap; line-height: 20px; }
.chip.dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip.green { background: var(--green-tint); color: var(--green); }
.chip.amber { background: var(--amber-tint); color: var(--amber); }
.chip.red { background: var(--red-tint); color: var(--red); }
.chip.blue { background: var(--blue-tint); color: var(--blue); }
.chip.gray { background: var(--gray-tint); color: var(--muted); }
.chip.gold { background: var(--gold-tint); color: var(--amber); }
.chip.lilac { background: var(--lilac); color: var(--purple); }
.chip.coral { background: var(--coral); color: #8a4b3a; }
.chip.mint { background: var(--mint); color: var(--green); }
.chip.ink { background: var(--ink); color: var(--white); }
.chip.count { padding: 0 8px; }

/* ---------- cards and grids */
.card { background: var(--white); border: 1px solid var(--hair); border-radius: 18px; padding: 18px 20px; margin-bottom: 16px; }
.card > h2, .section-title { font-size: 16px; font-weight: 800; display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.card > h2 .more, .section-title .more { margin-left: auto; font: 700 13px var(--body); }
.grid { display: grid; grid-template-columns: minmax(0, 1fr) 376px; gap: 16px; align-items: start; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 16px; }
.stat { background: var(--white); border: 1px solid var(--hair); border-radius: 18px; padding: 16px 20px; position: relative; }
.stat .k { font-size: 11px; font-weight: 800; color: var(--muted); letter-spacing: 0.4px; text-transform: uppercase; }
.stat .v { font: 900 30px/1.2 var(--heading); margin: 6px 0 8px; }
.stat .s { font-size: 13px; color: var(--muted); }
.stat .s.red { color: var(--red); font-weight: 700; }
.stat .s.amber { color: var(--amber); font-weight: 700; }
.stat .s.green { color: var(--green); font-weight: 700; }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 8px 12px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; word-break: break-word; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.empty { color: var(--muted); padding: 24px; text-align: center; }

/* ---------- tables */
.table { background: var(--white); border: 1px solid var(--hair); border-radius: 18px; overflow: hidden; margin-bottom: 16px; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: 0.4px; padding: 12px; border-bottom: 1px solid var(--hair); white-space: nowrap; }
td { padding: 10px 12px; border-bottom: 1px solid var(--hair); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr.link { cursor: pointer; }
tbody tr.link:hover { background: var(--row); }
tbody tr.selected { background: var(--blue-tint); }
td .t1 { font-weight: 700; display: block; }
td .t2 { font-size: 12px; color: var(--muted); display: block; }
td.clip .t1, td.clip .t2 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 420px; }
.pager { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; border-top: 1px solid var(--hair); color: var(--muted); font-size: 13px; }
.icons { display: inline-flex; gap: 8px; }
.icons svg { width: 18px; height: 18px; }
.ok { color: var(--green); }
.off { color: var(--line); }
.thumb { width: 40px; height: 40px; border-radius: 8px; background: var(--mint) center / cover; flex: none; display: inline-grid; place-items: center; color: var(--green); }
.thumb svg { width: 20px; }
.cell { display: flex; align-items: center; gap: 12px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--lilac); color: var(--ink); display: inline-grid; place-items: center; font: 800 12px var(--body); flex: none; }

/* ---------- lists inside cards */
.list > div { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--hair); }
.list > div:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .grow b { display: block; }
.list .grow small { color: var(--muted); display: block; }
.qrow { display: grid; grid-template-columns: 22px 26px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--hair); }
.qrow .n { color: var(--muted); font-weight: 700; text-align: right; }
.qrow .w b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qrow .w small { color: var(--muted); }
.qrow .moves { display: flex; gap: 2px; }
.qrow .moves button { border: 0; background: none; color: var(--muted); padding: 2px 4px; font-weight: 800; }
.checks div { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.checks .yes { color: var(--green); }
.checks .no { color: var(--amber); font-weight: 700; }
.timeline div { display: flex; gap: 10px; margin-bottom: 8px; }
.steps { display: flex; gap: 4px; }
.steps i { width: 10px; height: 5px; border-radius: 3px; background: var(--gray-tint); }
.steps i.done { background: var(--blue); }
.bar { height: 8px; background: var(--gray-tint); border-radius: 4px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--blue); border-radius: 4px; }
.chart { display: flex; align-items: flex-end; gap: 6px; height: 170px; border-bottom: 1px solid var(--line); padding-top: 10px; }
.chart i { flex: 1; background: var(--blue); border-radius: 3px 3px 0 0; min-height: 2px; position: relative; }
.chart i:last-child { background: var(--gold); }
.chart-axis { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 6px; }

/* ---------- notes, toasts and dialogs */
.note { border-radius: 10px; padding: 10px 14px; display: flex; gap: 10px; align-items: flex-start; font-weight: 600; font-size: 13px; margin-bottom: 16px; background: var(--blue-tint); }
.note svg { width: 18px; flex: none; margin-top: 1px; color: var(--blue); }
.note.red { background: var(--red-tint); color: var(--red); }
.note.red svg, .note.amber svg { color: inherit; }
.note.amber { background: var(--amber-tint); color: var(--amber); }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--white); padding: 12px 18px; border-radius: 12px; font-weight: 700; z-index: 50; box-shadow: 0 8px 24px rgba(34, 61, 54, 0.25); }
.toast.error { background: var(--red); }
.scrim { position: fixed; inset: 0; background: rgba(34, 61, 54, 0.5); display: grid; place-items: center; z-index: 40; padding: 24px; }
.dialog { background: var(--white); border-radius: 18px; width: min(600px, 100%); max-height: calc(100vh - 48px); display: flex; flex-direction: column; }
.dialog header { padding: 24px 28px 8px; display: flex; gap: 12px; }
.dialog header h2 { font-size: 22px; font-weight: 900; flex: 1; }
.dialog header p { margin: 6px 0 0; color: var(--muted); }
.dialog header button { border: 0; background: none; font-size: 22px; color: var(--muted); line-height: 1; height: 28px; }
.dialog .body { padding: 12px 28px 20px; overflow-y: auto; }
.dialog footer { border-top: 1px solid var(--hair); padding: 18px 28px; display: flex; align-items: center; gap: 12px; }
.dialog footer small { margin-right: auto; color: var(--muted); }
.option { display: flex; gap: 12px; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 12px; cursor: pointer; }
.option input { margin-top: 4px; accent-color: var(--blue); }
.option b { display: block; font-size: 15px; }
.option small { color: var(--muted); font-size: 13px; }
.option.on { border: 2px solid var(--blue); background: var(--blue-tint); }
.option.on.danger { border-color: var(--red); background: var(--red-tint); }
.option.on.danger input { accent-color: var(--red); }

/* ---------- sign-in */
.signin { display: grid; grid-template-columns: 640px 1fr; min-height: 100vh; }
.signin .brandside { background: var(--ink); color: var(--white); padding: 72px; display: flex; flex-direction: column; justify-content: center; }
.signin .brandside img { width: 140px; }
.signin .brandside h1 { font-size: 52px; font-weight: 900; margin: 20px 0 16px; }
.signin .brandside p { color: var(--side-text); font-size: 20px; max-width: 420px; }
.signin form { align-self: center; justify-self: center; width: 420px; }
.signin form h2 { font-size: 34px; font-weight: 900; }
.signin form > p { color: var(--muted); font-size: 15px; }
.signin #google { min-height: 44px; margin: 24px 0 16px; }

@media (max-width: 1100px) {
  .grid { grid-template-columns: 1fr; }
  .signin { grid-template-columns: 1fr; }
  .signin .brandside { display: none; }
}
@media (max-width: 600px) {
  .signin form { width: auto; justify-self: stretch; padding: 32px 20px 48px; }
  .signin form h2 { font-size: 28px; }
}

/* ---------- a page on its own (the Connect page a Claude app opens), phone first */
.standalone { min-height: 100vh; }
.standalone > header { background: var(--ink); color: var(--white); display: flex; align-items: center; gap: 10px; padding: 12px 20px; position: sticky; top: 0; z-index: 5; }
.standalone > header img { width: 30px; height: 30px; }
.standalone > header strong { font: 900 17px/1.1 var(--heading); flex: 1; }
.standalone > header .env { color: var(--white); border-color: rgba(255, 255, 255, 0.25); }
.standalone .content { max-width: 640px; margin: 0 auto; padding: 24px 20px 48px; }
.standalone .page-head h1 { font-size: 26px; }
.connect-actions { display: flex; gap: 12px; margin-top: 8px; }
@media (max-width: 600px) {
  .standalone .content { padding: 18px 14px 32px; }
  .standalone .card { padding: 16px; border-radius: 14px; }
  .standalone .kv { grid-template-columns: 1fr; gap: 2px; }
  .standalone .kv dd { margin-bottom: 10px; }
  .connect-actions { flex-direction: column-reverse; position: sticky; bottom: 0; background: var(--paper); padding: 12px 0 calc(12px + env(safe-area-inset-bottom)); }
  .connect-actions .btn { width: 100%; justify-content: center; min-height: 48px; font-size: 16px; }
}

/* ---------- Loud Bee's own pieces */
.recs { display: inline-flex; gap: 6px; }
.recs b { width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 11px; font-weight: 800; background: var(--gray-tint); color: var(--faint); }
.recs b.on { background: var(--green-tint); color: var(--green); }
.play { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--gold); color: var(--ink); display: inline-grid; place-items: center; flex: none; }
.play svg { width: 16px; height: 16px; }
.wordrow { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--hair); }
.wordrow:last-child { border-bottom: 0; }
.wordrow .n { color: var(--muted); font-weight: 700; text-align: right; }
.wordrow b { font-size: 15px; font-weight: 800; margin-right: 8px; }
.wordrow small { display: block; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wordrow .moves { display: flex; gap: 2px; }
.wordrow .moves button { border: 0; background: none; color: var(--muted); padding: 2px 5px; font-weight: 800; }
.ipa { font-family: "Source Sans Pro", "Segoe UI", "Lucida Sans Unicode", system-ui, sans-serif; }
.suggest { position: relative; }
.suggest .menu { position: absolute; z-index: 10; left: 0; right: 0; top: 100%; background: var(--white); border: 1px solid var(--line); border-radius: 12px; margin-top: 4px; max-height: 280px; overflow-y: auto; box-shadow: 0 8px 24px rgba(34, 61, 54, 0.15); }
.suggest .menu button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 9px 12px; }
.suggest .menu button:hover, .suggest .menu button:focus { background: var(--mint); }
.suggest .menu small { color: var(--muted); }
.matrix td, .matrix th { text-align: center; }
.matrix td:first-child, .matrix th:first-child { text-align: left; }

/* ---------- the server log: an error shown whole, its traceback wrapped and never cut */
.log-filters { gap: 12px 14px; }
.log-filters .segment button { flex: none; white-space: nowrap; padding: 6px 14px; }
.log-counts { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.log-chips { display: inline-flex; gap: 6px; margin-left: 10px; vertical-align: middle; }
.log-entry .page-head h1 { overflow-wrap: anywhere; font-size: 22px; }
.err-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.err-message { white-space: pre-wrap; overflow-wrap: anywhere; font-weight: 600; margin-top: 4px; }
.err-label { font-size: 11px; font-weight: 800; color: var(--muted); letter-spacing: 0.4px; text-transform: uppercase; margin-bottom: 4px; }
.err .err { margin-top: 16px; padding-left: 14px; border-left: 3px solid var(--line); }
pre.stack { white-space: pre-wrap; overflow-wrap: anywhere; overflow-x: auto; margin: 8px 0 0; padding: 12px 14px; background: var(--row); border: 1px solid var(--hair); border-radius: 10px; font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }
