.entry-card select {
  display: block;
  width: 100%;
  min-height: 48px;
  margin: 0 0 14px;
  padding: 0 12px;
  border: 1px solid #dbe4da;
  border-radius: 7px;
  background: #fbfcf9;
  color: #254433;
}
.theme-toggle {
  border: 1px solid #c8d8cb;
  border-radius: 7px;
  background: transparent;
  color: #42664e;
  padding: 8px 11px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
}
.theme-toggle:hover { background: #e4eee3; }
.header-actions { display: flex; align-items: center; justify-self: end; gap: 8px; }
.join-request, .mobile-join-request {
  margin-top: 24px;
  padding: 16px;
  border: 1px solid #b6d6b9;
  border-radius: 9px;
  background: #e8f3e7;
  color: #254433;
}
.join-request strong, .mobile-join-request strong { font-size: 13px; }
.join-request p { margin: 7px 0 13px; color: #4d7054; }
.join-request-actions { display: flex; gap: 8px; }
.join-request button, .mobile-join-request button {
  border: 1px solid #9fc9a8;
  border-radius: 6px;
  background: #fff;
  color: #21533b;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 700;
}
.join-request button:first-child, .mobile-join-request button:nth-child(2) {
  background: #205941;
  color: #fff;
}
.countdown { font-weight: 700; color: #3c7655 !important; }
.end-room-button, .mobile-room-controls button {
  border: 1px solid #d7bbb8;
  border-radius: 6px;
  background: #fff6f4;
  color: #944940;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 700;
}
.end-room-button { margin-top: 3px; width: 100%; }
.end-room-button:hover, .mobile-room-controls button:hover { background: #ffece8; }
.mobile-room-controls, .mobile-join-request { display: none; }
.message-lower { display: flex; align-items: center; gap: 8px; }
.reaction-actions { display: flex; gap: 3px; }
.reaction-actions button {
  border: 1px solid #dae6d9;
  border-radius: 999px;
  background: #f6faf4;
  min-width: 30px;
  min-height: 27px;
  font-size: 14px;
  line-height: 1;
}
.reaction-actions button:hover { background: #e6f2e2; }
.reaction-count { font-size: 15px; }
.delivery-status { font-size: 10px; color: #789585; }
.media-controls { display: flex; align-items: center; gap: 8px; padding: 0 24px 12px; flex-wrap: wrap; }
.media-controls button { border: 1px solid #bdd3c0; border-radius: 7px; background: #f5faf4; color: #24563b; padding: 8px 12px; font-size: 12px; font-weight: 700; }
.media-controls button:hover:not(:disabled) { background: #e4f2e4; }
.media-controls button:disabled { opacity: .45; cursor: not-allowed; }
#voice-status { font-size: 11px; color: #b25e49; }
.shared-photo { display: block; width: min(100%, 330px); height: auto; max-height: 360px; object-fit: contain; border-radius: 7px; }
.message-bubble:has(.shared-photo), .message-bubble:has(audio) { padding: 8px; }
.voice-label { display: block; font-size: 12px; font-weight: 700; margin-bottom: 6px; }
.message-bubble audio { display: block; width: min(260px, 64vw); max-width: 100%; }
.typing-status { padding: 0 35px 10px; color: #5d8067; font-size: 12px; }
.qr-dialog {
  width: min(94vw, 360px);
  border: 1px solid #cbdccc;
  border-radius: 15px;
  padding: 25px;
  background: #f8fbf6;
  color: #244b37;
  box-shadow: 0 22px 70px #0d2f2266;
  text-align: center;
}
.qr-dialog::backdrop { background: #092719bb; }
.qr-dialog h2 { margin: 0 0 10px; font-size: 21px; }
.qr-dialog p { font-size: 13px; line-height: 1.5; color: #668272; }
.qr-dialog svg { display: block; width: 240px; max-width: 100%; margin: 20px auto; image-rendering: pixelated; }
.qr-dialog strong { display: block; margin: 0 0 16px; font: 20px 'DM Mono', monospace; letter-spacing: .13em; }
.qr-dialog button {
  border: 0;
  border-radius: 7px;
  background: #205941;
  color: #fff;
  padding: 10px 24px;
  font-weight: 700;
}
button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid #66a778;
  outline-offset: 2px;
}

html[data-theme="dark"] { color-scheme: dark; }
html[data-theme="dark"] body { background: #10211b; color: #e2ecdf; }
html[data-theme="dark"] .landing,
html[data-theme="dark"] .chat { background: #172c23; border-color: #315443; box-shadow: none; }
html[data-theme="dark"] .entry-card { background: #203a2c; border-color: #3b5845; box-shadow: none; }
html[data-theme="dark"] .intro h1,
html[data-theme="dark"] .entry-card label,
html[data-theme="dark"] .section-number span,
html[data-theme="dark"] .empty-chat h2,
html[data-theme="dark"] .room-code-row strong { color: #e5f1df; }
html[data-theme="dark"] .intro h1 em { color: #a8d3a9; }
html[data-theme="dark"] .intro > p,
html[data-theme="dark"] .privacy-note,
html[data-theme="dark"] .chat-side p,
html[data-theme="dark"] .qr-dialog p { color: #b0c6b5; }
html[data-theme="dark"] .brand,
html[data-theme="dark"] .chat-brand,
html[data-theme="dark"] .status { color: #d6ead7; }
html[data-theme="dark"] .brand-mark,
html[data-theme="dark"] .primary-button,
html[data-theme="dark"] .composer button { background: #397653; }
html[data-theme="dark"] .entry-card input,
html[data-theme="dark"] .entry-card select,
html[data-theme="dark"] .composer input { background: #152b20; border-color: #42624a; color: #e6f2e3; }
html[data-theme="dark"] .join-row button,
html[data-theme="dark"] .copy-button,
html[data-theme="dark"] .leave-button,
html[data-theme="dark"] .theme-toggle,
html[data-theme="dark"] .reaction-actions button { background: #294533; border-color: #4e7054; color: #dcebd9; }
html[data-theme="dark"] .chat-side { background: #1b3327; border-color: #3c5544; }
html[data-theme="dark"] .chat-header,
html[data-theme="dark"] .composer,
html[data-theme="dark"] .landing-footer,
html[data-theme="dark"] .card-header,
html[data-theme="dark"] .divider,
html[data-theme="dark"] .side-rule { border-color: #3c5544; }
html[data-theme="dark"] .divider { background: #3c5544; }
html[data-theme="dark"] .divider span { background: #203a2c; }
html[data-theme="dark"] .theirs .message-bubble { background: #2e4937; color: #e8f2e5; }
html[data-theme="dark"] .mine .message-bubble { background: #397653; }
html[data-theme="dark"] .system-message,
html[data-theme="dark"] .join-request,
html[data-theme="dark"] .mobile-join-request { background: #294533; border-color: #4b7051; color: #d8ead8; }
html[data-theme="dark"] .join-request p { color: #b3ceb6; }
html[data-theme="dark"] .end-room-button,
html[data-theme="dark"] .mobile-room-controls button { background: #3a2b29; border-color: #704741; color: #ffd0c9; }
html[data-theme="dark"] .qr-dialog { background: #1d3829; border-color: #527258; color: #e7f1e2; }
html[data-theme="dark"] .qr-dialog::backdrop { background: #020c08d9; }
html[data-theme="dark"] .media-controls button { background: #294533; border-color: #4e7054; color: #dcebd9; }

@media (max-width: 850px) {
  .header-actions { grid-column: 2; grid-row: 1; }
  .header-actions .theme-toggle { display: none; }
  .mobile-room-controls { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 16px; border-bottom: 1px solid #e1e8df; font-size: 11px; color: #5e8069; }
  .mobile-join-request { display: flex; align-items: center; gap: 8px; margin: 8px 16px; padding: 10px; }
  .mobile-join-request strong { margin-right: auto; }
  .typing-status { padding: 0 16px 8px; }
}
@media (max-width: 520px) {
  .room-code-row { flex-wrap: wrap; gap: 8px; }
  .header-actions .leave-button { margin: 0; }
  .mobile-room-controls { flex-wrap: wrap; }
  .mobile-join-request { flex-wrap: wrap; }
  .message-row { max-width: 92%; }
  .reaction-actions button { min-width: 32px; min-height: 30px; }
}
