:root {
  --accent: #3157d5;
  --accent-hover: #2444ad;
  --accent-text: #ffffff;
  --bg: #f5f7fb;
  --border: #d8dfec;
  --code: #e8edfa;
  --marked: #fff1b8;
  --preformatted: #e8edfa;
  --text: #172036;
  --text-light: #59627a;
}

@media (prefers-color-scheme: dark) {
  :root {
    --accent: #8ca7ff;
    --accent-hover: #adc0ff;
    --accent-text: #11172a;
    --bg: #11172a;
    --border: #303b57;
    --code: #202a43;
    --preformatted: #202a43;
    --text: #edf1ff;
    --text-light: #b8c2dc;
  }
}

body {
  grid-template-columns: 1fr min(64rem, 90%) 1fr;
}

.site-header {
  align-items: center;
  background: #101a36;
  display: flex;
  justify-content: space-between;
  padding-block: 1rem;
}

.site-header nav {
  align-items: center;
  display: flex;
  gap: 0.75rem;
}

.site-header nav a,
.brand {
  border: 0;
  color: #ffffff;
  margin: 0;
  text-decoration: none;
}

.brand {
  align-items: center;
  display: flex;
  font-size: 1.25rem;
  font-weight: 800;
  gap: 0.65rem;
}

.brand-mark {
  align-items: center;
  background: #ffffff;
  border-radius: 0.35rem;
  color: #18388f;
  display: inline-flex;
  font-size: 0.95rem;
  height: 2rem;
  justify-content: center;
  width: 2rem;
}

.button-link {
  background: var(--accent);
  border: 0;
  border-radius: 0.35rem;
  color: var(--accent-text) !important;
  display: inline-block;
  padding: 0.65rem 0.9rem;
  text-decoration: none;
}

.account-name {
  color: #ffffff;
}

.inline-form,
.inline-form button {
  margin: 0;
}

main {
  padding-block: 3rem;
}

.intro {
  border-left: 0.35rem solid var(--accent);
  max-width: 48rem;
  padding-left: 1.5rem;
}

.intro h1 {
  font-size: clamp(2rem, 6vw, 3.75rem);
  letter-spacing: -0.04em;
  line-height: 1.08;
  margin-top: 0.3rem;
}

.intro > p:not(.eyebrow) {
  font-size: 1.08rem;
}

.eyebrow {
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin-bottom: 0;
  text-transform: uppercase;
}

.signed-in {
  font-weight: 700;
}

.temporary-chat-form {
  align-items: start;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.temporary-chat-form button {
  font-size: 1.05rem;
  margin: 0;
}

.temporary-chat-form small {
  color: var(--text-light);
}

.setup-notice,
.scope-note {
  background: var(--code);
  border: 1px solid var(--border);
  float: none;
  margin-block: 2rem;
  padding: 1rem 1.25rem;
  width: auto;
}

.matching-form fieldset {
  display: grid;
  gap: 0.7rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.matching-form fieldset label {
  align-items: start;
  display: grid;
  grid-template-columns: auto 1fr;
  margin: 0;
}

.matching-form input[type="radio"] {
  margin-top: 0.35rem;
}

.matching-form > button {
  width: 100%;
}

.empty-state,
.auth-panel,
.message-page {
  margin-inline: auto;
  max-width: 36rem;
}

.conversation-list-page {
  margin-inline: auto;
  max-width: 48rem;
}

.conversation-list {
  display: grid;
  gap: 1rem;
  list-style: none;
  margin-block: 2rem;
  padding: 0;
}

.conversation-card {
  border-left: 0.3rem solid var(--accent);
  margin: 0;
}

.conversation-card h2 {
  margin-top: 0.35rem;
}

.conversation-card h2 a {
  color: var(--text);
}

.conversation-time {
  color: var(--text-light);
}

.conversation-detail-page {
  margin-inline: auto;
  max-width: 48rem;
}

.back-link {
  display: inline-block;
  margin-bottom: 1.5rem;
}

.conversation-summary {
  color: var(--text-light);
}

.message-list {
  display: grid;
  gap: 1rem;
  list-style: none;
  margin-block: 2rem;
  padding: 0;
}

.message-item {
  align-items: start;
  display: flex;
  gap: 0.75rem;
  max-width: 85%;
}

.message-item.my-message {
  flex-direction: row-reverse;
  justify-self: end;
}

.message-avatar {
  align-items: center;
  background: var(--code);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex;
  flex: 0 0 2.5rem;
  font-weight: 800;
  height: 2.5rem;
  justify-content: center;
}

.message-body {
  background: var(--code);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
}

.my-message .message-body {
  border-color: var(--accent);
}

.message-meta {
  align-items: center;
  display: flex;
  font-size: 0.85rem;
  gap: 0.75rem;
  justify-content: space-between;
  margin: 0 0 0.35rem;
}

.message-meta time {
  color: var(--text-light);
}

.message-content {
  margin: 0;
  white-space: pre-wrap;
}

.empty-message {
  background: var(--code);
  border: 1px solid var(--border);
  padding: 1rem;
}

.chat-form {
  border-top: 1px solid var(--border);
  margin-top: 2rem;
  padding-top: 1.25rem;
}

.chat-form textarea {
  resize: vertical;
}

.chat-shortcut-hint {
  color: var(--text-light);
  display: block;
  margin-block: -0.5rem 1rem;
}

.chat-form button {
  margin-top: 0;
}

.chat-error {
  color: #b92323;
  font-weight: 700;
}

.typing-indicator {
  color: var(--text-light);
  font-size: 0.9rem;
  font-style: italic;
  margin-block: 0.75rem;
}

.chat-action-forms {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-block: 1rem;
}

.chat-action-forms form,
.chat-action-forms button {
  margin: 0;
}

.danger-button {
  border-color: #b92323;
  color: #b92323;
}

.system-message {
  background: var(--code);
  border: 1px solid var(--border);
  justify-content: center;
  margin-inline: auto;
  max-width: 36rem;
  text-align: center;
}

.system-message .message-body {
  max-width: none;
}

.system-message .message-meta {
  justify-content: center;
}

.matching-page {
  margin-inline: auto;
  max-width: 36rem;
  text-align: center;
}

.matching-indicator {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-block: 2rem;
}

.matching-indicator span {
  background: var(--accent);
  border-radius: 50%;
  height: 0.75rem;
  width: 0.75rem;
}

.matching-condition {
  color: var(--text-light);
}

.auth-panel {
  background: var(--bg);
  border: 1px solid var(--border);
  border-top: 0.35rem solid var(--accent);
  padding: clamp(1.25rem, 5vw, 2.5rem);
}

.auth-panel button {
  width: 100%;
}

.form-error {
  background: #ffe5e5;
  border-left: 0.25rem solid #b92323;
  color: #681414;
  padding: 0.8rem 1rem;
}

.form-success {
  background: #e0f3ea;
  border-left: 0.25rem solid #18754c;
  color: #104f35;
  padding: 0.8rem 1rem;
}

.auth-switch {
  text-align: center;
}

footer {
  font-size: 0.9rem;
  text-align: center;
}

@media (max-width: 38rem) {
  .site-header {
    align-items: flex-start;
    gap: 1rem;
  }

  .site-header nav {
    align-items: flex-end;
    flex-direction: column;
  }

  .account-name {
    font-size: 0.9rem;
  }
}

/* 홈 */
.history-box {
  display: flex;
  border: 1;
  div{
    flex-grow: 1;
    width: 100%;
  }
}
