:root {
  --bg-1: #f8efe1;
  --bg-2: #f0f4ff;
  --ink: #1f2430;
  --accent: #db6b2f;
  --accent-2: #2461a6;
  --card: rgba(255, 255, 255, 0.82);
  --line: rgba(36, 97, 166, 0.2);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "SUIT", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 10% 10%, #fff8eb 0%, transparent 32%),
              radial-gradient(circle at 90% 20%, #eaf2ff 0%, transparent 35%),
              linear-gradient(145deg, var(--bg-1), var(--bg-2));
  overflow-x: hidden;
}

.bg-glow {
  position: fixed;
  border-radius: 999px;
  filter: blur(38px);
  opacity: 0.32;
  z-index: -1;
  animation: float 8s ease-in-out infinite;
}

.bg-glow-a {
  width: 320px;
  height: 320px;
  background: #ffb96a;
  top: -110px;
  left: -80px;
}

.bg-glow-b {
  width: 360px;
  height: 360px;
  background: #8fb5ff;
  right: -120px;
  bottom: -110px;
  animation-delay: 1.5s;
}

.wrap {
  width: min(1060px, 92vw);
  margin: 44px auto 68px;
}

.hero {
  text-align: center;
  animation: slide-up 650ms ease-out both;
}

.badge {
  display: inline-block;
  margin: 0;
  padding: 7px 12px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-2);
}

h1 {
  font-family: "Gowun Batang", serif;
  margin: 14px 0 8px;
  font-size: clamp(34px, 6vw, 58px);
  letter-spacing: -0.5px;
}

.subtitle {
  margin: 0 auto;
  max-width: 680px;
  font-size: clamp(14px, 2.4vw, 18px);
  opacity: 0.85;
}

.grid {
  margin-top: 30px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.panel {
  background: var(--card);
  backdrop-filter: blur(9px);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 10px 30px rgba(10, 24, 44, 0.1);
  animation: slide-up 700ms ease-out both;
}

.list-panel {
  animation-delay: 80ms;
}

h2 {
  margin-top: 0;
  margin-bottom: 14px;
  font-size: 21px;
}

.field {
  display: block;
  margin-bottom: 12px;
}

.field span {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #c9d6ea;
  border-radius: 12px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 15px;
  background: #fff;
}

textarea {
  min-height: 120px;
  resize: vertical;
}

.btn {
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: 12px;
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #ff9863);
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
  filter: saturate(1.1);
}

.status {
  min-height: 22px;
  margin: 10px 0 0;
  font-size: 14px;
}

.list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.filters {
  display: flex;
  gap: 8px;
}

.chip {
  border: 1px solid #b9ccea;
  border-radius: 999px;
  padding: 7px 12px;
  background: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.chip.active {
  border-color: transparent;
  background: linear-gradient(135deg, #2062b2, #3d8ce4);
  color: #fff;
}

.letters {
  margin-top: 10px;
  display: grid;
  gap: 10px;
  max-height: 540px;
  overflow: auto;
  padding-right: 4px;
}

.card {
  background: #fff;
  border: 1px solid #d8e2f2;
  border-radius: 14px;
  padding: 12px;
}

.card-type {
  font-size: 12px;
  font-weight: 800;
}

.card-type.apology {
  color: #b74d1d;
}

.card-type.thanks {
  color: #1f5ea7;
}

.card-message {
  margin: 8px 0;
  line-height: 1.55;
  white-space: pre-wrap;
}

.card-meta {
  margin: 0;
  font-size: 12px;
  opacity: 0.8;
}

.empty {
  margin: 12px 0;
  opacity: 0.75;
}

.error-box {
  margin-top: 16px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid #f3b4b4;
  background: #fff3f3;
  color: #9d2020;
  font-weight: 700;
}

.hidden {
  display: none;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

@keyframes slide-up {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 900px) {
  .grid {
    grid-template-columns: 1fr;
  }

  .wrap {
    margin-top: 28px;
  }
}
