/* Stonybot Control Deck — "dusk basalt": warm-dark stone console, single ember signal accent. */
:root {
  --ink: #17141f;        /* page */
  --ink-2: #1f1a29;      /* recessed / inputs */
  --slab: #261f33;       /* card surface */
  --slab-hi: #2f2740;    /* raised controls */
  --edge: #3a3148;       /* hairline borders */
  --text: #f4efe6;       /* warm off-white */
  --muted: #a99fb8;      /* lavender grey */
  --ember: #ff8a3d;      /* the one bold accent */
  --ember-soft: rgba(255, 138, 61, .14);
  --danger: #ff6470;
  --radius: 14px;
  --display: "Bricolage Grotesque", system-ui, sans-serif;
  --body: "Hanken Grotesk", system-ui, sans-serif;
  --mono: "Space Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--ink);
}
body::before { /* ambient ember glow, top-right */
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(900px 520px at 82% -12%, rgba(255, 138, 61, .10), transparent 60%);
  z-index: 0;
}
header, main { position: relative; z-index: 1; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
a { color: var(--ember); }

/* --- top bar --- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  padding: 13px 24px;
  border-bottom: 1px solid var(--edge);
  background: rgba(23, 20, 31, .72);
  backdrop-filter: blur(10px);
}
.brand { display: flex; align-items: center; gap: 12px; }
.wordmark { font-family: var(--display); font-weight: 800; font-size: 1.25rem; letter-spacing: -.02em; }

/* equalizer signature — encodes "this is a voice bot" */
.eq { display: inline-flex; align-items: flex-end; gap: 3px; height: 22px; }
.eq i { width: 3px; height: 30%; border-radius: 2px; background: var(--ember); animation: eq 1.05s ease-in-out infinite; }
.eq i:nth-child(1) { animation-delay: -.9s; }
.eq i:nth-child(2) { animation-delay: -.5s; }
.eq i:nth-child(3) { animation-delay: -.2s; }
.eq i:nth-child(4) { animation-delay: -.7s; }
.eq i:nth-child(5) { animation-delay: -.35s; }
@keyframes eq { 0%, 100% { height: 22%; } 50% { height: 100%; } }

.userbar { display: flex; align-items: center; gap: 14px; }
.switcher { display: flex; align-items: center; gap: 8px; }
.switcher-label { font-family: var(--mono); font-size: .64rem; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); }
.switcher select { width: auto; min-width: 170px; padding-top: 7px; padding-bottom: 7px; }

/* --- layout --- */
main { max-width: 980px; margin: 0 auto; padding: 28px 24px 80px; }
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.span2 { grid-column: 1 / -1; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 720px) {
  .grid, .cols { grid-template-columns: 1fr; }
}

/* --- type bits --- */
.eyebrow { font-family: var(--mono); text-transform: uppercase; letter-spacing: .2em; font-size: .7rem; color: var(--ember); }
.managing { margin: 6px 0 26px; }
.managing-row { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.managing-name { font-family: var(--display); font-weight: 800; font-size: clamp(1.9rem, 5vw, 3rem); line-height: 1; letter-spacing: -.025em; margin: 8px 0 0; }
.badge { font-family: var(--mono); font-size: .62rem; text-transform: uppercase; letter-spacing: .1em; padding: 4px 10px; border-radius: 99px; border: 1px solid var(--edge); color: var(--muted); }
.badge.admin { color: var(--ember); border-color: var(--ember); background: var(--ember-soft); }

/* --- cards --- */
.card {
  position: relative;
  background: var(--slab);
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  padding: 22px 22px 24px;
}
.card::before { /* embossed top edge — carved-slab feel */
  content: "";
  position: absolute;
  top: 0; left: 16px; right: 16px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .09), transparent);
}
.sec {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -.01em;
}
.sec .spine { width: 4px; height: 17px; border-radius: 2px; background: var(--ember); }
.sec em { /* annotation chip, right-aligned */
  margin-left: auto;
  font-style: normal;
  font-family: var(--mono);
  font-size: .6rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--muted);
  border: 1px solid var(--edge);
  padding: 2px 7px;
  border-radius: 6px;
}

/* --- fields --- */
.field { display: flex; flex-direction: column; gap: 6px; margin: 14px 0; }
.subfield { margin: 6px 0; }
.flabel { font-size: .82rem; font-weight: 600; }
.flabel em { font-style: normal; font-family: var(--mono); font-size: .64rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-left: 6px; }
.row { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.row .btn { white-space: nowrap; }

select, input, textarea {
  width: 100%;
  font-family: var(--body);
  font-size: .92rem;
  color: var(--text);
  background: var(--ink-2);
  border: 1px solid var(--edge);
  border-radius: 10px;
  padding: 10px 12px;
  transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; min-height: 70px; line-height: 1.45; }
.mono, input.mono { font-family: var(--mono); font-size: .85rem; }
select:focus, input:focus, textarea:focus { outline: none; border-color: var(--ember); box-shadow: 0 0 0 3px var(--ember-soft); }
select {
  appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path d='M2 4.5l4 4 4-4' stroke='%23ff8a3d' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

/* --- toggle (from checkbox) --- */
.toggle { display: flex; align-items: center; gap: 12px; cursor: pointer; user-select: none; margin: 4px 0 6px; }
.toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle .track { position: relative; width: 46px; height: 26px; flex: none; border-radius: 99px; background: var(--ink-2); border: 1px solid var(--edge); transition: .18s; }
.toggle .thumb { position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--muted); transition: .18s; }
.toggle input:checked + .track { background: var(--ember-soft); border-color: var(--ember); }
.toggle input:checked + .track .thumb { left: 22px; background: var(--ember); }
.toggle input:focus-visible + .track { outline: 2px solid var(--ember); outline-offset: 2px; }
.toggle-text { font-size: .9rem; font-weight: 500; }

/* --- buttons --- */
.btn {
  font-family: var(--body);
  font-weight: 600;
  font-size: .88rem;
  padding: 9px 16px;
  border-radius: 10px;
  border: 1px solid var(--edge);
  background: var(--slab-hi);
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: border-color .15s, filter .15s, transform .05s;
}
.btn:hover { border-color: var(--ember); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--ember); outline-offset: 2px; }
.btn.ghost { background: transparent; }
.btn.primary { background: var(--ember); color: #20140a; border-color: var(--ember); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.big { padding: 14px 26px; font-size: 1rem; border-radius: 12px; }

/* --- tag lists --- */
.taglist { list-style: none; margin: 10px 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.taglist:empty::after { content: "Nothing yet"; color: var(--muted); font-size: .85rem; font-style: italic; }
.taglist li { display: flex; align-items: center; gap: 8px; background: var(--ink-2); border: 1px solid var(--edge); border-radius: 99px; padding: 5px 6px 5px 13px; font-size: .85rem; }
.taglist li button { width: 20px; height: 20px; flex: none; border: none; border-radius: 50%; background: var(--slab-hi); color: var(--danger); cursor: pointer; line-height: 1; font-size: .8rem; }
.taglist li button:hover { background: var(--danger); color: #fff; }
.taglist li button.sfxplay { color: var(--ember); font-size: .7rem; }
.taglist li button.sfxplay:hover { background: var(--ember-soft); color: var(--ember); }
.taglist li button.sfxplay:disabled { color: var(--muted); cursor: default; background: var(--slab-hi); }

/* --- detected-private-channel suggestions --- */
.suglist { list-style: none; margin: 8px 0 12px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.suglist li { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--ink-2); border: 1px solid var(--edge); border-radius: 10px; padding: 8px 8px 8px 14px; font-size: .88rem; }
.sugactions { display: flex; gap: 8px; flex: none; }
.suglist .btn { padding: 6px 14px; font-size: .8rem; }

/* --- table (private channels) --- */
table { width: 100%; border-collapse: collapse; margin-top: 10px; }
td { padding: 10px 8px; border-bottom: 1px solid var(--edge); vertical-align: middle; font-size: .9rem; }
tr:last-child td { border-bottom: none; }
td input { width: 160px; }

/* --- login hero --- */
.hero-login { max-width: 600px; margin: 10vh auto 0; }
.hero-login h1 { font-family: var(--display); font-weight: 800; font-size: clamp(2rem, 6vw, 3.3rem); line-height: 1.03; letter-spacing: -.03em; margin: 14px 0 16px; }
.lede { color: var(--muted); font-size: 1.05rem; max-width: 44ch; margin: 0 0 28px; }
.notice { max-width: 560px; margin: 12vh auto 0; }

/* --- toast --- */
#toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  background: var(--slab-hi);
  border: 1px solid var(--ember);
  color: var(--text);
  padding: 11px 20px;
  border-radius: 12px;
  font-size: .9rem;
  max-width: min(92vw, 460px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .5);
}
#toast::before { content: "●"; color: var(--ember); margin-right: 9px; font-size: .7rem; vertical-align: middle; }

/* --- entrance + motion safety --- */
#panel, .hero-login { animation: rise .4s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .eq i:nth-child(1) { height: 40%; } .eq i:nth-child(2) { height: 75%; } .eq i:nth-child(3) { height: 55%; }
  .eq i:nth-child(4) { height: 90%; } .eq i:nth-child(5) { height: 50%; }
}
