:root {
  --ink: #15171b;
  --ink-2: #22252b;
  --paper: #f4f2ed;
  --paper-2: #fffdfa;
  --line: #d9d3c8;
  --muted: #6b7078;

  --danger: #d62828;
  --danger-dark: #8f1616;
  --warning: #f77f00;
  --warning-soft: #fff0db;
  --blue-alert: #1967d2;

  --poor-bg: #d7cfaa;
  --poor-card: #eee6bf;
  --poor-text: #27251d;
  --poor-line: #a79d78;

  --kakao: #fee500;
  --kakao-ink: #191919;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Noto Sans KR", system-ui, sans-serif;
  line-height: 1.6;
}

.wrap {
  width: min(1040px, calc(100% - 32px));
  margin: 0 auto;
}

.masthead {
  padding: 52px 0 36px;
  color: #f8f7f3;
  background:
    radial-gradient(circle at 84% 12%, rgba(214,40,40,.16), transparent 23%),
    linear-gradient(180deg, #191b20 0%, #111318 100%);
  border-bottom: 5px solid var(--danger);
}

.masthead__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 28px;
}

.kicker, .label {
  color: #ff8a7f;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .17em;
}

.demo-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 6px;
  border: 1px solid #6d7178;
  border-radius: 999px;
  color: #b8bdc6;
  font-size: 8px;
  letter-spacing: .08em;
  vertical-align: 1px;
}

.masthead h1 {
  margin: 8px 0 0;
  font-size: clamp(42px, 8vw, 70px);
  line-height: .95;
  font-weight: 900;
  letter-spacing: -.055em;
}

.masthead p {
  margin: 12px 0 0;
  color: #c9cbd0;
  font-size: 15px;
}


.gate-title-row {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.gate-title-row h1 {
  margin-right: 2px;
}

.emergency-beacon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 9px;
  border: 1px solid #484d56;
  border-radius: 10px;
  background: #0e1014;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.02);
}

.beacon {
  position: relative;
  display: block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  opacity: .28;
}

.beacon::after {
  content: "";
  position: absolute;
  inset: -7px;
  border-radius: 50%;
  opacity: 0;
}

.beacon--red {
  background: #ff2f2f;
  animation: beaconRed 1.1s infinite;
}

.beacon--red::after {
  background: radial-gradient(circle, rgba(255,47,47,.55), rgba(255,47,47,0) 70%);
  animation: haloRed 1.1s infinite;
}

.beacon--blue {
  background: #2c7dff;
  animation: beaconBlue 1.1s infinite;
}

.beacon--blue::after {
  background: radial-gradient(circle, rgba(44,125,255,.55), rgba(44,125,255,0) 70%);
  animation: haloBlue 1.1s infinite;
}

.emergency-label {
  margin-left: 2px;
  color: #f4f4f4;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .13em;
}

@keyframes beaconRed {
  0%, 42%, 100% {
    opacity: 1;
    box-shadow: 0 0 9px #ff2f2f, 0 0 18px rgba(255,47,47,.65);
  }
  50%, 92% {
    opacity: .16;
    box-shadow: none;
  }
}

@keyframes haloRed {
  0%, 42%, 100% { opacity: 1; transform: scale(1); }
  50%, 92% { opacity: 0; transform: scale(.65); }
}

@keyframes beaconBlue {
  0%, 42%, 100% {
    opacity: .16;
    box-shadow: none;
  }
  50%, 92% {
    opacity: 1;
    box-shadow: 0 0 9px #2c7dff, 0 0 18px rgba(44,125,255,.65);
  }
}

@keyframes haloBlue {
  0%, 42%, 100% { opacity: 0; transform: scale(.65); }
  50%, 92% { opacity: 1; transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .beacon,
  .beacon::after {
    animation: none !important;
  }
  .beacon {
    opacity: .9;
  }
}

.case-mark {
  min-width: 110px;
  padding: 12px 14px;
  border: 1px solid #50545b;
  border-radius: 8px;
  text-align: right;
  background: #1e2126;
}
.case-mark span, .case-mark strong { display: block; }
.case-mark span {
  color: #878d97;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .14em;
}
.case-mark strong {
  margin-top: 2px;
  color: #f4f4f2;
  font-size: 20px;
}

.summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 30px;
  border: 1px solid #3c4047;
  border-radius: 10px;
  overflow: hidden;
  background: #1b1e24;
}
.summary > div {
  padding: 17px 18px;
  border-right: 1px solid #3c4047;
}
.summary > div:last-child { border-right: 0; }
.summary span {
  display: block;
  margin-bottom: 4px;
  color: #969ca5;
  font-size: 11px;
}
.summary strong, .summary b { color: #fff; font-size: 18px; }

.chat-cta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 22px;
  margin-top: 14px;
  padding: 16px 18px;
  border-radius: 10px;
  background: linear-gradient(90deg, #24272c, #29231f);
  border: 1px solid #3c4047;
}
.chat-cta__copy { min-width: 0; }
.chat-cta__copy strong {
  display: block;
  color: #fff;
  font-size: 15px;
}
.chat-cta__copy > span:last-child {
  display: block;
  margin-top: 2px;
  color: #9da3ac;
  font-size: 12px;
}
.chat-cta__label {
  display: block;
  margin-bottom: 4px;
  color: #767c86;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .14em;
}

.kakao-button {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding: 0 18px 0 14px;
  border-radius: 10px;
  color: var(--kakao-ink);
  background: var(--kakao);
  text-decoration: none;
  font-size: 13px;
  font-weight: 900;
  box-shadow: 0 3px 0 rgba(0,0,0,.18);
  transition: transform .15s ease, box-shadow .15s ease;
}
.kakao-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 0 rgba(0,0,0,.18);
}
.kakao-button:active {
  transform: translateY(1px);
  box-shadow: 0 1px 0 rgba(0,0,0,.18);
}
.kakao-button.is-disabled {
  pointer-events: none;
  opacity: .45;
  filter: grayscale(1);
}
.kakao-icon {
  display: inline-flex;
  width: 25px;
  height: 25px;
  align-items: center;
  justify-content: center;
}
.kakao-icon svg {
  width: 25px;
  height: 25px;
  fill: var(--kakao-ink);
}

.section { padding: 56px 0; }

.section:first-of-type {
  position: relative;
}

.section:first-of-type::before {
  content: "CAUTION  ·  CLAIM ARCHIVE  ·  CAUTION  ·  CLAIM ARCHIVE  ·  CAUTION";
  display: block;
  overflow: hidden;
  white-space: nowrap;
  padding: 7px 16px;
  color: #151515;
  background:
    repeating-linear-gradient(
      -45deg,
      #f7b801 0 14px,
      #ffcc29 14px 28px
    );
  border-bottom: 1px solid #d0a400;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .12em;
  text-align: center;
}


.section-title {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  margin-bottom: 18px;
}
.section-title h2 {
  margin: 4px 0 0;
  font-size: 30px;
  letter-spacing: -.04em;
}
.label { color: var(--danger); }
.sort-note {
  color: var(--muted);
  font-size: 12px;
}

.case-table {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper-2);
}
.case-head,
.case-row {
  display: grid;
  grid-template-columns: 64px 120px 120px 150px 100px 1fr;
  gap: 14px;
  align-items: center;
}
.case-head {
  padding: 11px 16px;
  color: #7b7e84;
  font-size: 11px;
  font-weight: 800;
  background: #e8e3d9;
  border-bottom: 1px solid var(--line);
}
.case-row {
  padding: 18px 16px;
  border-bottom: 1px solid var(--line);
}
.case-row:last-child { border-bottom: 0; }
.rank {
  color: var(--danger);
  font-size: 18px;
  font-weight: 900;
}
.name { font-weight: 800; }
.date, .note {
  color: #5f636a;
  font-size: 13px;
}
.loss { font-weight: 900; }

.grade {
  display: inline-flex;
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  background: #e7e3da;
  color: #44484f;
  font-size: 10px;
  font-weight: 900;
}
.grade--s {
  background: #ffe1df;
  color: var(--danger);
  border: 1px solid #efaaa6;
}

.grade-guide {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 12px;
}
.grade-guide > div {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-2);
}
.grade-guide b, .grade-guide span { display: block; }
.grade-guide b { font-size: 11px; }
.grade-guide span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.poor-section {
  background: var(--poor-bg);
  color: var(--poor-text);
  border-top: 1px solid #b9af88;
  border-bottom: 1px solid #b9af88;
}
.poor-section .section-title h2 { color: var(--poor-text); }
.label--poor { color: #5e573f; }
.poor-section .sort-note { color: #67614c; }

.poor-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
  padding: 18px;
  border: 1px solid var(--poor-line);
  border-radius: 10px;
  background: rgba(255,255,255,.18);
}
.poor-hero__text strong {
  display: block;
  font-size: 20px;
  font-weight: 900;
}
.poor-hero__text p {
  margin: 6px 0 0;
  color: #5a5543;
  font-size: 14px;
}
.poor-hero img {
  width: 120px;
  max-width: 32vw;
  height: auto;
  flex: 0 0 auto;
}

.poor-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.poor-card {
  padding: 20px;
  border: 1px solid var(--poor-line);
  border-radius: 8px;
  background: var(--poor-card);
  box-shadow: 3px 3px 0 rgba(69,61,34,.12);
}
.poor-card__stamp {
  display: inline-block;
  margin-bottom: 10px;
  padding: 3px 7px;
  border: 1px dashed #7f7042;
  color: #6d6038;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .08em;
}
.poor-card__name {
  display: block;
  font-size: 18px;
  font-weight: 900;
}
.poor-card__story {
  margin: 9px 0 0;
  color: #5a5543;
  font-size: 14px;
  line-height: 1.8;
}

.notice { padding: 28px 0 44px; }
.notice p {
  margin: 0;
  padding: 14px 16px;
  border-left: 4px solid var(--danger);
  background: #e8e3d9;
  color: #62666d;
  font-size: 12px;
}
footer {
  padding: 24px 0 34px;
  color: #777b81;
  font-size: 11px;
  background: #e7e2d7;
  border-top: 1px solid var(--line);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 20px;
}
.empty {
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 820px) {
  .masthead__top { align-items: stretch; }
  .case-mark { min-width: 90px; }
  .summary { grid-template-columns: 1fr; }
  .summary > div {
    border-right: 0;
    border-bottom: 1px solid #3c4047;
  }
  .summary > div:last-child { border-bottom: 0; }

  .chat-cta {
    align-items: stretch;
    flex-direction: column;
  }
  .kakao-button { width: 100%; }

  .case-head { display: none; }
  .case-table {
    border: 0;
    background: transparent;
    overflow: visible;
  }
  #royalList {
    display: grid;
    gap: 10px;
  }
  .case-row {
    grid-template-columns: 52px 1fr;
    gap: 7px 12px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--paper-2);
  }
  .rank {
    grid-row: 1 / span 5;
    font-size: 22px;
  }
  .date::before {
    content: "피해일자  ";
    color: #92969c;
  }
  .loss::before {
    content: "피해액  ";
    color: #92969c;
    font-weight: 500;
  }
  .note {
    padding-top: 8px;
    border-top: 1px solid var(--line);
  }
  .grade-guide { grid-template-columns: 1fr 1fr; }
  .poor-hero {
    align-items: flex-start;
  }
  .poor-list { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .masthead { padding-top: 40px; }
  .masthead__top { display: block; }
  .case-mark {
    display: inline-block;
    margin-top: 20px;
    text-align: left;
  }
  .masthead h1 { font-size: 44px; }
  .section { padding: 44px 0; }

  .section-title {
    display: block;
  }
  .sort-note {
    display: block;
    margin-top: 8px;
  }
  .grade-guide { grid-template-columns: 1fr; }

  .poor-hero {
    flex-direction: column;
    text-align: center;
  }
  .poor-hero img {
    width: 150px;
    max-width: 48vw;
  }

  .footer-inner {
    flex-direction: column;
    gap: 6px;
  }
}


/* CONTACT LOG */
.contact-section {
  background: #ebe8e1;
  border-top: 1px solid #d4cec2;
}

.label--contact {
  color: #b55400;
}

.contact-intro {
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid #d2cdc2;
  border-radius: 9px;
  background: #f6f4ef;
  color: #646970;
  font-size: 12px;
  line-height: 1.75;
}

.contact-list {
  display: grid;
  gap: 10px;
}

.contact-card {
  display: grid;
  grid-template-columns: 120px 120px 120px 1fr;
  gap: 16px;
  align-items: start;
  padding: 17px 18px;
  border: 1px solid #d2cdc2;
  border-radius: 9px;
  background: #faf9f6;
}

.contact-card__field span {
  display: block;
  margin-bottom: 4px;
  color: #8a8e94;
  font-size: 10px;
  font-weight: 800;
}

.contact-card__field strong,
.contact-card__field p {
  margin: 0;
  color: #30343a;
  font-size: 13px;
}

.contact-card__field strong {
  font-weight: 800;
}

.contact-card__field p {
  line-height: 1.7;
}

.contact-badge {
  display: inline-flex;
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  background: #e0e6ea;
  color: #425867;
  font-size: 10px;
  font-weight: 900;
}

@media (max-width: 820px) {
  .contact-card {
    grid-template-columns: 1fr 1fr;
  }

  .contact-card__field--summary {
    grid-column: 1 / -1;
    padding-top: 8px;
    border-top: 1px solid #ded9cf;
  }
}

@media (max-width: 560px) {
  .contact-card {
    grid-template-columns: 1fr;
  }

  .contact-card__field--summary {
    grid-column: auto;
  }
}


/* Alert color refinements */
.case-mark {
  border-color: #5b4343;
  box-shadow: inset 3px 0 0 var(--danger);
}

.summary > div:nth-child(2) strong {
  color: #ffb0aa;
}

.chat-cta {
  border-color: #57483c;
}

.contact-intro {
  border-left: 4px solid var(--warning);
}

.notice p {
  background: #fff3e8;
  border-top: 1px solid #f0d3bc;
  border-right: 1px solid #f0d3bc;
  border-bottom: 1px solid #f0d3bc;
}

@media (max-width: 560px) {
  .gate-title-row {
    gap: 12px;
  }

  .emergency-beacon {
    padding: 6px 8px;
  }

  .beacon {
    width: 14px;
    height: 14px;
  }
}
