:root {
  --bg: #0b0b0c;
  --panel: #141416;
  --line: #2b2b30;
  --text: #f3f2ec;
  --muted: #9c9b93;
  --accent: #d8ff4a;
  --dim: #6f6e67;
  --get: #8ec8ff;
  --post: #d8ff4a;
  --patch: #ffc14a;
  --delete: #ff7a7a;
  --bubble: #1c1c20;
}

* { box-sizing: border-box; }

html,
body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  background:
    radial-gradient(900px 520px at 12% -10%, #1b2410 0%, transparent 50%),
    radial-gradient(800px 480px at 100% 10%, #1a1520 0%, transparent 46%),
    var(--bg);
  font-family: Pretendard, system-ui, "Apple SD Gothic Neo", sans-serif;
  word-break: keep-all;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  padding: 0 max(24px, calc((100% - 1180px) / 2));
  border-bottom: 1px solid rgba(43, 43, 48, 0.85);
  background: rgba(11, 11, 12, 0.9);
  backdrop-filter: blur(16px);
}

.brand {
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-decoration: none;
}

.site-header nav {
  display: flex;
  gap: 6px;
}

.site-header nav a {
  padding: 7px 11px;
  color: var(--muted);
  font-size: 0.9rem;
  text-decoration: none;
}

.site-header nav a:hover,
.site-header nav a[aria-current="page"] {
  color: var(--text);
}

.site-header nav a[aria-current="page"] {
  border: 1px solid var(--line);
}

.lab {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(320px, 420px);
  gap: 36px;
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto;
  padding: 36px 0 64px;
  align-items: start;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
}

h1 {
  margin: 0;
  font-size: clamp(2.1rem, 5vw, 3.3rem);
  letter-spacing: -0.045em;
  line-height: 1.12;
}

.lead {
  max-width: 38rem;
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.lead b {
  color: var(--text);
}

.recipes {
  display: grid;
  gap: 10px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.recipe {
  padding: 14px 14px 12px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.recipe-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.recipe-head span {
  flex: 1;
  color: var(--muted);
  font-size: 0.88rem;
}

.recipe-head button {
  padding: 4px 8px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--dim);
  font-size: 0.75rem;
}

.recipe-head button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.recipe b {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
}

.recipe[data-method="GET"] b { color: var(--get); }
.recipe[data-method="POST"] b { color: var(--post); }
.recipe[data-method="PATCH"] b { color: var(--patch); }
.recipe[data-method="DELETE"] b { color: var(--delete); }

.recipe code {
  display: block;
  margin: 10px 0 0;
  color: var(--accent);
  font-size: 0.78rem;
  line-height: 1.45;
  word-break: break-all;
}

.recipe pre {
  margin: 8px 0 0;
  color: #cfcfc6;
  font-size: 0.75rem;
  line-height: 1.45;
}

.phone {
  position: sticky;
  top: 74px;
  display: flex;
  flex-direction: column;
  height: min(78vh, 760px);
  border: 1px solid #333;
  border-radius: 28px;
  background:
    linear-gradient(180deg, #17171a 0%, #101012 28%, #0d0d0f 100%);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
  overflow: hidden;
}

.phone-bar,
.phone-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
}

.phone-bar {
  border-bottom: 1px solid #26262b;
}

.phone-title {
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 1.05rem;
  font-weight: 800;
}

.live,
.count,
.phone-foot small,
.phone-foot span {
  margin: 0;
  color: var(--dim);
  font-size: 0.78rem;
}

.live.is-live { color: var(--accent); }
.live.is-poll { color: var(--patch); }

.live.is-live::before,
.live.is-poll::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 4px rgba(216, 255, 74, 0.12);
}

.count {
  min-width: 36px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  text-align: center;
  color: var(--accent);
  font-weight: 700;
}

.messages {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
  padding: 18px 16px;
  overflow: auto;
  list-style: none;
}

.empty {
  margin: auto 20px 20px;
  color: var(--dim);
  text-align: center;
  line-height: 1.5;
}

.messages:not(:empty) + .empty {
  display: none;
}

.message {
  display: grid;
  justify-items: start;
  gap: 6px;
  max-width: 86%;
}

.message.is-new {
  animation: rise 280ms ease;
}

.message.is-right {
  align-self: end;
  justify-items: end;
}

.message.is-patch .bubble {
  outline: 1px solid var(--patch);
}

.message.is-out {
  animation: drop 240ms ease forwards;
}

.meta {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--dim);
  font-size: 0.74rem;
}

.id-chip {
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(216, 255, 74, 0.12);
  color: var(--accent);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-weight: 700;
}

.bubble {
  margin: 0;
  padding: 11px 13px;
  border: 0;
  border-radius: 18px 18px 18px 6px;
  background: var(--bubble);
  color: var(--text);
  font: inherit;
  text-align: left;
  line-height: 1.45;
}

.message.is-right .bubble {
  border-radius: 18px 18px 6px 18px;
  background: #243014;
}

.edited {
  display: block;
  margin-top: 6px;
  color: var(--patch);
  font-size: 0.7rem;
}

.phone-foot {
  border-top: 1px solid #26262b;
}

.phone-foot span.is-on {
  color: var(--accent);
}

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

@keyframes drop {
  to { opacity: 0; transform: translateY(8px) scale(0.96); }
}

@media (max-width: 860px) {
  .lab {
    grid-template-columns: 1fr;
    padding-top: 24px;
  }

  .phone {
    position: static;
    height: 68vh;
  }

  .site-header nav a {
    padding: 7px 8px;
    font-size: 0.82rem;
  }
}
