:root{
  --bg: #faf7f2;
  --card: #ffffff;
  --card-2: #f4f0e8;
  --line: #ddd6c9;
  --line-strong: #b9ae99;
  --ink: #241f1a;
  --ink-dim: #6b6257;
  --accent: #cf5a2b;
  --accent-dark: #a8461e;
  --success: #2f8f5b;
  --success-dark: #1f6e44;
}
*{ box-sizing:border-box; margin:0; padding:0; }
body{
  background: var(--bg);
  color: var(--ink);
  font-family: 'Noto Sans KR', 'Noto Sans JP', 'Noto Sans SC', 'Noto Sans', sans-serif;
  min-height: 100vh;
  display:flex;
  align-items:flex-start;
  justify-content:center;
  padding: max(20px, env(safe-area-inset-top)) 18px max(24px, env(safe-area-inset-bottom)) 18px;
  font-size: 16px;
  line-height: 1.6;
}
@media (max-width: 480px){
  body{
    padding: max(14px, env(safe-area-inset-top)) 14px max(20px, env(safe-area-inset-bottom)) 14px;
  }
}
.app{ width: 100%; max-width: 460px; }
.brand{ text-align:center; margin-bottom: 24px; transition: margin 0.15s ease; }
.brand-mark{
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-dark);
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}
.brand h1{
  font-weight:700;
  font-size: 30px;
  color: var(--ink);
  transition: font-size 0.15s ease;
}
.brand p{ color: var(--ink-dim); font-size: 15px; margin-top: 10px; line-height:1.6; }
.app.is-sub .brand{ margin-bottom: 12px; }
.app.is-sub .brand p{ display: none; }
.app.is-sub .brand h1{ font-size: 22px; }
.app.is-sub .brand-mark{ font-size: 12px; margin-bottom: 2px; }
.top-nav{
  margin: -6px 0 16px;
}
.top-nav .navrow{
  margin-top: 0;
  gap: 0;
}
.top-nav .navlink{
  flex: 1;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  padding: 11px 8px;
  background: var(--card);
  border: 1px solid var(--line);
  min-height: 44px;
}
.top-nav .navlink:first-child{
  border-radius: 10px 0 0 10px;
  border-right: none;
}
.top-nav .navlink:last-child{
  border-radius: 0 10px 10px 0;
}
.top-nav .navlink:hover{ color: var(--accent-dark); background: var(--card-2); }
.top-nav .navlink.is-active{
  color: var(--accent-dark);
  background: var(--card-2);
  box-shadow: inset 0 -2px 0 var(--accent);
}
.top-nav .navsep{ display: none; }
.card{
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px 24px;
  position: relative;
  box-shadow: 0 4px 16px rgba(36,31,26,0.06);
}
.label{
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 10px;
}
.label-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.label-row .label{ margin-bottom: 0; flex: 1; min-width: 0; }
.top-bar{
  margin: -4px 0 14px;
}
.top-back{
  appearance: none;
  border: none;
  background: transparent;
  color: var(--ink-dim);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 6px 0;
  cursor: pointer;
  min-height: 36px;
}
.top-back:hover{ color: var(--accent-dark); }
.loc-chip{
  flex-shrink: 0;
  appearance: none;
  border: 1px solid var(--line-strong);
  background: var(--card-2);
  color: var(--ink-dim);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
  max-width: 42%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 32px;
}
.loc-chip.is-on{
  border-color: var(--success);
  color: var(--success-dark);
  background: #eef7f1;
}
.loc-chip:disabled{ opacity: 0.5; cursor: not-allowed; }
textarea{
  width: 100%;
  background: var(--card-2);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  font-family: 'Noto Sans KR', sans-serif;
  font-size: 17px;
  line-height:1.7;
  padding: 16px;
  resize: none;
  min-height: 140px;
}
textarea::placeholder{ color: var(--ink-dim); }
textarea:focus, input:focus{ outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
input[type=text]{
  width:100%;
  background: var(--card-2);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  font-family:'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 0.15em;
  text-align:center;
  padding: 16px;
  text-transform: uppercase;
  min-height: 54px;
}
.btn{
  width:100%;
  border: none;
  border-radius: 12px;
  padding: 16px;
  font-family: 'Noto Sans KR', sans-serif;
  font-weight:700;
  font-size: 16px;
  cursor:pointer;
  margin-top: 12px;
  min-height: 54px;
  transition: transform 0.1s ease, opacity 0.1s ease;
}
.btn:active{ transform: scale(0.98); }
.btn-primary{ background: var(--accent); color: #fff; }
.btn-primary:hover{ background: var(--accent-dark); }
.btn-ghost{ background: var(--card); color: var(--ink); border: 1.5px solid var(--line-strong); }
.btn-ghost:hover{ background: var(--card-2); }
.btn-jade{ background: var(--success); color: #fff; }
.btn-jade:hover{ background: var(--success-dark); }
.btn:disabled{ opacity:0.4; cursor:not-allowed; }
.divider{
  display:flex; align-items:center; gap:12px;
  color: var(--ink-dim); font-size:14px; margin: 22px 0;
}
.divider::before, .divider::after{ content:''; flex:1; height:1px; background: var(--line); }
.msg-quote{
  font-family: 'Noto Sans KR', sans-serif;
  font-size: 19px;
  font-weight: 500;
  line-height: 1.75;
  color: var(--ink);
  padding: 20px 18px;
  background: var(--card-2);
  border-left: 4px solid var(--accent);
  border-radius: 4px;
  margin: 10px 0 18px;
}
.thread{ display:flex; align-items:center; gap:6px; margin: 6px 0 20px; flex-wrap: wrap; }
.dot{ width:13px; height:13px; border-radius:50%; background: var(--line); }
.dot.filled{ background: var(--accent); }
.dot.origin{ background: var(--ink); }
.dot.returned{ background: var(--success); }
.seg{ width:16px; height:2px; background: var(--line-strong); }
.meta-row{
  display:flex; justify-content:space-between;
  font-size: 15px; color: var(--ink-dim);
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.meta-row:last-child{ border-bottom:none; }
.meta-row b{ color: var(--ink); font-weight:700; }
.back{ text-align:center; margin-top:20px; color: var(--ink-dim); font-size: 15px; cursor:pointer; font-weight: 500; padding: 10px; }
.back:hover{ color: var(--accent-dark); }
.toast{
  position:fixed; bottom:28px; left:50%; transform:translateX(-50%);
  background: var(--ink); color: #fff;
  padding: 12px 22px; border-radius: 10px; font-size:15px; font-weight: 500;
  opacity:0; transition: opacity 0.25s ease; pointer-events:none;
}
.toast.show{ opacity:1; }
.status-pill{
  display:inline-block; font-size:13px; padding: 5px 12px; border-radius: 20px;
  font-weight:700;
}
.pill-active{ background: #fbe6da; color: var(--accent-dark); }
.pill-returned{ background: #dcf0e5; color: var(--success-dark); }
.pill-waiting{ background: #eae5da; color: var(--ink-dim); }
.hint{
  text-align:center;
  font-size: 13px;
  color: var(--ink-dim);
  margin-top: 8px;
}
.loc-start-hint{
  margin-top: 8px;
  text-align: center;
  color: var(--ink-dim);
  font-size: 12px;
  line-height: 1.5;
  word-break: keep-all;
}
.group-head{
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  margin: 22px 0 4px;
  display:flex; align-items:center; gap:8px;
}
.group-head:first-child{ margin-top: 0; }
.group-count{
  font-size: 12px; font-weight:700;
  background: var(--card-2); color: var(--ink-dim);
  border-radius: 20px; padding: 2px 9px;
}
.chain-top{ display:flex; justify-content:space-between; align-items:center; gap:8px; }
.chain-meta{ font-size: 12.5px; color: var(--ink-dim); }
.missing-note{
  font-size: 13px; color: var(--ink-dim);
  text-align:center; padding: 16px 0 4px;
  border-top: 1px solid var(--line); margin-top: 16px;
}
.chain-item{ padding: 16px 0; border-bottom: 1px solid var(--line); cursor:pointer; }
.chain-item:last-child{ border-bottom:none; }
.chain-item .msg-preview{
  font-family: 'Noto Sans KR', sans-serif;
  font-size:16px; margin: 8px 0 4px; color: var(--ink);
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.empty{ text-align:center; color: var(--ink-dim); font-size:15px; padding: 30px 0; }
.glow-ring{
  width:76px; height:76px; border-radius:50%;
  background: #dcf0e5;
  border: 2px solid var(--success);
  display:flex; align-items:center; justify-content:center;
  margin: 4px auto 18px;
  font-weight: 700;
  font-size: 13px;
  color: var(--success-dark);
  text-align: center;
  line-height: 1.3;
}
.spinner{ text-align:center; color:var(--ink-dim); font-size:15px; padding: 30px 0; }
.city-trail{
  font-size: 14px;
  color: var(--ink-dim);
  text-align:center;
  padding: 12px 10px;
  margin-top: 8px;
  background: var(--card-2);
  border-radius: 10px;
  line-height: 1.6;
  word-break: keep-all;
}
.help-steps{
  display:flex; flex-direction:column; gap:8px;
  margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line);
}
.help-steps div{ font-size: 14px; color: var(--ink-dim); }
.help-steps b{ color: var(--ink); font-weight:700; }
.pass-quiet{
  color: var(--accent-dark) !important;
  font-weight: 700;
}
.sender-warn{
  color: var(--ink) !important;
  background: #fbe6da;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13.5px !important;
  line-height: 1.55;
}
.suggest-wrap{ margin-top: 12px; }
.suggest-label{ font-size: 13px; color: var(--ink-dim); margin-bottom: 8px; }
.suggest-chips{ display:flex; flex-wrap:wrap; gap:8px; }
.suggest-chip{
  background: var(--card-2);
  border: 1.5px solid var(--line);
  border-radius: 20px;
  padding: 9px 14px;
  font-size: 13.5px;
  color: var(--ink);
  cursor:pointer;
}
.suggest-chip:hover{ border-color: var(--accent); color: var(--accent-dark); }
.suggest-more{
  background: transparent; border:none; color: var(--ink-dim);
  font-size: 13px; text-decoration: underline; cursor:pointer;
  margin-top: 10px; padding: 4px;
}
.distance-text{
  text-align:center;
  font-size: 15px;
  font-weight: 700;
  color: var(--accent-dark);
  margin: 4px 0 10px;
}
.map-box{
  height: 220px;
  width: 100%;
  border-radius: 12px;
  margin-top: 4px;
  border: 1px solid var(--line);
  background: var(--card-2);
  z-index: 0;
  cursor: pointer;
}
.map-wrap{ position: relative; margin-top: 4px; }
.map-expand{
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 10px 12px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--accent-dark);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.map-expand:hover{ border-color: var(--accent); }
.map-note{
  margin-top: 8px;
  font-size: 12px;
  color: var(--ink-dim);
  line-height: 1.5;
  text-align: center;
}
.map-empty{
  text-align:center; font-size:13px; color:var(--ink-dim);
  padding: 14px 0; margin-top:4px;
}
body.map-modal-open{ overflow: hidden; }
.map-modal{
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(36,31,26,0.55);
  display: flex;
  flex-direction: column;
  padding: 12px;
}
.map-modal[hidden]{ display: none !important; }
.map-modal-bar{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--card);
  border-radius: 12px 12px 0 0;
  padding: 12px 14px;
}
.map-modal-title{ font-size: 15px; font-weight: 700; color: var(--ink); }
.map-modal-close{
  border: 1px solid var(--line);
  background: var(--card-2);
  border-radius: 8px;
  padding: 8px 12px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
}
.map-modal-map{
  flex: 1;
  min-height: 60vh;
  background: var(--card-2);
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
}
.map-modal-note{
  background: var(--card);
  border-radius: 0 0 12px 12px;
  padding: 10px 14px 12px;
  font-size: 12px;
  color: var(--ink-dim);
  line-height: 1.5;
  text-align: center;
}
.center{ text-align:center; }
.msg-quote.muted{ opacity: 0.72; }
.about{
  margin-top: 22px;
  padding: 18px 16px;
  background: var(--card-2);
  border-radius: 12px;
  display:flex; flex-direction:column; gap:9px;
}
.about-title{ font-size:14px; font-weight:700; color: var(--ink); }
.about div{ font-size: 14px; color: var(--ink-dim); line-height:1.65; }
.about b{ color: var(--ink); font-weight:700; }
.about-foot{ font-size:13px !important; padding-top:4px; border-top:1px solid var(--line); }
.gone-note{
  text-align:center; font-size:15px; color: var(--ink-dim);
  line-height:1.7; padding: 16px 4px 4px;
}

/* 공통 내비게이션 */
.navrow{
  display:flex; align-items:center; justify-content:center; gap:10px;
  margin-top: 20px;
}
.navlink{
  color: var(--ink-dim); font-size: 15px; font-weight: 500;
  cursor:pointer; padding: 10px 4px;
}
.navlink:hover{ color: var(--accent-dark); }
.navsep{ color: var(--line-strong); }

/* 구경 페이지 */
.board-stats{
  display:flex; gap:8px; margin-bottom: 14px;
}
.stat{
  flex:1; background: var(--card-2); border-radius: 12px;
  padding: 14px 6px; text-align:center;
}
.stat b{
  display:block; font-size: 22px; font-weight:700;
  color: var(--accent-dark); line-height:1.2;
}
.stat span{ font-size: 12.5px; color: var(--ink-dim); }
.map-big{ height: 300px; }
.rank-item{
  display:flex; align-items:center; gap:12px;
  padding: 13px 0; border-bottom: 1px solid var(--line);
}
.rank-item.is-click{ cursor: pointer; }
.rank-item.is-click:hover .rank-km{ color: var(--accent-dark); }
.rank-item:last-of-type{ border-bottom:none; }
.rank-no{
  flex:none; width:26px; height:26px; border-radius:50%;
  background: var(--card-2); color: var(--ink-dim);
  font-size:13px; font-weight:700;
  display:flex; align-items:center; justify-content:center;
}
.rank-no.rank-hot{ background: var(--accent); color:#fff; }
.rank-body{ flex:1; min-width:0; }
.rank-km{ font-size:15px; font-weight:700; color: var(--ink); }
.rank-route{
  font-size:13px; color: var(--ink-dim); margin-top:2px;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.glow-ring.revisit{
  background: #fbe6da;
  border-color: var(--accent);
  color: var(--accent-dark);
}

/* 푸터·법적 문서·문의·관리 */
.site-foot{
  text-align: center;
  margin-top: 18px;
}
.site-foot a{
  color: var(--ink-dim); font-size: 13px; text-decoration: none;
}
.site-foot a:hover{ color: var(--accent-dark); text-decoration: underline; }
.ad-wrap{
  display:flex; justify-content:center; align-items:center;
  margin: 28px 0 8px;
  min-height: 0;
}
.lang-switch{
  display:flex; justify-content:center; flex-wrap:wrap; gap:6px;
  margin-top: 14px; padding-bottom: 4px;
}
.lang-btn{
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-dim);
  font-family: inherit;
  font-size: 12px;
  padding: 6px 10px;
  cursor: pointer;
}
.lang-btn:hover{ border-color: var(--accent); color: var(--accent-dark); }
.lang-btn.is-on{
  border-color: var(--accent);
  color: var(--accent-dark);
  background: #fbe6da;
}
.sisters{
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.sisters-label{
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ink-dim);
  margin-bottom: 10px;
}
.sisters-grid{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.sis-link{
  display: block;
  text-decoration: none;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--card);
  transition: border-color .15s, background .15s;
}
.sis-link:hover{
  border-color: var(--accent);
  background: #fffaf6;
}
.sis-name{
  display: block;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
}
.sis-desc{
  display: block;
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--ink-dim);
  line-height: 1.4;
  word-break: keep-all;
}
.legal h2{
  font-size: 15px; font-weight: 700; color: var(--ink);
  margin: 22px 0 8px;
}
.legal h2:first-of-type{ margin-top: 0; }
.legal p, .legal li{
  font-size: 14px; color: var(--ink-dim); line-height: 1.7;
}
.legal-lead{ margin-bottom: 8px; }
.legal ul{ padding-left: 1.15em; margin: 6px 0 0; display:flex; flex-direction:column; gap:8px; }
.legal b{ color: var(--ink); font-weight:700; }
.legal code{
  font-family: 'JetBrains Mono', monospace; font-size: 12.5px;
  background: var(--card-2); padding: 1px 5px; border-radius: 4px;
}
.contact-form{ display:flex; flex-direction:column; gap:14px; }
.contact-form label{
  display:flex; flex-direction:column; gap:6px;
  font-size: 13px; font-weight: 700; color: var(--ink);
}
.contact-form input[type=text],
.contact-form input[type=email],
.contact-form input[type=password]{
  width:100%;
  background: var(--card-2);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  font-family: 'Noto Sans KR', sans-serif;
  font-weight: 400;
  font-size: 16px;
  letter-spacing: normal;
  padding: 14px 16px;
}
.contact-form textarea{ min-height: 120px; }
.admin-item{ margin-bottom: 12px; }
.admin-item.is-read{ opacity: 0.78; }
.admin-from{ font-size: 14px; color: var(--ink-dim); margin-top: 6px; }
.admin-from a{ color: var(--accent-dark); }
.admin-actions{ display:flex; gap:8px; margin-top: 14px; }
.btn-sm{ padding: 12px 14px; font-size: 14px; }
a.navlink{ text-decoration:none; }
