:root {
  color-scheme: light;
  --bg: #f7f8fb;
  --panel: #ffffff;
  --text: #1b1f2a;
  --muted: #687083;
  --border: #d8deea;
  --accent: #146c5c;
  --accent-hover: #0f584b;
  --danger: #b3261e;
  --shadow: 0 18px 45px rgba(26, 35, 54, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

button,
textarea {
  font: inherit;
}

button {
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  padding: 0 16px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
}

button:hover {
  background: var(--accent-hover);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.secondary {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
}

.secondary:hover {
  background: #eef2f6;
}

.shell {
  width: min(920px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 56px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(32px, 8vw, 52px);
  line-height: 1.05;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 18px;
  letter-spacing: 0;
}

.auth {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 190px;
}

.user {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #dfe5ef;
  object-fit: cover;
}

.login {
  overflow: hidden;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.email {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notice {
  margin-bottom: 16px;
  border: 1px solid rgba(179, 38, 30, 0.28);
  border-radius: 8px;
  padding: 12px 14px;
  background: #fff5f3;
  color: var(--danger);
}

.composer,
.feed {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.composer {
  margin-bottom: 18px;
  padding: 16px;
}

textarea {
  width: 100%;
  min-height: 108px;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  color: var(--text);
  outline: none;
}

textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(20, 108, 92, 0.15);
}

.composerActions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.feed {
  overflow: hidden;
}

.feedHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  padding: 14px 16px;
}

.messages {
  min-height: 220px;
}

.empty,
.loading {
  padding: 34px 16px;
  color: var(--muted);
  text-align: center;
}

.message {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  padding: 16px;
}

.message + .message {
  border-top: 1px solid var(--border);
}

.messageMeta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
}

.messageAuthor {
  font-weight: 700;
}

.messageTime {
  color: var(--muted);
  font-size: 12px;
}

.messageBody {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.55;
}

@media (max-width: 640px) {
  .shell {
    width: min(100% - 24px, 920px);
    padding-top: 20px;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .auth {
    justify-content: flex-start;
    min-width: 0;
  }

  .user {
    flex: 1;
  }
}
