@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;500;600;700;800&display=swap");
:root {
  font-family: "Noto Sans KR", system-ui, sans-serif;
  color: #352c22;
  background: #faf6ef;
  font-synthesis: none;
  --bg: #faf6ef;
  --surface: #fffdfa;
  --text: #352c22;
  --muted: #796f62;
  --line: #e8dfd2;
  --brand: #8b623b;
  --soft: #f1e7d8;
  --danger: #bd3046;
  --shadow: 0 12px 35px #5b402018;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #17140f;
  --surface: #211c15;
  --text: #f4ebdf;
  --muted: #c0af99;
  --line: #3d3327;
  --brand: #d7b07a;
  --soft: #362b1e;
  --danger: #ff9b91;
  --shadow: 0 12px 35px #0005;
  color-scheme: dark;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.65;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  outline-offset: 4px;
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
a {
  color: var(--brand);
}
button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 17px;
  font-weight: 600;
}
button:hover:not(:disabled) {
  border-color: var(--brand);
  color: var(--brand);
}
button.primary {
  background: var(--brand);
  color: var(--surface);
  border-color: var(--brand);
}
button.ghost {
  border-color: transparent;
  background: transparent;
}
button.danger {
  color: var(--danger);
}
input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 12px;
  background: var(--bg);
  color: var(--text);
  min-width: 0;
}
textarea {
  resize: vertical;
  min-height: 90px;
}
label {
  display: grid;
  gap: 7px;
  font-size: 14px;
  font-weight: 600;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: 30px;
  letter-spacing: -1px;
  line-height: 1.4;
}
h2 {
  font-size: 22px;
  line-height: 1.5;
}
h3 {
  font-size: 18px;
}
small,
.muted {
  color: var(--muted);
}
small {
  font-size: 13px;
}
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.between {
  justify-content: space-between;
}
.stack {
  display: grid;
  gap: 20px;
}
.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.brand {
  font-size: 23px;
  letter-spacing: -1px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-mark {
  width: 35px;
  height: 35px;
  border-radius: 12px;
  background: var(--brand);
  color: var(--surface);
  display: grid;
  place-items: center;
  font-size: 24px;
}
.eyebrow {
  color: var(--brand);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 2px;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  border-radius: 100px;
  padding: 4px 10px;
  background: var(--soft);
  color: var(--brand);
  font-weight: 600;
}
.online:before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #16916d;
}
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 24px;
  border-radius: 20px;
}
.note {
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--soft);
  color: var(--text);
  font-size: 14px;
}
.error {
  color: var(--danger);
  font-size: 14px;
  white-space: pre-wrap;
}
.auth-wrap {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(360px, 1fr);
}
.auth-art {
  background: var(--brand);
  color: white;
  padding: clamp(32px, 7vw, 100px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 64px;
  position: relative;
  overflow: hidden;
}
.auth-art h1 {
  font-size: clamp(38px, 4.5vw, 66px);
  line-height: 1.25;
  margin-bottom: 28px;
}
.auth-art p {
  color: #f7eee2;
  max-width: 360px;
}
.auth-art .brand-mark {
  background: white;
  color: var(--brand);
}
.auth-art .eyebrow {
  color: #f3e2c9;
  margin-bottom: 24px;
}
.conversation {
  padding: 22px 26px;
  border: 1px solid #ffffff30;
  border-radius: 20px;
  background: #ffffff0d;
  max-width: 390px;
  margin: 14px 0;
}
.conversation:nth-child(2) {
  margin-left: 45px;
  background: #fff;
  color: var(--brand);
}
.auth-content {
  display: grid;
  place-items: center;
  padding: 40px 24px;
}
.auth-card {
  width: 100%;
  max-width: 400px;
}
.auth-card form {
  display: grid;
  gap: 20px;
}
.auth-card h2 {
  font-size: 28px;
}
.auth-footer {
  margin-top: 35px;
  font-size: 13px;
}
.admin-link {
  display: block;
  margin: 24px 0 0 auto;
  font-size: 13px;
  color: var(--muted);
}
.shell {
  display: grid;
  grid-template-columns: 230px 1fr;
  min-height: 100dvh;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  padding: 34px 24px;
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 42px;
}
.nav {
  display: grid;
  gap: 10px;
}
.nav button {
  display: flex;
  gap: 12px;
  align-items: center;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 14px;
}
.nav button.active {
  background: var(--soft);
  color: var(--brand);
}
.nav-icon {
  width: 24px;
  font-size: 21px;
  text-align: center;
}
.sidebar-bottom {
  margin-top: auto;
  font-size: 13px;
}
.workspace {
  min-width: 0;
}
.topbar {
  height: 82px;
  padding: 0 42px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
}
main {
  padding: 38px 42px;
  max-width: 1380px;
  margin: auto;
}
.heading {
  margin-bottom: 26px;
}
.heading h1 {
  margin-bottom: 6px;
}
.searchbar {
  display: flex;
  gap: 12px;
  margin: 24px 0;
}
.searchbar input {
  background: var(--surface);
}
.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.person {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 24px;
  display: grid;
  gap: 18px;
}
.person:hover {
  box-shadow: var(--shadow);
}
.avatar {
  width: 70px;
  height: 70px;
  border-radius: 24px;
  object-fit: cover;
  background: var(--soft);
  color: var(--brand);
  font-size: 27px;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.avatar.small {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  font-size: 18px;
}
.person h3 {
  margin: 0;
}
.person p {
  font-size: 14px;
  margin: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.person .bio {
  min-height: 45px;
}
.person .actions {
  display: flex;
  gap: 8px;
}
.person .actions button:first-child {
  flex: 1;
}
.empty {
  padding: 64px 24px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 20px;
  background: var(--surface);
  color: var(--muted);
}
.empty h2 {
  color: var(--text);
}
.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.tabs .active {
  color: var(--brand);
  background: var(--soft);
  border-color: var(--soft);
}
.list {
  display: grid;
  gap: 10px;
}
.list-item {
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 15px;
  display: flex;
  gap: 14px;
  align-items: center;
  text-align: left;
  width: 100%;
}
.list-item .content {
  min-width: 0;
  flex: 1;
}
.list-item p {
  margin: 3px 0 0;
  overflow-wrap: anywhere;
}
.list-item.unread {
  border-left: 4px solid var(--brand);
}
.chat-layout {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 20px;
}
.chat-panel {
  display: flex;
  flex-direction: column;
  height: calc(100dvh - 230px);
  min-height: 430px;
  padding: 0;
  overflow: hidden;
}
.chat-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}
.messages {
  padding: 24px;
  overflow: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.bubble {
  max-width: 85%;
  align-self: flex-start;
  display: grid;
  gap: 4px;
}
.bubble.mine {
  align-self: flex-end;
  text-align: right;
}
.bubble p {
  padding: 12px 16px;
  border-radius: 16px 16px 16px 3px;
  background: var(--bg);
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  text-align: left;
}
.bubble.mine p {
  background: var(--brand);
  color: var(--surface);
  border-radius: 16px 16px 3px 16px;
}
.composer {
  display: flex;
  gap: 10px;
  padding: 16px;
  border-top: 1px solid var(--line);
}
.composer textarea {
  min-height: 48px;
  max-height: 130px;
}
.settings {
  max-width: 780px;
}
.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}
.setting-row select {
  width: auto;
}
.stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-bottom: 25px;
}
.stat strong {
  font-size: 29px;
  display: block;
}
.stat span {
  font-size: 13px;
  color: var(--muted);
}
.table-wrap {
  overflow: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 14px;
}
th,
td {
  text-align: left;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.legal {
  white-space: pre-line;
  max-width: 800px;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  color: var(--text);
  width: min(540px, calc(100% - 32px));
  padding: 26px;
  max-height: 85dvh;
  overflow: auto;
}
dialog::backdrop {
  background: #10182980;
}
#toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  background: var(--text);
  color: var(--surface);
  padding: 12px 22px;
  border-radius: 12px;
  max-width: 90vw;
  box-shadow: var(--shadow);
  display: none;
}
.checkbox {
  display: flex;
  align-items: center;
}
.checkbox input {
  width: 20px;
  height: 20px;
}
.badge {
  background: var(--brand);
  color: var(--surface);
  border-radius: 20px;
  font-size: 12px;
  padding: 0 7px;
}
.demo-ribbon {
  background: var(--soft);
  padding: 10px 24px;
  font-size: 14px;
  text-align: center;
}
.loading {
  padding: 60px;
  text-align: center;
}
.bottom-space {
  height: 20px;
}
button {
  word-break: keep-all;
}
.searchbar button {
  flex-shrink: 0;
}
.searchbar input {
  flex: 1;
  min-width: 0;
}
.restricted {
  max-width: 620px;
  margin: 12vh auto;
  padding: 24px;
}
@media (min-width: 1500px) {
  .cards {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@media (max-width: 1100px) {
  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .shell {
    grid-template-columns: 195px 1fr;
  }
  .sidebar {
    padding: 30px 16px;
  }
  main {
    padding: 30px 24px;
  }
  .topbar {
    padding: 0 24px;
  }
  .stats {
    grid-template-columns: repeat(3, 1fr);
  }
  .chat-layout {
    grid-template-columns: 230px minmax(0, 1fr);
  }
}
@media (max-width: 720px) {
  .auth-wrap {
    grid-template-columns: 1fr;
  }
  .auth-art {
    padding: 28px;
    gap: 30px;
  }
  .auth-art h1 {
    font-size: 38px;
    margin-bottom: 14px;
  }
  .auth-art .conversations,
  .auth-art > small {
    display: none;
  }
  .auth-content {
    padding: 32px 24px;
  }
  .shell {
    display: block;
  }
  .sidebar {
    height: auto;
    padding: 0;
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10;
    border-top: 1px solid var(--line);
    border-right: 0;
    background: var(--surface);
  }
  .sidebar > .brand,
  .sidebar-bottom {
    display: none;
  }
  .nav {
    display: flex;
    gap: 0;
    padding: 6px 6px max(8px, env(safe-area-inset-bottom));
  }
  .nav button {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0;
    justify-content: center;
    font-size: 12px;
    padding: 8px 3px;
    border-radius: 10px;
  }
  .nav .badge {
    position: absolute;
    transform: translate(16px, -9px);
  }
  .nav-icon {
    font-size: 21px;
  }
  .topbar {
    height: 67px;
    padding: 0 20px;
  }
  main {
    padding: 26px 20px 110px;
  }
  .cards {
    gap: 12px;
  }
  .person {
    padding: 18px;
    gap: 14px;
  }
  .person .avatar {
    width: 55px;
    height: 55px;
    border-radius: 19px;
  }
  .person .row {
    gap: 8px;
  }
  .person .actions {
    flex-wrap: wrap;
  }
  .person .actions button {
    padding: 8px 10px;
  }
  .heading h1 {
    font-size: 27px;
  }
  .chat-layout {
    grid-template-columns: 1fr;
  }
  .chat-layout.has-room .room-list {
    display: none;
  }
  .chat-panel {
    height: calc(100dvh - 215px);
    min-height: 340px;
  }
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid2 {
    grid-template-columns: 1fr;
  }
  .searchbar {
    flex-wrap: wrap;
  }
  .searchbar input {
    flex: 1;
    min-width: 160px;
  }
  .setting-row {
    flex-wrap: wrap;
  }
  .panel {
    padding: 20px;
  }
  #toast {
    bottom: 92px;
  }
  .messages {
    padding: 16px;
  }
  .bubble {
    max-width: 90%;
  }
}
@media (max-width: 380px) {
  .cards {
    grid-template-columns: 1fr;
  }
}

/* Slim horizontal profile cards used across discover, friends, and chat lists. */
.cards {
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}
.person {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  border-radius: 16px;
}
.person-photo {
  width: 76px;
  height: 92px;
  overflow: hidden;
  border-radius: 12px;
  background: var(--soft);
}
.person .avatar {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  font-size: 25px;
}
.person-details {
  min-width: 0;
  display: grid;
  gap: 5px;
}
.person-heading {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}
.person-heading h3 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.person-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  color: var(--muted);
  font-size: 13px;
}
.person .bio {
  min-height: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  color: var(--muted);
  line-height: 1.45;
}
.person .actions {
  align-items: center;
  white-space: nowrap;
}
.room-card {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  color: var(--text);
  text-align: left;
}
.room-card:hover,
.room-card.active {
  border-color: var(--brand);
  background: var(--soft);
}
.room-card > .avatar {
  width: 54px;
  height: 68px;
  border-radius: 10px;
  font-size: 20px;
}
.room-person-details {
  display: grid;
  min-width: 0;
  gap: 2px;
}
.room-person-details strong,
.room-meta,
.room-bio,
.room-last-message {
  overflow: hidden;
  text-overflow: ellipsis;
}
.room-person-details strong,
.room-meta {
  white-space: nowrap;
}
.room-meta,
.room-bio,
.room-last-message,
.room-person-details small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}
.room-bio,
.room-last-message {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}
@media (max-width: 720px) {
  .person {
    grid-template-columns: 62px minmax(0, 1fr);
    gap: 10px 12px;
    padding: 12px;
  }
  .person-photo {
    width: 62px;
    height: 78px;
    grid-row: span 2;
  }
  .person .actions {
    grid-column: 2;
    flex-wrap: nowrap;
  }
  .person .actions button {
    padding: 7px 10px;
  }
  .person-meta {
    gap: 3px 8px;
    font-size: 12px;
  }
  .room-card {
    grid-template-columns: 48px minmax(0, 1fr) auto;
  }
  .room-card > .avatar {
    width: 48px;
    height: 62px;
  }
}
