:root {
  --bg: #08090b;
  --panel: #0e1116;
  --panel-2: #12161c;
  --field: #0a0d11;
  --line: #1d232b;
  --line-soft: #161b22;
  --ink: #e8ebee;
  --muted: #8b95a3;
  --faint: #5a6472;
  --accent: #7ee2a8;
  --accent-ink: #05130c;
  --accent-soft: rgba(126, 226, 168, 0.1);
  --danger: #ff7b72;
  --warn: #f2b544;
  --radius: 14px;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(900px 500px at 15% -10%, rgba(126, 226, 168, 0.07), transparent 65%),
    radial-gradient(700px 400px at 100% 0%, rgba(120, 140, 255, 0.05), transparent 60%), var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.mono {
  font-family: var(--mono);
}

/* ---------------------------------- topbar -------------------------------- */

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1140px;
  margin: 0 auto;
  padding: 22px 22px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
}

.brand:hover {
  text-decoration: none;
}

.mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--accent-soft);
  border: 1px solid rgba(126, 226, 168, 0.28);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.brand b {
  font-family: var(--mono);
  font-size: 15px;
  letter-spacing: -0.01em;
  font-weight: 600;
}

.brand small {
  display: block;
  color: var(--faint);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1.3;
}

.who {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(14, 17, 22, 0.7);
  font-size: 13px;
  color: var(--muted);
}

.who .name {
  color: var(--ink);
  font-family: var(--mono);
  font-size: 12.5px;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--faint);
  box-shadow: 0 0 0 3px rgba(90, 100, 114, 0.14);
  flex: none;
}

.dot.on {
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft), 0 0 12px rgba(126, 226, 168, 0.5);
}

.dot.bad {
  background: var(--danger);
  box-shadow: 0 0 0 3px rgba(255, 123, 114, 0.14);
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
}

.icon-btn:hover {
  color: var(--ink);
  border-color: #2c343e;
}

/* ---------------------------------- shell --------------------------------- */

.shell {
  max-width: 1140px;
  margin: 0 auto;
  padding: 34px 22px 90px;
}

.hero h1 {
  margin: 0 0 6px;
  font-size: clamp(24px, 3.4vw, 32px);
  letter-spacing: -0.025em;
  font-weight: 620;
}

.hero p {
  margin: 0 0 26px;
  color: var(--muted);
  font-size: 14px;
  max-width: 60ch;
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  align-items: start;
}

.col {
  display: grid;
  gap: 18px;
  min-width: 0;
}

/* ---------------------------------- cards --------------------------------- */

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
}

.card > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line-soft);
}

.card h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
}

.hint {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--faint);
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card .body {
  padding: 18px;
  display: grid;
  gap: 12px;
}

/* ---------------------------------- fields -------------------------------- */

textarea,
input[type="text"],
input[type="password"],
input[type="number"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--field);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.6;
  padding: 11px 12px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

textarea {
  resize: vertical;
  min-height: 74px;
}

textarea::placeholder,
input::placeholder {
  color: #4a535f;
}

textarea:focus,
input:focus {
  border-color: rgba(126, 226, 168, 0.55);
  box-shadow: 0 0 0 3px rgba(126, 226, 168, 0.09);
}

.row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.row.between {
  justify-content: space-between;
}

.sliders {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.field {
  display: grid;
  gap: 7px;
}

.label {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--faint);
}

.label b {
  color: var(--muted);
  font-weight: 500;
  text-transform: none;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 3px;
  border-radius: 3px;
  background: var(--line);
  outline: none;
  margin: 8px 0 2px;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #0b0f13;
  box-shadow: 0 0 0 1px rgba(126, 226, 168, 0.5);
  cursor: pointer;
}

/* --------------------------------- buttons -------------------------------- */

.btn {
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 9px 15px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  background: var(--accent);
  color: var(--accent-ink);
  transition: filter 0.15s ease, transform 0.05s ease;
}

.btn:hover {
  filter: brightness(1.06);
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  background: #1b2028;
  color: var(--faint);
  cursor: default;
  transform: none;
  filter: none;
}

.btn.ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}

.btn.ghost:hover {
  border-color: #333c47;
  filter: none;
}

.btn.danger {
  background: transparent;
  border-color: rgba(255, 123, 114, 0.35);
  color: var(--danger);
}

.btn.danger:hover {
  background: rgba(255, 123, 114, 0.08);
  filter: none;
}

.btn.tiny {
  padding: 5px 10px;
  font-size: 11.5px;
  border-radius: 7px;
}

.btn-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.note {
  font-size: 12px;
  color: var(--faint);
}

.note.bad {
  color: var(--danger);
}

.note.good {
  color: var(--accent);
}

/* ---------------------------------- chips --------------------------------- */

.chips {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.chip {
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--muted);
  border-radius: 999px;
  padding: 4px 10px;
  font-family: var(--mono);
  font-size: 11px;
  cursor: pointer;
}

.chip:hover {
  color: var(--ink);
  border-color: #2c343e;
}

/* -------------------------------- huddle list ----------------------------- */

.joined {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  border-top: 1px solid var(--line-soft);
}

.joined li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 12.5px;
}

.joined li:last-child {
  border-bottom: 0;
}

.joined .chan {
  font-family: var(--mono);
  color: var(--ink);
}

.joined .when {
  color: var(--faint);
  font-size: 11.5px;
  font-family: var(--mono);
}

.empty {
  color: var(--faint);
  font-size: 12.5px;
  padding: 10px 0 0;
}

/* -------------------------------- progress -------------------------------- */

.progress {
  display: grid;
  gap: 8px;
}

.bar {
  height: 4px;
  border-radius: 4px;
  background: var(--line);
  overflow: hidden;
}

.bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 4px;
  background: linear-gradient(90deg, #5fce93, var(--accent));
  transition: width 0.35s ease;
}

.progress .meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--faint);
}

/* ----------------------------------- log ---------------------------------- */

.log-card .body {
  padding: 0;
}

.log {
  list-style: none;
  margin: 0;
  padding: 8px 0;
  max-height: 560px;
  overflow: auto;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.5;
}

.log li {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 9px;
  padding: 4px 16px;
  color: var(--muted);
}

.log li .t {
  color: #414a55;
}

.log li.good {
  color: var(--ink);
}

.log li.warn {
  color: var(--warn);
}

.log li.bad {
  color: var(--danger);
}

.log:empty::after {
  content: "Nothing yet.";
  display: block;
  padding: 12px 16px;
  color: var(--faint);
  font-family: var(--sans);
  font-size: 12.5px;
}

/* ---------------------------------- login --------------------------------- */

.center {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(390px, 100%);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  padding: 30px 28px 26px;
  box-shadow: 0 30px 80px -40px rgba(0, 0, 0, 0.9);
}

.login-card .mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  font-size: 20px;
  margin-bottom: 18px;
}

.login-card h1 {
  margin: 0 0 4px;
  font-size: 19px;
  letter-spacing: -0.02em;
}

.login-card p {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 13px;
}

.login-card form {
  display: grid;
  gap: 12px;
}

.login-card .btn {
  width: 100%;
  padding: 10px;
}

.foot {
  margin-top: 18px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #3d4650;
  text-align: center;
}

/* ---------------------------------- setup --------------------------------- */

.narrow {
  max-width: 780px;
}

.step {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 14px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line-soft);
}

.step:last-of-type {
  border-bottom: 0;
}

.step .n {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11.5px;
}

.step h3 {
  margin: 1px 0 6px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.step p {
  margin: 0 0 9px;
  color: var(--muted);
  font-size: 13.5px;
}

.step p:last-child {
  margin-bottom: 0;
}

.code {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--field);
  padding: 11px 12px;
  padding-right: 74px;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.55;
  color: #cbd3dc;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.copy {
  position: absolute;
  top: 8px;
  right: 8px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--muted);
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 7px;
  cursor: pointer;
}

.copy:hover {
  color: var(--ink);
}

.kbd {
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--panel-2);
  padding: 1px 5px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink);
}

.callout {
  border: 1px solid rgba(242, 181, 68, 0.28);
  background: rgba(242, 181, 68, 0.06);
  border-radius: 10px;
  padding: 12px 14px;
  color: #e6cd9a;
  font-size: 12.5px;
}

.callout b {
  color: var(--warn);
}

.result {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-2);
  padding: 13px 14px;
  font-size: 13px;
  color: var(--muted);
}

.result.on {
  border-color: rgba(126, 226, 168, 0.35);
  background: var(--accent-soft);
  color: var(--ink);
}

.result.on b {
  color: var(--accent);
}

/* ---------------------------------- toast --------------------------------- */

.toasts {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: grid;
  gap: 8px;
  z-index: 40;
  max-width: min(380px, calc(100vw - 36px));
}

.toast {
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  background: #10141a;
  color: var(--ink);
  padding: 10px 13px;
  font-size: 12.5px;
  box-shadow: 0 20px 40px -24px rgba(0, 0, 0, 0.9);
  animation: toast-in 0.18s ease;
}

.toast.bad {
  border-left-color: var(--danger);
}

.toast.warn {
  border-left-color: var(--warn);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

@media (max-width: 900px) {
  .grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .sliders {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
