:root {
  color-scheme: light;
  font-family: "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #202124;
  background: #f4f6f8;
}
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; }
body { min-width: 300px; overflow: hidden; background: #f4f6f8; }
button, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
[hidden] { display: none !important; }

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 58px;
  padding: 10px 12px;
  border-bottom: 1px solid #e0e4e9;
  background: #fff;
}
.brand-block { display: grid; min-width: 0; gap: 1px; }
.brand-block strong { color: #c9000b; font-size: 15px; overflow-wrap: anywhere; }
.brand-block span { color: #697386; font-size: 11px; }
.panel-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 6px; }
.invite-button {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 7px 12px;
  border: 1px solid #d8000c;
  border-radius: 7px;
  background: #fff;
  color: #b0000a;
  font-size: 12px;
  font-weight: 800;
}
.end-watching-button {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid #cfd5dc;
  border-radius: 7px;
  background: #f7f8fa;
  color: #4b5563;
  font-size: 11px;
  font-weight: 800;
}

main {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: calc(100dvh - 58px);
  padding: 8px;
  overflow: hidden;
}
.panel-error {
  flex: 0 0 auto;
  padding: 9px 10px;
  border: 1px solid #ffc7c7;
  border-radius: 7px;
  background: #fff0f0;
  color: #a61b1b;
  font-size: 12px;
}
.sync-status {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid #dfe4ea;
  border-radius: 7px;
  background: #fff;
  color: #52606d;
  font-size: 12px;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.status-dot { flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; background: #778294; }
.sync-status[data-tone="ok"] .status-dot { background: #228b4e; }
.sync-status[data-tone="warn"] .status-dot { background: #d78700; }
.sync-status[data-tone="error"] .status-dot { background: #d8000c; }

.video-change-prompt, .proposal-area {
  flex: 0 0 auto;
  padding: 11px;
  border: 1px solid #efb34f;
  border-radius: 7px;
  background: #fff9eb;
}
.video-change-prompt { display: grid; gap: 9px; }
.video-change-prompt p { margin: 3px 0 0; color: #685329; font-size: 11px; line-height: 1.5; }
.video-change-prompt button, .proposal-actions button {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  font-weight: 800;
}
.video-change-prompt button { background: #d8000c; color: #fff; }
.proposal-area { display: grid; gap: 8px; }
.proposal-top { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; }
.proposal-area p { margin: 0; color: #685329; font-size: 11px; line-height: 1.5; }
.proposal-status { color: #697386; white-space: nowrap; }
.proposal-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.proposal-actions .approve { background: #207a42; color: #fff; }
.proposal-actions .reject { background: #eceff3; color: #3d4652; }

.chat-section {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #e0e4e9;
  border-radius: 7px;
  background: #fff;
}
.chat-heading {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 11px;
  border-bottom: 1px solid #eceff3;
}
h1 { margin: 0; font-size: 14px; }
.chat-heading span { color: #697386; font-size: 11px; overflow-wrap: anywhere; }
.chat-list {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  flex-direction: column;
  gap: 7px;
  padding: 10px;
  overflow-y: auto;
}
.message { max-width: 92%; padding: 8px 9px; border-radius: 7px; background: #f1f3f5; font-size: 13px; }
.message.mine { align-self: flex-end; background: #ffe9ea; }
.message-name { display: block; margin-bottom: 2px; color: #697386; font-size: 10px; font-weight: 700; }
.message p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.empty { margin: auto; color: #8a929e; font-size: 12px; text-align: center; }
#chatForm {
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
  padding: 8px;
  border-top: 1px solid #eceff3;
  background: #fff;
}
#chatInput {
  width: 100%;
  min-height: 42px;
  max-height: 112px;
  padding: 9px 10px;
  resize: vertical;
  border: 1px solid #cfd5dc;
  border-radius: 7px;
  background: #fff;
  color: #202124;
}
#chatForm button {
  min-width: 56px;
  border: 0;
  border-radius: 7px;
  background: #d8000c;
  color: #fff;
  font-weight: 800;
}
@media (max-width: 330px) {
  .panel-header { padding-inline: 9px; }
  .panel-actions { gap: 4px; }
  .invite-button, .end-watching-button { padding-inline: 8px; }
  main { padding: 6px; }
  #chatForm { grid-template-columns: 1fr; }
  #chatForm button { min-height: 38px; }
}
