:root {
  color-scheme: light;
  --bg: #f8f6ef;
  --panel: #fffdf7;
  --panel-strong: #ffffff;
  --ink: #171717;
  --muted: #6c6b66;
  --line: #ded8ca;
  --green: #168a54;
  --green-dark: #0f6c41;
  --blue: #2c60d4;
  --coral: #e85f3f;
  --amber: #b87913;
  --sun: #ffcf4a;
  --mint: #dff6e9;
  --shadow: 0 14px 38px rgba(31, 27, 20, 0.09);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(rgba(23, 23, 23, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 23, 23, 0.025) 1px, transparent 1px),
    var(--bg);
  background-size: 28px 28px;
  color: var(--ink);
  font-family:
    Inter,
    Pretendard,
    "Apple SD Gothic Neo",
    "Noto Sans KR",
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

.seo-fallback {
  width: min(760px, calc(100% - 32px));
  margin: 72px auto;
  border: 2px solid #171717;
  border-radius: var(--radius);
  background: var(--panel-strong);
  box-shadow: var(--shadow);
  padding: 28px;
}

.seo-fallback h1 {
  margin-bottom: 12px;
  font-size: 34px;
  line-height: 1.1;
}

.seo-fallback p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.68;
  transform: none;
  box-shadow: none;
}

.app-shell {
  width: min(1200px, calc(100% - 36px));
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(23, 23, 23, 0.1);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: var(--sun);
  color: var(--ink);
  font-weight: 900;
  box-shadow: 4px 4px 0 #171717;
}

.brand strong {
  display: block;
  font-size: 18px;
  line-height: 1.05;
}

.brand small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.account {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-height: 40px;
}

.top-links {
  display: none;
}

.top-links a,
.auth-policy a {
  color: var(--green-dark);
  font-weight: 900;
  text-decoration: none;
}

.top-links a:hover,
.auth-policy a:hover {
  text-decoration: underline;
}

.identity-card {
  display: grid;
  min-width: 160px;
  border: 1px solid #171717;
  border-radius: var(--radius);
  background: #ffffff;
  padding: 7px 10px;
}

.identity-card strong {
  overflow-wrap: anywhere;
  font-size: 14px;
}

.identity-card span {
  color: var(--muted);
  font-size: 11px;
}

.notification-card {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffaf0;
  padding: 12px;
}

.notification-card strong {
  display: block;
  margin-bottom: 3px;
  font-size: 13px;
}

.notification-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.notification-actions {
  display: grid;
  gap: 8px;
}

.notification-actions button {
  min-height: 36px;
  padding: 0 10px;
  font-size: 13px;
}

.notify-enable {
  display: inline-flex;
  height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid #171717;
  border-radius: var(--radius);
  background: var(--sun);
  color: var(--ink);
  box-shadow: 3px 3px 0 #171717;
  font-weight: 900;
  white-space: nowrap;
}

.notify-enable:hover {
  background: #ffd966;
  transform: translate(1px, 1px);
  box-shadow: 2px 2px 0 #171717;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 392px;
  gap: 24px;
  padding: 22px 0 32px;
}

.rooms-panel,
.side-panel {
  min-width: 0;
  min-height: calc(100vh - 96px);
}

.rooms-panel {
  padding: 24px;
  border: 2px solid #171717;
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.side-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.room-filters {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px;
  min-width: 0;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffdf8;
  padding: 10px;
}

.filter-chips {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  min-width: 0;
  gap: 8px;
}

.filter-chips button {
  display: inline-flex;
  width: 100%;
  min-width: 0;
  min-height: 30px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  padding: 0 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.filter-chips button.active {
  border-color: #171717;
  background: #eef9f2;
  color: var(--green-dark);
}

.filter-toggle {
  display: inline-flex;
  grid-column: 1;
  grid-row: 2;
  align-items: center;
  justify-self: end;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.filter-toggle input {
  width: 16px;
  height: 16px;
  margin: 0;
}

.room-filters select {
  grid-column: 2;
  grid-row: 2;
  width: 132px;
  height: 34px;
  margin: 0;
  border: 1px solid #171717;
  border-radius: var(--radius);
  background: #ffffff;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 900;
}

.active-room-section {
  display: grid;
  gap: 10px;
  margin: 0 0 14px;
  border: 1px solid #171717;
  border-radius: var(--radius);
  background: #fffaf0;
  padding: 12px;
}

.active-room-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.active-room-head h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
}

.active-room-head > span {
  display: inline-flex;
  min-width: 38px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border: 1px solid #171717;
  border-radius: 999px;
  background: var(--sun);
  font-size: 12px;
  font-weight: 900;
}

.active-room-section > p {
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.active-room-list {
  display: grid;
  gap: 8px;
}

.active-room-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  padding: 10px;
}

.active-room-card.active {
  border-color: #171717;
  box-shadow: 4px 4px 0 var(--green);
}

.active-room-main {
  display: grid;
  min-width: 0;
  justify-items: start;
  gap: 5px;
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--ink);
  text-align: left;
}

.active-room-main strong {
  overflow-wrap: anywhere;
  font-size: 15px;
  line-height: 1.3;
}

.active-room-main small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.4;
}

.active-room-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.active-room-actions .primary,
.active-room-actions .secondary {
  height: 36px;
  padding: 0 12px;
  font-size: 13px;
}

.section-head.tight {
  margin-bottom: 8px;
}

.section-copy {
  max-width: 520px;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.section-copy.small {
  max-width: 300px;
  font-size: 13px;
}

.hero-intro {
  display: grid;
  gap: 6px;
  margin: 14px 0 16px;
  border: 1px solid rgba(22, 138, 84, 0.24);
  border-left: 4px solid var(--green);
  border-radius: var(--radius);
  background: #fffdf8;
  padding: 13px 14px;
}

.hero-intro h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.3;
}

.hero-copyline {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.4;
}

.hero-intro p:last-child {
  margin: 0;
  max-width: 720px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--green-dark);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
}

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

h1,
h2 {
  margin-bottom: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(34px, 4vw, 50px);
  line-height: 1;
}

h2 {
  font-size: 19px;
}

.live-count,
.ttl {
  display: inline-flex;
  min-width: 54px;
  height: 32px;
  align-items: center;
  justify-content: center;
  border: 1px solid #171717;
  border-radius: 999px;
  background: var(--sun);
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.room-list {
  display: grid;
  gap: 10px;
}

.room-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 16px;
  border: 1px solid #171717;
  border-radius: var(--radius);
  background: var(--panel-strong);
  transition:
    border-color 0.16s ease,
    transform 0.16s ease,
    box-shadow 0.16s ease;
}

.room-card:hover {
  border-color: #171717;
  box-shadow: 5px 5px 0 #171717;
  transform: translate(-2px, -2px);
}

.room-card.active {
  border-color: #171717;
  box-shadow: 5px 5px 0 var(--green);
}

.room-card-skeleton {
  pointer-events: none;
}

.skeleton-line,
.skeleton-button {
  position: relative;
  overflow: hidden;
  border-radius: 999px;
  background: #efe8dc;
}

.skeleton-line::after,
.skeleton-button::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.72), transparent);
  animation: skeleton-shimmer 1.15s ease-in-out infinite;
}

.skeleton-line.chips {
  width: min(240px, 70%);
  height: 24px;
}

.skeleton-line.title {
  width: min(340px, 84%);
  height: 24px;
  margin-top: 11px;
}

.skeleton-line.meta {
  width: min(190px, 55%);
  height: 16px;
  margin-top: 10px;
}

.skeleton-button {
  width: 94px;
  height: 42px;
  border-radius: var(--radius);
}

@keyframes skeleton-shimmer {
  100% {
    transform: translateX(100%);
  }
}

.ad-slot {
  display: grid;
  min-height: 104px;
  place-items: center;
  gap: 4px;
  border: 1px dashed rgba(23, 23, 23, 0.32);
  border-radius: var(--radius);
  background: rgba(255, 253, 247, 0.72);
  color: var(--muted);
  padding: 14px;
  text-align: center;
}

.ad-slot span {
  display: inline-grid;
  min-width: 36px;
  height: 24px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  font-size: 11px;
  font-weight: 900;
}

.ad-slot strong {
  color: var(--ink);
  font-size: 14px;
}

.ad-slot small {
  font-size: 12px;
}

.room-main {
  min-width: 0;
}

.room-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 8px;
}

.pill {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border: 1px solid rgba(23, 23, 23, 0.16);
  border-radius: 999px;
  padding: 2px 9px;
  background: #f9f7f2;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.pill.hot {
  border-color: rgba(232, 95, 63, 0.3);
  background: #fff1eb;
  color: var(--coral);
}

.pill.green {
  border-color: rgba(22, 138, 84, 0.25);
  background: #eef9f2;
  color: var(--green-dark);
}

.pill.mine {
  border-color: #171717;
  background: var(--sun);
  color: var(--ink);
}

.pill.wait {
  border-color: rgba(184, 121, 19, 0.32);
  background: #fff6d7;
  color: var(--amber);
}

.pill.alert {
  border-color: rgba(232, 95, 63, 0.36);
  background: #ffece6;
  color: #b63d22;
}

.pill.done {
  border-color: rgba(23, 23, 23, 0.18);
  background: #f0eee8;
  color: var(--muted);
}

.pill.blocked {
  border-color: rgba(168, 64, 37, 0.25);
  background: #fff3ef;
  color: #a74025;
}

.room-note {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.35;
}

.room-host {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.room-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.room-actions .primary,
.room-actions .secondary {
  min-width: 96px;
}

.create-form,
.empty-state,
.profile-card {
  border: 1px solid #171717;
  border-radius: var(--radius);
  background: var(--panel-strong);
}

.create-form {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.create-form.is-busy {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(22, 138, 84, 0.1);
}

.create-form-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
}

.create-form-head h2 {
  margin: 0;
  font-size: 21px;
  line-height: 1.2;
}

.create-form-head .section-copy {
  margin-top: 6px;
}

.button-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.46);
  border-top-color: #ffffff;
  border-radius: 999px;
  animation: spin 0.72s linear infinite;
}

.create-status {
  margin: -4px 0 0;
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.profile-card {
  padding: 16px;
}

.profile-top {
  display: block;
}

.profile-top h2 {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 20px;
  line-height: 1.25;
}

.display-name {
  display: inline-flex;
  min-width: 0;
  align-items: baseline;
  gap: 6px;
  vertical-align: baseline;
}

.display-name > span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.display-name small {
  color: var(--muted);
  font-size: 0.78em;
  font-weight: 800;
  white-space: nowrap;
}

.display-name.compact small {
  font-size: 0.76em;
}

.profile-top span,
.profile-empty p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 14px;
}

.profile-grid div {
  display: grid;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #faf8f3;
  padding: 9px;
}

.profile-grid strong {
  color: var(--ink);
  font-size: 16px;
}

.profile-grid span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.profile-line {
  margin: 12px 0 0;
  border: 1px solid rgba(22, 138, 84, 0.24);
  border-radius: var(--radius);
  background: #eef9f2;
  padding: 10px;
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.4;
}

.profile-empty h2 {
  margin-bottom: 6px;
}

.profile-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.profile-tags span {
  border: 1px solid rgba(23, 23, 23, 0.14);
  border-radius: 999px;
  background: #f9f7f2;
  color: var(--muted);
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 800;
}

label,
legend {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  margin-top: 7px;
  border: 1px solid #bfb6a8;
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--ink);
  padding: 0 12px;
  outline: none;
}

input,
select {
  height: 42px;
}

textarea {
  min-height: 118px;
  padding: 11px 12px;
  resize: vertical;
  line-height: 1.5;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(22, 138, 84, 0.15);
}

input.field-error,
select.field-error,
textarea.field-error {
  border-color: var(--coral);
  background: #fff8f5;
  box-shadow: 0 0 0 3px rgba(232, 95, 63, 0.14);
}

.field-hint {
  color: #b63d22;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.request-hint {
  grid-column: 1 / -1;
}

.field-note {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}

fieldset {
  margin: 0;
  border: 0;
  padding: 0;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 7px;
}

.segmented label {
  min-width: 0;
}

.segmented input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.segmented span {
  display: grid;
  height: 40px;
  place-items: center;
  border: 1px solid #bfb6a8;
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
}

.segmented input:checked + span {
  border-color: #171717;
  background: #eaf8ef;
  color: var(--green-dark);
  box-shadow: inset 0 0 0 1px var(--green);
}

.primary,
.secondary,
.ghost,
.danger,
.google-button {
  display: inline-flex;
  height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius);
  padding: 0 14px;
  border: 1px solid transparent;
  font-weight: 900;
  white-space: nowrap;
}

.primary {
  border-color: #171717;
  background: var(--green);
  color: #ffffff;
  box-shadow: 3px 3px 0 #171717;
}

.primary:hover {
  background: var(--green-dark);
  transform: translate(1px, 1px);
  box-shadow: 2px 2px 0 #171717;
}

.secondary {
  border-color: #171717;
  background: #ffffff;
  color: var(--ink);
}

.secondary:hover {
  background: #fff6d7;
}

.ghost {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

.ghost:hover {
  background: rgba(23, 23, 23, 0.05);
  color: var(--ink);
}

.danger {
  border-color: #171717;
  background: #fff3ef;
  color: #b63d22;
}

button:disabled:hover,
.primary:disabled:hover,
.secondary:disabled:hover,
.ghost:disabled:hover,
.danger:disabled:hover,
.google-button:disabled:hover {
  transform: none;
  box-shadow: none;
}

.primary:disabled:hover {
  background: var(--green);
}

.secondary:disabled:hover,
.google-button:disabled:hover {
  background: #ffffff;
}

.full {
  width: 100%;
}

.detail-note {
  margin-bottom: 14px;
  color: var(--muted);
  line-height: 1.5;
}

.detail-status {
  display: grid;
  gap: 4px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #faf8f3;
  padding: 11px 12px;
}

.detail-status.host {
  border-color: rgba(22, 138, 84, 0.28);
  background: #eef9f2;
}

.detail-status.wait {
  border-color: rgba(184, 121, 19, 0.28);
  background: #fff6d7;
}

.detail-status.danger {
  border-color: rgba(232, 95, 63, 0.34);
  background: #fff3ef;
}

.detail-status strong {
  font-size: 14px;
}

.detail-status span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.pinned-notice {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(22, 138, 84, 0.28);
  border-radius: var(--radius);
  background: #eef9f2;
  padding: 11px 12px;
}

.pinned-notice strong {
  font-size: 13px;
}

.pinned-notice span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.pinned-form {
  display: grid;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffdf8;
  padding: 10px;
}

.pinned-form > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.pinned-form input {
  margin: 0;
}

.pinned-form button {
  height: 42px;
}

.divider {
  height: 1px;
  margin: 14px 0;
  background: var(--line);
}

.people-list,
.request-list {
  display: grid;
  gap: 8px;
  margin: 8px 0 0;
}

.subhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.subhead span {
  display: inline-flex;
  min-width: 28px;
  height: 24px;
  align-items: center;
  justify-content: center;
  border: 1px solid #171717;
  border-radius: 999px;
  background: var(--sun);
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.person,
.request-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 10px;
  background: #faf8f3;
}

.person-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.person strong,
.request-item strong {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.request-item small,
.person small {
  color: var(--muted);
}

.request-actions {
  display: flex;
  gap: 6px;
}

.mini-button {
  height: 32px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  color: var(--ink);
  font-weight: 900;
}

.mini-button.accept {
  border-color: rgba(22, 138, 84, 0.3);
  color: var(--green-dark);
}

.mini-button.reject,
.mini-button.kick {
  border-color: rgba(232, 95, 63, 0.3);
  color: #a74025;
}

.mini-button.report {
  border-color: rgba(184, 121, 19, 0.35);
  color: #8b4f00;
}

.mini-button.start {
  border-color: #171717;
  background: var(--sun);
  color: var(--ink);
}

.chat {
  display: grid;
  gap: 10px;
}

.chat label {
  color: var(--ink);
  font-size: 15px;
}

.chat-head,
.chat-room-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.chat-head strong,
.chat-room-title strong {
  display: block;
  color: var(--ink);
  font-size: 15px;
}

.chat-head span,
.chat-room-title span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.messages {
  display: grid;
  max-height: 240px;
  overflow: auto;
  gap: 7px;
  padding-right: 4px;
}

.message {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  max-width: 92%;
  border-radius: var(--radius);
  padding: 9px 10px;
  background: #f0eee8;
}

.message.mine {
  justify-self: end;
  flex-direction: row-reverse;
  background: #e5f5eb;
}

.message.system {
  display: block;
  justify-self: center;
  max-width: 100%;
  background: transparent;
  color: var(--muted);
  padding: 3px 0;
  font-size: 12px;
}

.message strong {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 3px;
  font-size: 12px;
}

.message time {
  display: inline-flex;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.message.system time {
  margin-right: 6px;
}

.message div > span {
  display: block;
  overflow-wrap: anywhere;
  line-height: 1.45;
}

.chat-form,
.request-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.chat-form input,
.request-form input {
  min-width: 0;
  margin: 0;
}

.compact-chat {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffdf8;
  padding: 12px;
}

.compact-messages {
  min-height: 96px;
  max-height: 150px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  padding: 10px;
}

.chat-send-hint {
  grid-column: 1 / -1;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.empty-state {
  padding: 28px 18px;
  text-align: center;
}

.empty-state h3 {
  margin-bottom: 7px;
}

.empty-state p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.compact-only {
  display: none;
}

.auth-gate {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(246, 244, 239, 0.88);
  z-index: 50;
}

.site-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 18px;
  border-top: 1px solid rgba(23, 23, 23, 0.12);
  padding: 18px 0 26px;
  color: var(--muted);
  font-size: 13px;
}

.site-footer div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.site-footer strong {
  color: var(--ink);
}

.site-footer a {
  color: var(--green-dark);
  font-weight: 900;
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

.auth-gate[hidden] {
  display: none;
}

.profile-gate,
.profile-viewer,
.report-overlay,
.feedback-overlay {
  position: fixed;
  inset: 0;
  z-index: 48;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(246, 244, 239, 0.9);
}

.profile-gate[hidden],
.profile-viewer[hidden],
.report-overlay[hidden],
.feedback-overlay[hidden] {
  display: none;
}

.profile-dialog,
.mini-profile,
.report-dialog,
.feedback-dialog {
  width: min(520px, 100%);
  max-height: min(760px, calc(100vh - 40px));
  overflow: auto;
  border: 2px solid #171717;
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: 8px 8px 0 #171717;
  padding: 22px;
}

.report-dialog {
  width: min(500px, 100%);
}

.feedback-dialog {
  width: min(540px, 100%);
}

.report-form {
  display: grid;
  gap: 12px;
}

.feedback-form {
  display: grid;
  gap: 12px;
}

.report-form label {
  display: grid;
  gap: 7px;
}

.feedback-form label {
  display: grid;
  gap: 7px;
}

.report-form select,
.report-form textarea,
.feedback-form input,
.feedback-form textarea {
  margin: 0;
}

.report-form textarea {
  resize: vertical;
}

.feedback-categories {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.feedback-categories button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--ink);
  font-weight: 900;
}

.feedback-categories button.active {
  border-color: #171717;
  background: #fff6d7;
  box-shadow: 3px 3px 0 #171717;
}

.dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.dialog-head h2 {
  margin: 0;
  font-size: 25px;
  line-height: 1.2;
}

.dialog-copy {
  margin-bottom: 16px;
  color: var(--muted);
  line-height: 1.55;
}

.profile-form {
  display: grid;
  gap: 12px;
}

.profile-form label {
  display: grid;
  gap: 7px;
}

.profile-form input,
.profile-form select {
  margin-top: 0;
}

.profile-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.profile-top.compact {
  grid-template-columns: auto minmax(0, 1fr);
}

.mini-profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.mini-profile-grid div {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #faf8f3;
  padding: 10px;
}

.mini-profile-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.mini-profile-grid strong {
  overflow-wrap: anywhere;
  font-size: 15px;
}

.mini-profile-bio {
  margin: 12px 0 0;
  border: 1px solid rgba(22, 138, 84, 0.24);
  border-radius: var(--radius);
  background: #eef9f2;
  color: var(--green-dark);
  padding: 11px;
  line-height: 1.5;
}

.room-overlay,
.chat-overlay {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: grid;
  place-items: center;
  padding:
    max(28px, env(safe-area-inset-top))
    max(28px, env(safe-area-inset-right))
    max(28px, env(safe-area-inset-bottom))
    max(28px, env(safe-area-inset-left));
  background: rgba(23, 23, 23, 0.2);
}

.room-overlay {
  z-index: 44;
  background: rgba(246, 244, 239, 0.78);
}

.room-overlay[hidden],
.chat-overlay[hidden] {
  display: none;
}

.room-modal,
.chat-modal {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(920px, 100%);
  height: min(720px, calc(100dvh - 56px));
  border: 2px solid #171717;
  border-radius: var(--radius);
  background: var(--panel-strong);
  box-shadow: 12px 12px 0 #171717;
  overflow: hidden;
}

.room-modal {
  width: min(780px, 100%);
  height: auto;
  max-height: min(720px, calc(100dvh - 56px));
  overflow: auto;
}

.chat-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid #171717;
  background: #fffdf7;
  padding: 18px;
}

.chat-modal-head h2 {
  margin: 6px 0 5px;
  font-size: 26px;
  line-height: 1.2;
}

.chat-modal-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.chat-head-actions {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.mobile-chat-action {
  display: none;
}

.icon-button {
  width: 40px;
  min-width: 40px;
  padding: 0;
  font-size: 24px;
  line-height: 1;
}

.chat-modal-body {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: 0;
}

.room-modal-body {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.modal-section,
.modal-actions {
  display: grid;
  gap: 10px;
}

.chat-people {
  display: grid;
  align-content: start;
  gap: 8px;
  border-right: 1px solid var(--line);
  background: #faf8f3;
  padding: 16px;
}

.chat-people > strong {
  margin-bottom: 4px;
  font-size: 14px;
}

.chat-person {
  display: grid;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  padding: 10px;
}

.chat-person span {
  overflow-wrap: anywhere;
  font-weight: 900;
}

.chat-person small {
  color: var(--muted);
}

.chat-room {
  display: flex;
  flex-direction: column;
  min-height: 0;
  gap: 12px;
  padding: 16px;
}

.chat-state-banner {
  display: grid;
  gap: 3px;
  border: 1px solid rgba(22, 138, 84, 0.28);
  border-radius: var(--radius);
  background: #eef9f2;
  padding: 10px 12px;
}

.chat-state-banner strong {
  font-size: 13px;
}

.chat-state-banner span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.chat-action-notice {
  display: grid;
  border: 1px solid rgba(23, 23, 23, 0.18);
  border-radius: var(--radius);
  background: #fff7d6;
  color: var(--ink);
  padding: 10px 12px;
}

.chat-action-notice strong {
  font-size: 13px;
  line-height: 1.45;
}

.chat-action-notice.success {
  border-color: rgba(22, 138, 84, 0.3);
  background: #e8f7ee;
  color: var(--green-dark);
}

.chat-action-notice.error {
  border-color: rgba(232, 95, 63, 0.35);
  background: #fff0eb;
  color: #a74025;
}

.chat-request-panel {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(184, 121, 19, 0.3);
  border-radius: var(--radius);
  background: #fffaf0;
  padding: 12px;
}

.chat-request-panel .detail-status {
  margin-bottom: 0;
}

.chat-requests {
  display: grid;
  gap: 8px;
}

.chat-request-panel .request-list {
  max-height: 164px;
  overflow: auto;
}

.chat-request-panel .request-item {
  background: #ffffff;
}

.modal-messages {
  flex: 1 1 auto;
  align-content: start;
  max-height: none;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffdf8;
  padding: 14px;
}

.modal-chat-form {
  grid-template-columns: minmax(0, 1fr) auto;
}

.modal-chat-form .chat-input-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.auth-card {
  position: relative;
  width: min(390px, 100%);
  max-height: min(720px, calc(100vh - 40px));
  overflow: auto;
  border: 2px solid #171717;
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: 8px 8px 0 #171717;
  padding: 26px 24px;
  text-align: center;
}

.auth-close {
  position: absolute;
  top: 14px;
  right: 14px;
}

.auth-brand {
  justify-content: center;
  margin-bottom: 18px;
}

.auth-card h2 {
  margin-bottom: 9px;
  font-size: 25px;
  line-height: 1.22;
}

.manner-quote {
  margin: 0 auto 16px;
  border: 1px solid rgba(23, 23, 23, 0.22);
  border-radius: var(--radius);
  background: #fff6d7;
  padding: 10px 14px;
  color: var(--ink);
  font-weight: 900;
  line-height: 1.45;
  text-align: center;
}

.auth-copy {
  margin: 0 auto 20px;
  color: var(--muted);
  line-height: 1.45;
  max-width: 300px;
}

.auth-card form {
  display: grid;
  gap: 14px;
  text-align: left;
}

.auth-card form label {
  display: grid;
  gap: 7px;
}

.auth-card form input {
  margin-top: 0;
}

.login-actions {
  display: grid;
  gap: 18px;
}

.login-actions form {
  margin: 0;
}

.stack-form {
  display: grid;
  gap: 10px;
}

.inline-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(110px, 0.5fr);
  gap: 8px;
}

.account-hint-form {
  border-top: 1px solid rgba(22, 138, 84, 0.18);
  margin-top: 2px;
  padding-top: 10px;
}

@media (max-width: 520px) {
  .inline-fields {
    grid-template-columns: 1fr;
  }
}

.email-verify-panel {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(22, 138, 84, 0.28);
  border-radius: var(--radius);
  background: #effaf4;
  padding: 13px;
  text-align: left;
}

.email-verify-panel strong {
  color: var(--green-dark);
  font-size: 14px;
  line-height: 1.35;
}

.email-verify-panel span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
}

.email-verify-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.email-verify-actions button {
  min-height: 38px;
  padding: 0 12px;
}

.auth-mode-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #faf8f3;
  padding: 4px;
}

.auth-mode-toggle button {
  min-height: 38px;
  border: 1px solid transparent;
  box-shadow: none;
  background: transparent;
  color: var(--muted);
}

.auth-mode-toggle button.active {
  border-color: #171717;
  background: #fff6d7;
  color: var(--ink);
  box-shadow: 3px 3px 0 #171717;
}

.auth-policy {
  margin: 16px auto 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  max-width: 300px;
  text-align: center;
}

.auth-warning {
  border: 1px solid rgba(232, 95, 63, 0.28);
  border-radius: var(--radius);
  background: #fff3ef;
  color: #9b351d;
  padding: 11px 12px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
  text-align: left;
}

.inapp-browser-warning {
  display: grid;
  gap: 8px;
  margin: 0 0 16px;
  border: 1px solid rgba(184, 121, 19, 0.36);
  border-radius: var(--radius);
  background: #fff8e7;
  padding: 12px;
  text-align: left;
}

.inapp-browser-warning strong {
  color: var(--ink);
  font-size: 14px;
}

.inapp-browser-warning span,
.inapp-browser-warning small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.inapp-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.inapp-actions button {
  min-height: 40px;
  padding: 0 12px;
}

.google-button {
  width: 100%;
  min-height: 42px;
  border-color: #171717;
  background: #ffffff;
  color: var(--ink);
  text-decoration: none;
}

.google-button:hover {
  background: #fff6d7;
}

.feedback-fab {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 42;
  height: 46px;
  border: 2px solid #171717;
  border-radius: 999px;
  background: var(--sun);
  color: var(--ink);
  box-shadow: 5px 5px 0 #171717;
  padding: 0 18px;
  font-size: 14px;
  font-weight: 950;
}

.feedback-fab:hover {
  transform: translate(1px, 1px);
  box-shadow: 4px 4px 0 #171717;
}

.google-g {
  display: inline-grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--blue);
  font-weight: 900;
}

.host-request-alert {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 70;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  width: min(420px, calc(100% - 32px));
  border: 2px solid #171717;
  border-radius: var(--radius);
  background: #fff6d7;
  box-shadow: 8px 8px 0 #171717;
  padding: 16px;
  animation: alertPop 0.18s ease-out;
}

.host-request-alert > div:first-child {
  display: grid;
  gap: 4px;
}

.host-request-alert strong {
  font-size: 18px;
  line-height: 1.2;
}

.host-request-alert span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.host-request-alert small {
  display: -webkit-box;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.host-request-alert-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.host-request-alert-actions .primary {
  min-height: 42px;
  padding: 0 16px;
  white-space: nowrap;
}

.host-request-alert-actions .danger-soft {
  border-color: rgba(232, 95, 63, 0.45);
  background: #fff0eb;
  color: #a74025;
}

@keyframes alertPop {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  z-index: 60;
  transform: translateX(-50%) translateY(20px);
  max-width: min(460px, calc(100% - 32px));
  border: 1px solid #171717;
  border-radius: var(--radius);
  background: #171717;
  color: #ffffff;
  padding: 12px 14px;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.policy-shell {
  width: min(880px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.policy-card {
  margin-top: 22px;
  border: 2px solid #171717;
  border-radius: var(--radius);
  background: var(--panel-strong);
  box-shadow: var(--shadow);
  padding: 28px;
}

.policy-card h1 {
  margin-bottom: 12px;
}

.policy-lead {
  border: 1px solid #171717;
  border-radius: var(--radius);
  background: linear-gradient(90deg, #fff6d7, #eaf8ef);
  padding: 14px;
  color: var(--ink);
  font-weight: 800;
  line-height: 1.55;
}

.policy-card section {
  border-top: 1px solid var(--line);
  padding-top: 18px;
  margin-top: 18px;
}

.policy-card section h2 {
  margin-bottom: 8px;
  font-size: 20px;
}

.policy-card section p {
  margin-bottom: 8px;
  color: var(--muted);
  line-height: 1.65;
}

.admin-shell {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding-bottom: 48px;
}

.admin-entry-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 28px 16px;
}

.admin-entry-card {
  display: grid;
  width: min(440px, 100%);
  gap: 14px;
  border: 2px solid #171717;
  border-radius: var(--radius);
  background: var(--panel-strong);
  box-shadow: var(--shadow);
  padding: 24px;
}

.admin-entry-card h1 {
  font-size: 32px;
}

.admin-entry-card p {
  color: var(--muted);
  line-height: 1.5;
}

.admin-entry-form {
  display: grid;
  gap: 8px;
}

.admin-entry-form label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.admin-entry-form input {
  height: 46px;
  border: 1px solid #171717;
  border-radius: var(--radius);
  background: #ffffff;
  padding: 0 12px;
  font-weight: 900;
}

.admin-entry-error {
  border: 1px solid rgba(232, 95, 63, 0.45);
  border-radius: var(--radius);
  background: #fff3ef;
  color: #a74025 !important;
  padding: 10px 12px;
  font-weight: 900;
}

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
  border-bottom: 1px solid rgba(23, 23, 23, 0.1);
}

.admin-key-form {
  display: flex;
  gap: 8px;
}

.admin-topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-key-form input {
  width: 220px;
  height: 40px;
  border: 1px solid #171717;
  border-radius: var(--radius);
  background: #ffffff;
  padding: 0 12px;
  font-weight: 800;
}

.admin-workspace {
  display: grid;
  gap: 18px;
  padding-top: 22px;
}

.admin-hero,
.admin-card,
.admin-empty,
.admin-stats > div {
  border: 1px solid #171717;
  border-radius: var(--radius);
  background: var(--panel-strong);
}

.admin-hero {
  padding: 22px;
  box-shadow: var(--shadow);
}

.admin-hero h1 {
  font-size: clamp(32px, 4vw, 48px);
}

.admin-hero p {
  max-width: 720px;
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.admin-hero small {
  display: inline-flex;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff6d7;
  padding: 6px 10px;
  font-weight: 900;
}

.admin-empty {
  padding: 22px;
}

.admin-empty p,
.admin-muted {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

.admin-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px 96px;
  gap: 8px;
  align-items: stretch;
  border: 1px solid #171717;
  border-radius: var(--radius);
  background: var(--panel-strong);
  padding: 12px;
}

.admin-tools input,
.admin-tools select,
.admin-tools button {
  height: 40px;
  min-height: 40px;
  align-self: stretch;
  margin: 0;
}

.admin-tools input,
.admin-tools select {
  border: 1px solid #171717;
  border-radius: var(--radius);
  background: #ffffff;
  padding: 0 12px;
  font-weight: 800;
}

.admin-tools button {
  width: 100%;
  padding: 0 12px;
  line-height: 1;
}

.admin-stats > div {
  display: grid;
  gap: 2px;
  padding: 14px;
}

.admin-stats strong {
  font-size: 24px;
}

.admin-stats span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.admin-stats .is-danger {
  border-color: rgba(232, 95, 63, 0.55);
  background: #fff3ef;
}

.admin-stats .is-warn {
  border-color: rgba(184, 121, 19, 0.45);
  background: #fff8e7;
}

.admin-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  border: 1px solid #171717;
  border-radius: var(--radius);
  background: var(--panel-strong);
  padding: 8px;
}

.admin-tabs button {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
}

.admin-tabs button.active {
  border-color: #171717;
  background: #fff6d7;
  color: var(--ink);
  box-shadow: 2px 2px 0 #171717;
}

.admin-tabs strong {
  display: inline-flex;
  min-width: 24px;
  height: 22px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  font-size: 12px;
}

.admin-alert {
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid #171717;
  border-radius: var(--radius);
  background: #fff3ef;
  padding: 14px;
}

.admin-alert.calm {
  background: #eaf8ef;
}

.admin-alert strong {
  font-size: 16px;
}

.admin-alert span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 18px;
  align-items: start;
}

.admin-grid > div,
.admin-grid > aside {
  display: grid;
  gap: 18px;
}

.admin-overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 18px;
  align-items: start;
}

.admin-overview-grid > div,
.admin-overview-grid > aside {
  display: grid;
  gap: 18px;
}

.admin-overview-stack {
  display: grid;
  gap: 18px;
}

.admin-card {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.admin-card-head,
.admin-report-top,
.admin-user {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.admin-card h2 {
  font-size: 20px;
}

.admin-report-list,
.admin-user-list,
.admin-table {
  display: grid;
  gap: 10px;
}

.admin-report,
.admin-user,
.admin-table > div {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffdf7;
  padding: 12px;
}

.admin-report.resolved {
  opacity: 0.68;
}

.admin-feedback-message {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  padding: 11px 12px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 750;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.admin-report-top strong,
.admin-user strong,
.admin-table strong {
  display: block;
  font-size: 15px;
}

.admin-report-top span,
.admin-user span,
.admin-user small,
.admin-table span,
.admin-table small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.admin-room-closed {
  display: grid;
  gap: 3px;
  margin-top: 10px;
  border: 1px solid rgba(232, 95, 63, 0.28);
  border-radius: var(--radius);
  background: #fff3ef;
  padding: 9px 10px;
}

.admin-room-closed strong {
  color: #a74025;
  font-size: 12px;
}

.admin-room-closed span {
  margin: 0;
  color: #7b4a3a;
}

.admin-status {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  padding: 5px 9px;
  color: var(--ink) !important;
  font-size: 12px;
  font-weight: 900;
}

.admin-status.calm {
  border-color: rgba(17, 138, 84, 0.28);
  background: #eaf8ef;
  color: var(--green-dark) !important;
}

.admin-status.danger {
  border-color: rgba(232, 95, 63, 0.45);
  background: #fff3ef;
  color: #a74025 !important;
}

.admin-user strong .admin-status {
  display: inline-flex;
  margin-left: 6px;
  vertical-align: middle;
}

.admin-report-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.admin-report-grid > div {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  padding: 10px;
}

.admin-report-grid label {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.admin-report-grid strong,
.admin-report-grid span {
  display: block;
  overflow-wrap: anywhere;
  font-size: 13px;
}

.admin-report-grid span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.admin-messages {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #faf8f3;
  padding: 10px;
}

.admin-messages summary {
  cursor: pointer;
  font-weight: 900;
}

.admin-messages p {
  display: grid;
  gap: 2px;
  margin: 8px 0 0;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.admin-messages p strong {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}

.admin-messages p.target {
  border-color: rgba(232, 95, 63, 0.25);
  background: #fff3ef;
  margin-right: -4px;
  margin-left: -4px;
  padding-right: 8px;
  padding-left: 8px;
}

.admin-messages p em {
  border: 1px solid rgba(232, 95, 63, 0.3);
  border-radius: 999px;
  background: #ffffff;
  color: #a74025;
  padding: 2px 6px;
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
}

.admin-messages p time {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.admin-messages p span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.admin-actions button {
  min-height: 36px;
  height: 36px;
  font-size: 12px;
}

.admin-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #faf8f3;
  padding: 9px 10px;
}

.admin-pagination span,
.admin-pagination strong {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.admin-pagination div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-pagination button {
  height: 34px;
  min-height: 34px;
  padding: 0 10px;
  font-size: 12px;
}

.admin-tool-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.admin-tool-grid button {
  min-height: 42px;
}

.danger.soft {
  background: #fff8e7;
  color: #8b4f00;
}

@media (max-width: 880px) {
  .app-shell {
    width: min(640px, calc(100% - 20px));
  }

  .workspace {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .rooms-panel,
  .side-panel {
    min-height: auto;
  }

  .site-footer {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .admin-topbar,
  .admin-card-head,
  .admin-report-top,
  .admin-user {
    flex-direction: column;
  }

  .admin-key-form,
  .admin-key-form input,
  .admin-topbar-actions,
  .admin-topbar-actions form {
    width: 100%;
  }

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

  .admin-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .admin-tabs {
    grid-template-columns: 1fr 1fr;
  }

  .admin-tools {
    grid-template-columns: 1fr;
  }

  .admin-grid,
  .admin-overview-grid {
    grid-template-columns: 1fr;
  }

  .admin-alert {
    grid-template-columns: 1fr;
  }

  .admin-report-grid {
    grid-template-columns: 1fr;
  }

  .admin-actions {
    justify-content: stretch;
  }

  .admin-actions button {
    flex: 1;
  }

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

  .admin-pagination div {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
  }

  .admin-tool-grid {
    grid-template-columns: 1fr;
  }

  .compact-only {
    display: block;
    margin-bottom: 12px;
  }

  .room-card {
    grid-template-columns: 1fr;
  }

  .active-room-card {
    grid-template-columns: 1fr;
  }

  .active-room-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .room-actions {
    align-items: stretch;
  }

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

  .account {
    flex-wrap: wrap;
  }

  .room-overlay,
  .chat-overlay {
    padding:
      max(10px, env(safe-area-inset-top))
      max(10px, env(safe-area-inset-right))
      max(10px, env(safe-area-inset-bottom))
      max(10px, env(safe-area-inset-left));
  }

  .room-modal,
  .chat-modal {
    box-shadow: 5px 5px 0 #171717;
  }

  .chat-modal {
    height: calc(100dvh - 20px);
  }

  .room-modal {
    max-height: calc(100dvh - 20px);
  }

  .chat-modal-body {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .chat-people {
    display: flex;
    align-items: center;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 12px;
  }

  .chat-people > strong {
    flex: 0 0 auto;
    align-self: center;
    margin: 0;
  }

  .chat-person {
    min-width: 118px;
    padding: 8px 10px;
  }
}

@media (max-width: 520px) {
  .chat-overlay {
    place-items: stretch;
    padding: 0;
    background: #f6f4ef;
    overscroll-behavior: contain;
  }

  .chat-modal {
    width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: #fffdf8;
  }

  .chat-modal-head {
    min-height: 112px;
    align-items: flex-start;
    gap: 10px;
    padding:
      max(12px, env(safe-area-inset-top))
      max(12px, env(safe-area-inset-right))
      10px
      max(12px, env(safe-area-inset-left));
    background: #fffdf8;
  }

  .chat-modal-head > div:first-child {
    min-width: 0;
  }

  .chat-modal-head .room-meta {
    gap: 5px;
    margin-bottom: 4px;
  }

  .chat-modal-head .pill {
    height: 24px;
    padding: 0 8px;
    font-size: 11px;
  }

  .chat-modal-head h2 {
    display: -webkit-box;
    overflow: hidden;
    margin: 4px 0 3px;
    font-size: 19px;
    line-height: 1.22;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .chat-modal-head p {
    overflow: hidden;
    max-width: 100%;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .chat-head-actions {
    align-items: center;
    flex: 0 0 auto;
    gap: 6px;
  }

  .mobile-chat-action {
    display: inline-flex;
    height: 40px;
    align-items: center;
    border-color: #171717;
    background: #ffffff;
    white-space: nowrap;
  }

  .chat-head-actions .icon-button {
    width: 40px;
    min-width: 40px;
    height: 40px;
  }

  .chat-modal-body {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    min-height: 0;
    overflow: hidden;
  }

  .chat-people {
    gap: 6px;
    min-height: 54px;
    padding: 8px max(10px, env(safe-area-inset-right)) 8px max(10px, env(safe-area-inset-left));
    background: #faf8f3;
    scrollbar-width: none;
  }

  .chat-people::-webkit-scrollbar {
    display: none;
  }

  .chat-people > strong {
    position: sticky;
    left: 0;
    z-index: 1;
    height: 32px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fffdf8;
    padding: 7px 10px;
    font-size: 12px;
    white-space: nowrap;
  }

  .chat-person {
    grid-template-columns: minmax(0, 1fr) auto;
    min-width: 148px;
    min-height: 42px;
    align-items: center;
    gap: 3px 7px;
    padding: 7px 8px;
  }

  .chat-person span {
    grid-column: 1 / 2;
    overflow: hidden;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .chat-person small {
    grid-column: 1 / 2;
    font-size: 11px;
  }

  .chat-person .mini-button {
    grid-row: 1 / 3;
    grid-column: 2;
    height: 30px;
    padding: 0 8px;
    font-size: 12px;
  }

  .chat-person .mini-button.report {
    display: none;
  }

  .chat-room {
    min-height: 0;
    gap: 7px;
    padding:
      8px
      max(10px, env(safe-area-inset-right))
      max(10px, env(safe-area-inset-bottom))
      max(10px, env(safe-area-inset-left));
    overflow: hidden;
  }

  .chat-room-title {
    min-height: 38px;
    align-items: center;
  }

  .chat-room-title span {
    display: none;
  }

  .chat-room-title .mini-button.start {
    display: none;
  }

  .chat-state-banner {
    padding: 8px 10px;
  }

  .chat-state-banner span {
    display: none;
  }

  .chat-action-notice {
    padding: 8px 10px;
  }

  .pinned-form {
    flex: 0 0 auto;
    gap: 6px;
    padding: 8px;
  }

  .pinned-form label {
    display: none;
  }

  .pinned-form > div {
    grid-template-columns: minmax(0, 1fr) 58px;
    gap: 6px;
  }

  .pinned-form input,
  .pinned-form button {
    height: 38px;
  }

  .pinned-form button {
    padding: 0;
  }

  .pinned-notice {
    padding: 8px 10px;
  }

  .pinned-notice span {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .chat-request-panel {
    max-height: 132px;
    overflow: auto;
    padding: 8px;
  }

  .chat-request-panel .detail-status {
    display: none;
  }

  .modal-messages {
    min-height: 0;
    border-radius: 10px;
    padding: 10px;
    scroll-padding-bottom: 74px;
  }

  .message {
    max-width: 86%;
    padding: 8px 10px;
  }

  .message.system {
    max-width: 94%;
    text-align: center;
  }

  .modal-chat-form {
    position: sticky;
    bottom: 0;
    grid-template-columns: minmax(0, 1fr) 64px;
    gap: 7px;
    border: 1px solid rgba(23, 23, 23, 0.16);
    border-radius: 12px;
    background: #fffdf8;
    box-shadow: 0 -8px 18px rgba(23, 23, 23, 0.08);
    padding: 8px;
  }

  .modal-chat-form .chat-input-label {
    display: none;
  }

  .modal-chat-form input,
  .modal-chat-form button {
    height: 48px;
    border-radius: 10px;
  }

  .modal-chat-form button {
    padding: 0;
  }

  .chat-send-hint {
    grid-column: 1 / -1;
  }

  .host-request-alert {
    right: 10px;
    bottom: 10px;
    width: calc(100% - 20px);
    grid-template-columns: 1fr;
    box-shadow: 6px 6px 0 #171717;
  }

  .feedback-fab {
    right: 12px;
    bottom: 12px;
    height: 42px;
    padding: 0 14px;
    box-shadow: 4px 4px 0 #171717;
  }

  .host-request-alert-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr)) 44px;
  }

  .chat-room > .ghost.full {
    display: none;
  }

  .topbar {
    flex-direction: column;
  }

  .top-links {
    margin-left: 0;
  }

  .account {
    width: 100%;
    justify-content: stretch;
  }

  .identity-card,
  .account button {
    flex: 1;
  }

  .rooms-panel,
  .create-form,
  .profile-card {
    padding: 14px;
  }

  .hero-intro {
    margin: 12px 0;
    padding: 12px;
  }

  .hero-intro h2 {
    font-size: 16px;
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .request-form {
    grid-template-columns: 1fr;
  }

  .inapp-actions {
    grid-template-columns: 1fr;
  }

  .room-filters {
    grid-template-columns: 1fr;
  }

  .active-room-actions {
    grid-template-columns: 1fr;
  }

  .filter-chips {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .feedback-categories {
    grid-template-columns: 1fr;
  }

  .filter-toggle,
  .room-filters select {
    grid-column: 1;
    grid-row: auto;
    justify-self: stretch;
    width: 100%;
  }

  .filter-toggle {
    justify-content: flex-start;
  }

  h1 {
    font-size: 31px;
  }

  .profile-grid {
    grid-template-columns: 1fr;
  }

  .profile-form-row,
  .mini-profile-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 380px) {
  .room-filters {
    grid-template-columns: 1fr;
  }

  .filter-chips {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filter-toggle,
  .room-filters select {
    grid-column: 1;
    grid-row: auto;
    justify-self: stretch;
    width: 100%;
  }

  .filter-toggle {
    justify-content: flex-start;
  }
}
