:root {
  --navy: #0c2f4f;
  --navy-2: #163f61;
  --teal: #49b7ba;
  --teal-deep: #20858a;
  --gold: #c79a4b;
  --cream: #f7f1e6;
  --paper: #fffdfa;
  --ink: #1c2b38;
  --muted: #657887;
  --line: #dbe4e8;
  --soft: #eaf6f4;
  --danger: #a13b3b;
  --shadow: 0 22px 60px rgba(12, 47, 79, 0.13);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Pretendard", "Noto Sans KR", "Apple SD Gothic Neo", Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(145deg, rgba(12, 47, 79, 0.06), rgba(73, 183, 186, 0.12)),
    var(--cream);
}

.login-panel {
  width: min(440px, 100%);
  padding: 34px;
  background: rgba(255, 253, 250, 0.94);
  border: 1px solid rgba(219, 228, 232, 0.95);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.login-logo {
  width: 62px;
  height: 62px;
  object-fit: contain;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--teal-deep);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 1.4px;
}

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

.login-panel h1 {
  margin-bottom: 9px;
  color: var(--navy);
  font-size: 38px;
  line-height: 1.05;
}

.login-copy {
  margin-bottom: 26px;
  color: var(--muted);
  line-height: 1.6;
}

.login-form {
  display: grid;
  gap: 14px;
}

.login-form label {
  display: grid;
  gap: 7px;
  color: var(--navy);
  font-size: 13px;
  font-weight: 900;
}

.login-form input,
.composer textarea {
  width: 100%;
  border: 1px solid #c8d7df;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

.login-form input {
  height: 46px;
  padding: 0 13px;
}

.login-form input:focus,
.composer textarea:focus {
  border-color: var(--teal-deep);
  outline: 3px solid rgba(73, 183, 186, 0.17);
}

.primary-button,
.send-button,
.ghost-button,
.icon-button {
  border-radius: 8px;
  border: 1px solid transparent;
  font-weight: 900;
}

.primary-button,
.send-button {
  background: linear-gradient(105deg, var(--navy), var(--teal-deep));
  color: #fff;
}

.primary-button {
  height: 48px;
}

.form-error {
  min-height: 20px;
  margin: 0;
  color: var(--danger);
  font-size: 13px;
  font-weight: 800;
}

.talk-shell {
  height: 100vh;
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr) 300px;
  background: #f2f6f6;
}

.sidebar,
.detail-panel {
  min-height: 0;
  padding: 20px;
  background: var(--paper);
  border-right: 1px solid var(--line);
  overflow: auto;
}

.detail-panel {
  border-right: 0;
  border-left: 1px solid var(--line);
}

.brand-row,
.profile-card,
.user-item,
.member-strip {
  display: flex;
  align-items: center;
}

.brand-row {
  gap: 12px;
  margin-bottom: 22px;
}

.brand-row img {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.brand-row strong {
  display: block;
  color: var(--navy);
  font-size: 16px;
}

.brand-row span,
.profile-card span,
.room-description,
.chat-header span,
.user-item span {
  color: var(--muted);
  font-size: 12px;
}

.profile-card {
  gap: 12px;
  padding: 14px;
  margin-bottom: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 38px;
  border-radius: 8px;
  background: var(--navy);
  color: #fff;
  font-weight: 900;
}

.nav-label {
  margin: 18px 0 9px;
  color: #8292a0;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 1.2px;
}

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

.room-button {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.room-button:hover,
.room-button.active {
  background: var(--soft);
  border-color: #c9e5e2;
}

.room-button strong {
  overflow: hidden;
  color: var(--navy);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.badge {
  min-width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--gold);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}

.sidebar-actions {
  display: grid;
  gap: 8px;
  margin-top: 22px;
}

.ghost-button {
  min-height: 42px;
  background: #fff;
  border-color: var(--line);
  color: var(--navy);
}

.chat-panel {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: #f8fbfb;
}

.chat-header {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  background: rgba(255, 253, 250, 0.95);
  border-bottom: 1px solid var(--line);
}

.chat-header h2 {
  margin-bottom: 3px;
  color: var(--navy);
  font-size: 22px;
}

.member-strip {
  justify-content: flex-end;
  gap: 6px;
}

.mini-avatar {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--navy);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}

.messages {
  min-height: 0;
  padding: 22px;
  overflow: auto;
}

.message {
  max-width: min(680px, 88%);
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
}

.message.mine {
  margin-left: auto;
}

.message-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.message.mine .message-meta {
  justify-content: flex-end;
}

.bubble {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.message.mine .bubble {
  border-color: rgba(32, 133, 138, 0.35);
  background: linear-gradient(145deg, var(--navy), var(--teal-deep));
  color: #fff;
}

.composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px;
  gap: 10px;
  padding: 16px 18px;
  background: var(--paper);
  border-top: 1px solid var(--line);
}

.composer textarea {
  min-height: 46px;
  max-height: 138px;
  padding: 12px 13px;
  resize: none;
  line-height: 1.45;
}

.send-button {
  min-height: 46px;
}

.detail-panel {
  display: grid;
  align-content: start;
  gap: 18px;
}

.detail-panel section {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.detail-panel h3 {
  margin-bottom: 14px;
  color: var(--navy);
}

.task-list,
.user-list {
  display: grid;
  gap: 10px;
}

.task-list label {
  display: flex;
  gap: 8px;
  color: #42586b;
  font-size: 13px;
  line-height: 1.45;
}

.task-list input {
  accent-color: var(--teal-deep);
}

.user-item {
  gap: 10px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2ca56f;
  box-shadow: 0 0 0 4px rgba(44, 165, 111, 0.13);
}

.mobile-only {
  display: none;
}

.icon-button {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  background: #fff;
  border-color: var(--line);
}

.icon-button span,
.icon-button::before,
.icon-button::after {
  content: "";
  width: 18px;
  height: 2px;
  display: block;
  background: var(--navy);
}

.icon-button span {
  margin: 4px 0;
}

@media (max-width: 1100px) {
  .talk-shell {
    grid-template-columns: 280px minmax(0, 1fr);
  }

  .detail-panel {
    display: none;
  }
}

@media (max-width: 760px) {
  .talk-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 30;
    width: min(86vw, 310px);
    transform: translateX(-105%);
    transition: transform 0.22s ease;
    box-shadow: var(--shadow);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .mobile-only {
    display: grid;
  }

  .chat-header {
    align-items: flex-start;
    justify-content: flex-start;
  }

  .member-strip {
    display: none;
  }

  .messages {
    padding: 16px 13px;
  }

  .message {
    max-width: 94%;
  }

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

  .send-button {
    width: 100%;
  }
}
