:root {
  color-scheme: dark;
  --bg: #0f1115;
  --panel: #171a21;
  --border: #2a2e38;
  --text: #e6e8eb;
  --muted: #8b90a0;
  --accent: #5b8cff;
  --mine: #23386b;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100vh;
  display: flex;
  align-items: stretch;
  justify-content: center;
}

.screen {
  width: 100%;
  max-width: 480px;
  margin: auto;
  display: flex;
  flex-direction: column;
  padding: 24px;
}

h1 { margin: 0 0 4px; }
.tagline { color: var(--muted); font-size: 14px; margin: 0 0 24px; }

label { font-size: 13px; color: var(--muted); margin: 12px 0 4px; }

input {
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 15px;
}

button {
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 15px;
  cursor: pointer;
}
button:disabled { opacity: 0.6; cursor: default; }

.row { margin-top: 12px; }

.card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px 18px;
  margin-top: 8px;
}
.card h2 { margin: 0 0 6px; font-size: 16px; }
.card .hint { color: var(--muted); font-size: 13px; margin: 0 0 4px; }
.card label { margin-top: 10px; }

.divider {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  margin: 18px 0;
  position: relative;
}
.divider::before, .divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 40%;
  border-top: 1px solid var(--border);
}
.divider::before { left: 0; }
.divider::after { right: 0; }
.status { color: var(--muted); font-size: 13px; min-height: 18px; }

#screen-chat {
  max-width: 640px;
  height: 100vh;
  padding: 0;
}

.chat-header { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.chat-header button { background: transparent; border: 1px solid var(--border); }
.header-actions { display: flex; gap: 8px; }
.chat-header button.danger { color: #ff8080; border-color: #6b2a2a; }
.chat-header button.danger:hover { background: #2a1414; }

.agreement-text { max-height: 320px; overflow-y: auto; }
.agreement-text p { margin: 0 0 8px; font-size: 14px; }
.agreement-text ul { margin: 0; padding-left: 20px; font-size: 13.5px; color: var(--muted); }
.agreement-text li { margin-bottom: 10px; line-height: 1.4; }

.agreement-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 14px;
  color: var(--text);
  margin-top: 16px;
  cursor: pointer;
}
.agreement-check input { width: auto; margin-top: 3px; cursor: pointer; }

.messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.msg {
  max-width: 75%;
  background: var(--panel);
  border-radius: 10px;
  padding: 8px 12px;
  align-self: flex-start;
}
.msg.mine { background: var(--mine); align-self: flex-end; }
.msg.system { align-self: center; color: var(--muted); font-size: 13px; background: none; }

.msg .who { font-size: 12px; color: var(--accent); margin-right: 8px; }
.msg.mine .who { color: #9db8ff; }
.msg .when { font-size: 11px; color: var(--muted); }
.msg .text { margin-top: 2px; word-wrap: break-word; white-space: pre-wrap; }

.composer {
  display: flex;
  gap: 8px;
  padding: 14px 18px;
  border-top: 1px solid var(--border);
}
.composer input { flex: 1; }
