/* flychat — theme lifted verbatim from flyguess (dark green ink, mono accents).
 * No external deps, no changes to flyguess itself. */
:root {
  color-scheme: dark;
  --bg: #0b0e0c;
  --panel: #10150f;
  --panel-2: #161c15;
  --border: #22301f;
  --border-soft: #1c261a;
  --ink: #ffffff;
  --muted: #8fa48e;
  --faint: #67796a;
  --accent: #4f9e63;
  --accent-deep: #2e5c3c;
  --rose: #c8647d;
  --canvas: #0d1412;
  --canvas-ink: #e9f1eb;
  --canvas-muted: #a1b4a7;
  --green: #79bc88;
  --mono: "Cascadia Code", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0; min-height: 100vh;
  background: var(--bg); color: var(--ink);
  font-family: var(--sans); line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
::selection { background: #4f9e6344; color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent-deep); outline-offset: 2px; }
input:focus { outline: none; border-color: var(--accent) !important; box-shadow: none; }
.composer input[type="text"]:focus { outline: none; box-shadow: inset 0 0 0 1px var(--accent); }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 0 24px;
  padding: 0 max(20px, calc((100vw - 1180px) / 2));
  min-height: 64px; border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; padding-block: 12px; }
.brand .eyebrow { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; color: var(--accent); }
.brand h1 { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: -.04em; line-height: 1.15; }

.kicker {
  width: min(100% - 40px, 1180px); margin-inline: auto;
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px;
  padding-block: 15px 12px; font-family: var(--mono); font-size: 11px;
}
.kicker-title { font-weight: 700; letter-spacing: .08em; color: var(--ink); }
.kicker-detail { color: var(--muted); letter-spacing: .03em; }

.chat-wrap {
  width: min(100% - 40px, 760px); margin-inline: auto;
  display: flex; flex-direction: column; gap: 8px;
}
.panel {
  display: flex; flex-direction: column; min-width: 0;
  border: 1px solid var(--border); background: var(--panel); border-radius: 0;
}
.panel-head {
  display: flex; align-items: baseline; gap: 8px;
  padding: 9px 10px; border-bottom: 1px solid var(--border);
  background: var(--panel-2); color: var(--ink);
}
.panel-head h2 { margin: 0; font-size: 11px; font-weight: 700; letter-spacing: .07em; }
.panel-head small { margin-left: auto; color: var(--muted); font-family: var(--mono); font-size: 9px; }

#log {
  height: min(58vh, 520px); overflow-y: auto; padding: 12px 14px;
  display: flex; flex-direction: column; gap: 9px;
}
.msg { display: flex; flex-direction: column; gap: 2px; }
.msg .who { font-family: var(--mono); font-size: 11px; letter-spacing: .05em; color: var(--canvas-muted); }
.msg .who.dev { color: var(--rose); font-weight: 700; }
.msg .who .tag {
  display: inline-block; margin-left: 6px; padding: 1px 6px;
  background: #c8647d22; color: var(--rose); font-size: 9px; font-weight: 700;
}
.msg .text { font-size: 14px; color: var(--canvas-ink); overflow-wrap: anywhere; white-space: pre-wrap; }
.msg .when { font-family: var(--mono); font-size: 9px; color: var(--faint); }

.composer { display: flex; border-top: 1px solid var(--border); }
.composer input[type="text"] {
  flex: 1; min-width: 0; min-height: 48px; padding: 8px 14px;
  border: 0; background: var(--canvas); color: var(--canvas-ink);
  font: inherit; font-size: 14px;
}
.composer input[type="text"]::placeholder { color: var(--faint); }
.composer button {
  min-height: 48px; padding: 10px 22px; border: 0; border-left: 1px solid var(--border);
  background: var(--accent-deep); color: var(--canvas-ink);
  font-family: var(--mono); font-size: 12px; font-weight: 700; letter-spacing: .05em;
  cursor: pointer;
}
.composer button:hover { background: var(--accent); color: var(--bg); }

/* minimalist login bar + nickname popup */
.gate-bar { display: flex; justify-content: center; padding-block: 4px; min-height: 40px; align-items: center; }

.session-info { display: flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 11px; letter-spacing: .06em; }
.session-you { color: var(--faint); font-size: 9px; letter-spacing: .12em; }
.session-name { color: var(--canvas-muted); font-weight: 700; }
.session-name.dev { color: var(--rose); }
#logout-btn {
  min-height: 30px; padding: 4px 14px; cursor: pointer;
  border: 1px solid var(--border); border-radius: 0;
  background: var(--bg); color: var(--muted);
  font-family: var(--mono); font-size: 10px; letter-spacing: .08em;
}
#logout-btn:hover, #logout-btn:focus-visible { color: var(--rose); border-color: var(--rose); }
#login-btn {
  min-height: 36px; padding: 6px 20px;
  border: 1px solid var(--accent-deep); border-radius: 0;
  background: var(--bg); color: var(--muted);
  font-family: var(--mono); font-size: 11px; letter-spacing: .08em; cursor: pointer;
}
#login-btn:hover, #login-btn:focus-visible { color: var(--accent); border-color: var(--accent); }

.name-dialog {
  width: min(90vw, 320px); padding: 20px;
  border: 1px solid var(--accent-deep); border-radius: 0;
  background: var(--canvas); color: var(--canvas-ink);
  box-shadow: 0 8px 40px #000c;
}
.name-dialog::backdrop { background: #0b0e0caa; }
.name-dialog label { display: block; margin-bottom: 8px; font-family: var(--mono); font-size: 10px; letter-spacing: .1em; color: var(--muted); }
.name-dialog input {
  width: 100%; min-height: 44px; padding: 8px 12px;
  border: 1px solid var(--accent-deep); background: var(--bg); color: var(--canvas-ink);
  font: inherit; font-size: 14px;
}
.name-dialog .err { color: var(--rose); font-family: var(--mono); font-size: 11px; min-height: 1.2em; margin-top: 6px; }
.name-dialog .dlg-row { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.name-dialog .dlg-row button {
  min-height: 36px; padding: 6px 16px; cursor: pointer;
  font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: .05em;
  border: 1px solid var(--border); background: var(--bg); color: var(--muted); border-radius: 0;
}
.name-dialog .dlg-row button:hover { color: var(--ink); border-color: var(--accent); }
#name-enter { border-color: var(--accent) !important; background: var(--accent-deep); color: var(--canvas-ink) !important; }
#name-enter:hover { background: var(--accent) !important; color: var(--bg) !important; }

/* hidden dev login surface */
.dev-body {
  display: grid; place-items: center;
  min-height: 100vh;
}
.dev-card {
  width: min(100% - 40px, 340px);
  padding: 26px 24px;
  border: 1px solid var(--border); background: var(--panel); border-radius: 0;
  box-shadow: 0 8px 40px #000a;
}
.dev-eyebrow { font-family: var(--mono); font-size: 10px; letter-spacing: .14em; color: var(--accent); margin-bottom: 10px; }
.dev-card h3 { margin: 0 0 6px; font-size: 21px; font-weight: 700; letter-spacing: -.02em; }
.dev-card p { margin: 0 0 20px; font-size: 12px; line-height: 1.6; color: var(--canvas-muted); }
.dev-word { color: var(--rose); font-family: var(--mono); font-size: .92em; letter-spacing: .04em; }
.dev-card label { display: block; margin-bottom: 8px; font-family: var(--mono); font-size: 10px; letter-spacing: .12em; color: var(--muted); }
.dev-card input {
  width: 100%; min-height: 46px; padding: 8px 14px;
  border: 1px solid var(--border); background: var(--canvas); color: var(--canvas-ink);
  font: inherit; font-size: 15px; letter-spacing: .18em;
}
.dev-card input:focus { outline: none; border-color: var(--accent); box-shadow: none; }
.dev-card button[type="submit"], .dev-card #logout {
  width: 100%; min-height: 46px; margin-top: 14px;
  border: 1px solid var(--accent); border-radius: 0;
  background: var(--accent-deep); color: var(--canvas-ink);
  font-family: var(--mono); font-size: 12px; font-weight: 700; letter-spacing: .1em;
  cursor: pointer;
}
.dev-card button[type="submit"]:hover { background: var(--accent); color: var(--bg); }
.dev-card #logout { border-color: var(--border); background: var(--bg); color: var(--muted); }
.dev-card #logout:hover { color: var(--rose); border-color: var(--rose); background: var(--bg); }
.dev-card .err { color: var(--rose); font-family: var(--mono); font-size: 11px; min-height: 1.2em; margin-top: 8px; }
.dev-ok { color: var(--green); font-family: var(--mono); font-size: 12px; }
.dev-foot {
  margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--border-soft);
  font-family: var(--mono); font-size: 10px; letter-spacing: .08em; color: var(--faint);
}
.dev-foot a { color: var(--muted); text-decoration: none; }
.dev-foot a:hover { color: var(--accent); }

@media (max-width: 640px) {
  #log { height: 52vh; }
}

/* ---- embed mode: compact dock inside flyguess (iframe) ---- */
body.embed {
  height: 100vh; height: 100dvh; overflow: hidden;
}
body.embed .chat-wrap {
  width: 100%; margin: 0; gap: 0;
  height: 100vh; height: 100dvh;
}
body.embed .panel { flex: 1; min-height: 0; border: 0; }
/* the dock header on the parent page already says LIVE CHAT · live — hide inner header entirely */
body.embed .panel-head { display: none; }
body.embed #chat-panel { position: relative; }
body.embed .gate-bar { min-height: 34px; padding-block: 3px; border-bottom: 1px solid var(--border); }
body.embed #login-btn { min-height: 26px; padding: 2px 14px; font-size: 10px; }
body.embed #logout-btn { min-height: 24px; padding: 2px 10px; font-size: 9px; }
body.embed .session-info { font-size: 10px; gap: 8px; }
body.embed #log {
  flex: 1; min-height: 0; height: auto;
  padding: 8px 10px; gap: 6px; scrollbar-width: thin;
}
body.embed .msg .who { font-size: 10px; }
body.embed .msg .text { font-size: 12.5px; line-height: 1.4; }
body.embed .composer input[type="text"] { min-height: 38px; font-size: 12.5px; padding: 6px 10px; }
body.embed .composer button { min-height: 38px; padding: 6px 14px; font-size: 11px; }
body.embed .name-dialog { width: min(88vw, 300px); padding: 16px; }
body.embed .name-dialog input { min-height: 38px; font-size: 13px; }