:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --text: #1b1e2b;
  --muted: #646a80;
  --border: #e2e5ee;
  --accent: #4f46e5;
  --accent-soft: #eef0ff;
  --danger: #d92d4b;
  --ok: #12a150;
  --radius: 14px;
  --radius-sm: 10px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --shadow: 0 1px 2px rgba(20, 24, 40, .06), 0 8px 24px rgba(20, 24, 40, .06);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1117;
    --surface: #181b24;
    --text: #e8eaf2;
    --muted: #9298ad;
    --border: #2a2f3d;
    --accent: #8b85ff;
    --accent-soft: #23234a;
    --shadow: none;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  font: 16px/1.55 var(--font);
  background: var(--bg);
  color: var(--text);
}
a { color: var(--accent); }
.wrap { max-width: 920px; margin: 0 auto; padding: 0 16px; }

header.nav { border-bottom: 1px solid var(--border); background: var(--surface); }
header.nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 12px; }
.brand { font-weight: 700; font-size: 1.15rem; color: var(--text); text-decoration: none; display: flex; gap: 8px; align-items: center; }
.brand .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); box-shadow: 8px 0 0 var(--ok); margin-right: 8px; }
nav a { color: var(--muted); text-decoration: none; margin-left: 18px; font-size: .95rem; }
nav a:hover, nav a.active { color: var(--text); }

.hero { text-align: center; padding: 40px 0 20px; }
.hero h1 { font-size: clamp(1.7rem, 4vw, 2.5rem); margin: 0 0 8px; line-height: 1.2; }
.hero p { color: var(--muted); margin: 0; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin: 20px 0; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.toolbar .spacer { flex: 1; }
.status { font-size: .85rem; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.status .led { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.status.online .led { background: var(--ok); }
.status.offline .led { background: var(--danger); }

button, .btn {
  font: inherit; font-size: .92rem; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  padding: 8px 14px; border-radius: var(--radius-sm); text-decoration: none; display: inline-flex; align-items: center; gap: 6px;
}
button:hover, .btn:hover { border-color: var(--accent); }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.danger { color: var(--danger); }
button:disabled { opacity: .5; cursor: default; }

textarea, input[type=text] {
  width: 100%; font: inherit; color: var(--text); background: var(--bg);
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px;
}
textarea { min-height: 260px; resize: vertical; font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .95rem; }
textarea:focus, input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

.drop { border: 2px dashed var(--border); border-radius: var(--radius-sm); padding: 22px; text-align: center; color: var(--muted); margin-top: 12px; transition: .15s; }
.drop.over { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.files { list-style: none; padding: 0; margin: 12px 0 0; }
.files li { display: flex; align-items: center; gap: 10px; padding: 10px 4px; border-top: 1px solid var(--border); }
.files .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.files .meta { color: var(--muted); font-size: .82rem; white-space: nowrap; }
.empty { color: var(--muted); font-size: .9rem; padding: 8px 4px; }

.room { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: .9rem; color: var(--muted); }
.room input { width: 180px; padding: 7px 10px; }
.room code { background: var(--accent-soft); color: var(--text); padding: 2px 8px; border-radius: 6px; }

.phone { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.phone h3 { margin: 0 0 4px; }
.phone p { margin: 4px 0; color: var(--muted); }
.phone code { background: var(--accent-soft); color: var(--text); padding: 3px 8px; border-radius: 6px; font-size: 1rem; }
.qr { width: 150px; height: 150px; background: #fff; border-radius: var(--radius-sm); padding: 6px; flex: none; }
.qr svg { width: 100%; height: 100%; display: block; }

h2 { font-size: 1.4rem; margin: 48px 0 16px; }
.steps, .features { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.step, .feature { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.step b { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); margin-bottom: 8px; }
.step p, .feature p { color: var(--muted); margin: 6px 0 0; font-size: .95rem; }
.feature h3, .step h3 { margin: 0; font-size: 1.05rem; }

footer { color: var(--muted); font-size: .85rem; padding: 40px 0; text-align: center; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); opacity: 0;
  background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: var(--radius-sm); transition: .2s; pointer-events: none; }
.toast.show { opacity: 1; transform: translateX(-50%); }

.notice { background: var(--accent-soft); border-radius: var(--radius-sm); padding: 12px 14px; font-size: .92rem; }

/* private boards */
.card-title { margin: 0 0 4px; font-size: 1.1rem; }
.muted { color: var(--muted); }
.small { font-size: .87rem; }
.error { color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, transparent); border-radius: var(--radius-sm); padding: 10px 14px; font-size: .92rem; margin: 12px 0 0; }
.form-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); align-items: end; margin-top: 12px; }
.form-grid label, .field { display: flex; flex-direction: column; gap: 6px; font-size: .87rem; color: var(--muted); }
.field { margin: 12px 0; }
input[type=password], select {
  width: 100%; font: inherit; color: var(--text); background: var(--bg);
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px;
}
input[type=password] { letter-spacing: .25em; }
input[type=password]:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.copy-row { display: flex; gap: 8px; }
.copy-row input { flex: 1; min-width: 0; padding: 9px 12px; }
.narrow { max-width: 420px; margin-left: auto; margin-right: auto; }
.wide { width: 100%; justify-content: center; }
.primary-link { background: var(--accent); border-color: var(--accent); color: #fff; }
.form-grid button { height: 44px; justify-content: center; }
.check { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: .92rem; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.result { word-break: break-all; }

@media (max-width: 560px) {
  nav a { margin-left: 12px; font-size: .88rem; }
  .hero { padding-top: 28px; }
}
