:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --ink: #202124;
  --muted: #676f7a;
  --line: #d9dee5;
  --accent: #0f766e;
  --murmur: #6d5dfc;
  --question: #1f6feb;
  --notice: #c47d12;
  --star: #c026d3;
  --action: #15803d;
  --danger: #b42318;
  --shadow: 0 10px 30px rgba(20, 25, 35, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", "YuGothic", "Noto Sans JP", sans-serif;
  font-size: 16px;
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
textarea,
input {
  font: inherit;
}

button {
  min-height: 42px;
  border: 1px solid transparent;
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

h1,
h2,
p {
  margin: 0;
}

.create-shell {
  min-height: 100vh;
  display: grid;
  align-content: center;
  gap: 18px;
  width: min(680px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0;
}

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

.create-panel {
  display: grid;
  gap: 18px;
  padding: clamp(22px, 4vw, 34px);
}

.create-panel > p {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.create-panel h1 {
  font-size: clamp(28px, 5vw, 44px);
  line-height: 1.18;
}

.create-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.create-form input {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
}

.notice-box {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid #f1d3a7;
  border-radius: 8px;
  background: #fffaf0;
  color: #6f4e11;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.55;
}

.form-message,
.composer-message,
.expiry-note {
  min-height: 20px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(246, 247, 249, 0.94);
  backdrop-filter: blur(10px);
}

.brand {
  font-weight: 800;
  font-size: 19px;
}

.top-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}

.layout {
  width: min(1180px, calc(100% - 32px));
  margin: 24px auto 28px;
  display: grid;
  grid-template-columns: minmax(320px, 430px) minmax(0, 1fr);
  align-items: start;
  gap: 18px;
}

.site-footer {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 34px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-align: right;
}

.create-footer {
  width: auto;
  margin: 0;
}

.site-footer a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.composer {
  position: sticky;
  top: 78px;
  padding: 18px;
}

.stream-panel {
  min-width: 0;
  padding: 18px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}

.section-head h2 {
  font-size: 15px;
  line-height: 1.25;
}

.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 8px;
  padding: 8px 11px;
  font-weight: 800;
}

.chip.selected {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.chip.murmur.selected,
.kind-mark.murmur {
  background: var(--murmur);
}

.chip.question.selected,
.kind-mark.question {
  background: var(--question);
}

.chip.notice.selected,
.kind-mark.notice {
  background: var(--notice);
}

.chip.star.selected,
.kind-mark.star {
  background: var(--star);
}

.chip.action.selected,
.kind-mark.action {
  background: var(--action);
}

textarea {
  width: 100%;
  min-height: 160px;
  margin-top: 16px;
  padding: 14px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  line-height: 1.7;
}

textarea:focus,
input:focus,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.28);
  outline-offset: 2px;
}

.composer-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

.primary-button,
.secondary-button,
.text-button,
.reaction-button {
  border-radius: 8px;
  padding: 9px 14px;
  font-weight: 800;
}

.primary-button {
  background: var(--accent);
  color: white;
}

.secondary-button,
.reaction-button {
  background: #eef2f7;
  color: var(--ink);
  border-color: var(--line);
}

.text-button {
  background: transparent;
  color: var(--muted);
  border-color: var(--line);
}

.filters {
  display: grid;
  gap: 10px;
  margin: 14px 0 16px;
}

.filter-kind .chip,
.sort .chip {
  min-height: 36px;
  padding: 7px 10px;
  font-size: 14px;
}

.compact-stats {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  text-align: right;
}

.export-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.export-links a {
  display: inline-grid;
  place-items: center;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
  background: #fff;
  font-weight: 800;
}

.timeline {
  display: grid;
  gap: 12px;
}

.post {
  border: 1px solid var(--line);
  border-left: 7px solid var(--accent);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.post.murmur {
  border-left-color: var(--murmur);
}

.post.question {
  border-left-color: var(--question);
}

.post.notice {
  border-left-color: var(--notice);
}

.post.star {
  border-left-color: var(--star);
}

.post.action {
  border-left-color: var(--action);
}

.post-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.kind-mark {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: #fff;
  font-size: 16px;
}

.post-text {
  margin: 12px 0 0;
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 17px;
}

.post.collapsed .post-text {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
}

.expand-button {
  margin-top: 10px;
}

.post-footer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.empty,
.fatal {
  padding: 34px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
  background: #fff;
}

.fatal {
  width: min(680px, calc(100% - 32px));
  margin: 64px auto;
}

.is-reconnecting::after {
  content: "再接続中";
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 30;
  padding: 8px 11px;
  border-radius: 8px;
  background: var(--danger);
  color: #fff;
  font-weight: 800;
}

.toast {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 40;
  padding: 10px 13px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-weight: 800;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(10, 12, 16, 0.45);
}

.qr-modal {
  width: min(92vw, 380px);
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 22px;
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.qr-modal svg {
  width: 260px;
  height: 260px;
}

.qr-modal p {
  max-width: 100%;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.modal-actions {
  display: flex;
  width: 100%;
  gap: 10px;
}

.modal-actions button {
  flex: 1;
}

@media (max-width: 900px) {
  .layout {
    width: min(100% - 20px, 720px);
    grid-template-columns: 1fr;
    margin-top: 14px;
  }

  .composer,
  .topbar {
    position: static;
  }
}

@media (max-width: 560px) {
  .create-form,
  .topbar,
  .composer-actions,
  .top-tools,
  .modal-actions {
    align-items: stretch;
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .topbar {
    align-items: flex-start;
  }

  .top-tools,
  .composer-actions button,
  .top-tools button,
  .export-links,
  .export-links a {
    width: 100%;
    text-align: center;
  }

  .brand {
    font-size: 18px;
  }
}
