/* Base */
:root{
  --bg: #ffffff;
  --panel: #f8fafc; /* light panel */
  --text: #0f172a;  /* slate-900 */
  --muted: #64748b; /* slate-500 */
  --border: rgba(2,6,23,0.08); /* slate-950 @8% */
  --brand1: #2563eb; /* blue-600 */
  --brand2: #0ea5e9; /* sky-500 */
  --brand3: #38bdf8; /* sky-400 */
  --radius: 16px;
  /* extended tokens */
  --text-600: #475569;
  --line-strong: #e2e8f0;
  --brand-primary: #4f46e5; /* indigo */
  --brand-accent: #06b6d4; /* cyan */
  --brand-gold: #d4af37;   /* premium accent */
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: 'Noto Sans KR', ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Apple SD Gothic Neo, sans-serif;
  color:var(--text);
  background: var(--bg);
  display:flex;
  min-height:100svh;
  flex-direction:column;
  -moz-osx-font-smoothing: grayscale;
}

.container{width:min(1200px, 92%); margin-inline:auto}
  .btn{display:inline-flex;align-items:center;justify-content:center;padding:12px 18px;border-radius:12px;background:#fff;border:1px solid var(--border);color:var(--text);text-decoration:none}
  .btn:not(.primary):hover{background:#f9fafb}
  .btn.primary{background: var(--brand-primary); border-color: var(--brand-primary); color:#fff}

/* Headings refinement */
  .bg-orbs{display:none}
h2,h3{font-weight:700}
  .card{border-radius:12px; overflow:hidden; text-decoration:none; color:var(--text); border:1px solid var(--border); background:#fff; transition: transform .2s ease}
  .card:hover{transform: translateY(-2px)}
/* Header */
  .step .step-num{width:32px;height:32px;border-radius:50%;display:flex;align-items:center;justify-content:center;border:1px solid var(--border); color:var(--text); font-weight:700; margin-bottom:10px}
.header-inner{display:flex;align-items:center;justify-content:space-between;padding:14px 0}
.logo{display:flex;align-items:center;gap:10px;color:var(--text);text-decoration:none;font-weight:800;letter-spacing:-0.2px}
/* Compact responsive logo: small by default, scales up on larger viewports */
.logo-img{width:96px; height:auto; max-width:100%; max-height:56px; display:block; object-fit:contain}
.logo-text{font-size:18px; font-weight:800; display:inline-block}
.logo-mark{filter: drop-shadow(0 2px 6px rgba(124,77,255,0.35))}
.nav-toggle{display:none;background:transparent;color:var(--text);border:0;padding:8px 10px;border-radius:10px;font-size:22px;line-height:1}
.menu{display:flex;gap:18px;list-style:none;margin:0;padding:0}
.menu a{display:block;padding:10px 14px;border-radius:12px;text-decoration:none;color:var(--text);border:1px solid transparent}
.menu a:not(.btn):hover{background:rgba(15,23,42,0.06);border-color:var(--border)}
.menu .menu-search{padding:0 6px}
.search-form{position:relative; display:flex; align-items:center}
.search-input{flex:1; min-width:140px; padding-right:36px}
.search-btn{position:absolute; right:8px; background:transparent; border:0; padding:6px; display:flex; align-items:center; justify-content:center; color:var(--muted); cursor:pointer}
.search-btn:hover{color:var(--text)}
  .accent-underline{ box-shadow: inset 0 -2px 0 0 var(--brand-primary); padding-bottom:2px }
@media (max-width: 820px){
  .nav-toggle{display:block}
  /* off-canvas menu */
  .menu{position:fixed; right:0; top:0; height:100vh; width:min(84%, 320px); background:#fff; border-left:1px solid var(--border); padding:18px; display:flex; flex-direction:column; gap:6px; transform: translateX(100%); transition: transform .25s ease; z-index:1001;}
  .menu.open{transform: translateX(0)}
  .menu a{padding:12px 14px}
  .menu .menu-search{padding:0}
  .search-input{min-width:0}
  /* overlay element (below menu; appears only when menu opens) */
  .menu-overlay{position:fixed; inset:0; background:rgba(0,0,0,0.35); z-index:1000}
}

/* Responsive logo adjustments */
@media (min-width: 900px){
  .logo-img{width:120px; max-height:80px}
}
@media (min-width: 1200px){
  .logo-img{width:160px; max-height:96px}
}
@media (max-width: 520px){
  /* Make logo more visible on small screens */
  .logo-img{width:120px; max-height:72px}
  .logo-text{font-size:12px}
}

.hero{position:relative; padding:96px 0 24px}
.hero .headline{font-size:clamp(30px, 4.4vw, 56px); line-height:1.08; margin:8px 0 14px; letter-spacing:-0.5px}
.hero .subhead{font-size:clamp(15px, 2vw, 18px); color:var(--muted); margin:0 0 28px}

/* Accent underline for premium touch */
.accent-underline{
  background: linear-gradient(to right, var(--brand-primary), var(--brand-accent));
  background-size: 100% 2px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  padding-bottom: 2px;
}
.cta-row{display:flex; gap:12px; flex-wrap:wrap}
.btn{display:inline-flex;align-items:center;justify-content:center;padding:12px 18px;border-radius:12px;background:var(--panel);border:1px solid var(--border);color:var(--text);text-decoration:none}
.btn.primary{background:linear-gradient(135deg, var(--brand1), var(--brand3)); border-color:transparent; color:#fff}
.btn.primary:hover{background:linear-gradient(135deg, var(--brand1), var(--brand3)); border-color:transparent; color:#fff; box-shadow: 0 6px 18px rgba(37,99,235,0.22)}

/* Orbs */
.bg-orbs{position:absolute;inset:0;overflow:hidden;pointer-events:none}
.bg-orbs span{position:absolute;width:360px;height:360px;border-radius:50%;filter: blur(60px);opacity:0.12;animation: float 12s ease-in-out infinite}
.bg-orbs span:nth-child(1){left:-80px;top:-40px;background: radial-gradient(circle at 30% 30%, var(--brand1), transparent 60%)}
.bg-orbs span:nth-child(2){right:10%;top:20%;background: radial-gradient(circle at 60% 40%, var(--brand2), transparent 60%);animation-delay: -4s}
.bg-orbs span:nth-child(3){left:20%;bottom:-20%;background: radial-gradient(circle at 40% 60%, var(--brand3), transparent 60%);animation-delay: -8s}
@keyframes float{0%,100%{transform:translateY(0)}50%{transform:translateY(-16px)}}

/* Sections */
.section{padding:26px 0 80px}
.section-title{font-size:22px;margin:18px 0 18px}
.grid.cards{display:grid; grid-template-columns: repeat(4, 1fr); gap:16px}
@media (max-width: 900px){.grid.cards{grid-template-columns: repeat(2, 1fr)}}
/* @media (max-width: 580px){.grid.cards{grid-template-columns: 2fr}} */
.card{border-radius:var(--radius); overflow:hidden; text-decoration:none; color:var(--text); border:1px solid var(--border); background:#fff; transition: transform .25s ease, box-shadow .25s ease}
.card:hover{transform: translateY(-4px); box-shadow: 0 10px 28px rgba(15,23,42,0.10)}
.card-media{height:160px; background-size:contain; background-position:center; background-repeat:no-repeat; background-color:#fff}

@media (min-width: 900px) {
  /* PC 환경에서 상품 목록의 대표 이미지 높이를 조금 작게 조정 */
  .card-media{height:140px}
}
.card-body{padding:16px}

/* Square thumbnail with no crop - fully visible image */
.square-thumb{
  width:100%; 
  padding-top:100%; 
  position:relative; 
  background-size:contain !important; 
  background-position:center !important; 
  background-repeat:no-repeat !important;
  background-color:#fff;
}

/* Product detail page layout */
.product-detail-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: start;
}

@media (min-width: 768px) {
  .product-detail-layout {
    grid-template-columns: 400px 1fr;
    gap: 32px;
  }
}

@media (min-width: 1024px) {
  .product-detail-layout {
    grid-template-columns: 480px 1fr;
    gap: 40px;
  }
}

.product-image-section {
  width: 100%;
}

.product-main-image {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  aspect-ratio: 1 / 1;
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: #f8fafc;
  border: 1px solid var(--border);
}

.product-image-inner {
  position: absolute;
  inset: 0;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
}

.product-info-section {
  width: 100%;
}

/* Color tiles for apply page */
.color-tiles-grid{display:flex; gap:12px; flex-wrap:wrap; margin-top:8px}
.color-tile{width:88px; text-align:center; cursor:pointer; border-radius:12px; padding:8px; border:1px solid transparent}
.color-tile .img{width:64px; height:64px; margin:0 auto 8px; border-radius:8px; background-size:cover; background-position:center; background-repeat:no-repeat}
.color-tile .label{font-size:13px; color:var(--text-600)}
.color-tile.selected{border-color:var(--brand-primary); box-shadow: 0 6px 18px rgba(79,70,229,0.12)}

/* Option tiles for carriers, contracts, installments */
.option-tiles-grid{display:flex; gap:10px; flex-wrap:wrap; margin-top:6px}
.option-tile{
  padding:10px 16px; 
  border-radius:10px; 
  border:1px solid var(--border); 
  background:#fff; 
  cursor:pointer; 
  font-size:14px; 
  color:var(--text); 
  transition: all 0.2s ease;
  text-align:center;
  min-width:70px;
}
.option-tile:hover{background:var(--panel)}
.option-tile.selected{
  border-color:var(--brand-primary); 
  background:rgba(79,70,229,0.05); 
  color:var(--brand-primary); 
  font-weight:600;
  box-shadow: 0 4px 12px rgba(79,70,229,0.1);
}

/* Technical spec chips */
.specs{display:flex; gap:6px; flex-wrap:wrap; margin-top:6px}
.spec-chip{font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size:12px; color:var(--text-600); background:var(--panel); border:1px solid var(--border); border-radius:999px; padding:2px 8px}

/* Spec table (detail) */
.spec-table{width:100%; border-collapse:collapse}
.spec-table tr{border-top:1px solid var(--line-strong)}
.spec-table td{padding:10px 4px; vertical-align:top}
.spec-label{font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; color:var(--text-600); width:28%}
.spec-value{color:var(--text)}

/* Section divider */
.divider{height:1px;background:var(--line-strong);opacity:.7;margin:24px 0}

/* Mono small */
.mono{font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace}

/* Trust bar */
.trust-inner{display:flex;justify-content:center;gap:18px;margin:24px auto;max-width:1200px;flex-wrap:wrap}
.trust-card{background:linear-gradient(135deg,#f1f8ff,#e2f3ff);border-radius:16px;padding:20px;display:flex;flex-direction:column;align-items:center;box-shadow:0 2px 12px rgba(37,99,235,0.06);flex:0 0 220px;max-width:280px;height: 210px;}

.trust-icon{font-size:32px;}

/* Full-bleed hero banner */
.hero-banner{position:relative;width:100%;overflow:hidden; min-height: 420px;; max-width:100%; display:block}
.hero-banner picture, .hero-banner img.hero-banner-img{display:block;width:100%;height:420px;}
.hero-banner img.hero-banner-img{object-fit:cover}

/* Mobile: 720x500 target size -> set height 500px for small viewports */
@media (max-width: 899px){
  .hero-banner{min-height:500px !important}
}
.hero-banner-overlay{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;pointer-events:none}
.hero-banner-content{background:linear-gradient(90deg, rgba(2,6,23,0.6), rgba(2,6,23,0.2));padding:24px;border-radius:12px;color:#fff;pointer-events:auto;text-align:center; display: none;}
.hero-banner-content h2{margin:0;font-size:28px}
.hero-banner-content p{margin:6px 0 0}
@media (min-width:900px){.hero-banner img.hero-banner-img{height:420px}}
@media (max-width:420px){.hero-banner img.hero-banner-img{height:240px}}
/* Ensure mobile shows image bottom (avoid cropping important lower parts) */
@media (max-width: 899px) {
  .hero-banner img.hero-banner-img,
  .hero-slide img {
    object-position: bottom center;
  }
}
.hero-slider{position:relative}
.hero-slides{position:relative}
.hero-slides-inner{display:flex; width:100%; will-change:transform}
.hero-slide{flex:0 0 auto; display:block}
.hero-slide img{width:100%;height:360px;object-fit:cover;display:block}
.hero-prev,.hero-next{position:absolute;top:50%;transform:translateY(-50%);z-index:30; background: transparent; color: rgba(255,255,255,0.95); border:0; padding:6px; border-radius:0; cursor:pointer; font-size:20px; line-height:1}
.hero-prev{left:8px}
.hero-next{right:8px}
.hero-prev:hover,.hero-next:hover{opacity:0.9}
.hero-indicators{position:absolute;left:50%;transform:translateX(-50%);bottom:14px;display:flex;gap:8px;z-index:30}
.hero-indicator{width:10px;height:10px;border-radius:999px;border:0;background:rgba(255,255,255,0.5);opacity:0.9;cursor:pointer}
.hero-indicator.active{background:#fff; box-shadow:0 4px 12px rgba(0,0,0,0.12)}


@media (min-width:900px){
  .hero-slide img{height:420px}
}
@media (max-width:420px){
  .hero-slide img{height:240px}
}

 .trust{
      margin-top: -30px;
    }
.trust-title{font-weight:700;font-size:16px;margin-top:8px;}
.trust-desc{color:var(--muted);font-size:13px;margin-top:4px;text-align:center;}

@media (max-width:1650px){
  .trust{
      margin-top: -50px;
    }
}

 
@media (max-width:1500px){
  .trust{
      margin-top: -120px;
    }
}




@media (max-width:1100px){
  .trust{
      margin-top: -200px;
    }
}


@media (max-width:900px){
  
  .trust-inner{justify-content:center}

.trust{
    margin-top: 0px;
  }
}

/* 모바일에서 trust 항목을 한 줄에 2개씩 보이도록 그리드 설정 */
@media (max-width:600px){


  .trust{
    margin-top: -150px;
  }
  
  .trust-inner{
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    justify-items: stretch;
    align-items: start;
    margin: 12px auto;
    max-width: 540px;
  }
  .trust-card{
    flex: none;
    width: 100%;
    max-width: 100%;
    
    padding: 16px;
    box-shadow: 0 2px 10px rgba(37,99,235,0.05);
  }
}

/* Steps */
.step .step-num{width:36px;height:36px;border-radius:50%;display:flex;align-items:center;justify-content:center;background:linear-gradient(135deg,var(--brand1),var(--brand3)); color:#fff; font-weight:700; margin-bottom:10px}
.steps-grid{display:grid; gap:16px; grid-template-columns: 1fr}
@media (min-width: 900px){ .steps-grid{ grid-template-columns: repeat(3, 1fr) } }

/* Home category blocks */
.home-cat{margin-bottom:22px}
.home-cat-head{display:flex; align-items:center; justify-content:space-between; margin-bottom:10px}
.muted{color:var(--muted)}

/* Price chip & badges */
.price{display:inline-flex; align-items:center; gap:6px; font-weight:700}
.chip{display:inline-flex; align-items:center; padding:4px 8px; border-radius:999px; background:var(--panel); border:1px solid var(--border); font-size:12px; color:var(--text)}

/* Category badge for search results / lists */
.category-badge{
  display:inline-block;
  font-size:12px;
  font-weight:700;
  color:#fff;
  padding:6px 10px;
  border-radius:999px;
  line-height:1;
  box-shadow: 0 4px 12px rgba(2,6,23,0.06);
}
/* Category-specific color tokens */
.category-badge.cat-number-porting{ background: linear-gradient(135deg,#16a34a,#4ade80); } /* green */
.category-badge.cat-device-change{ background: linear-gradient(135deg,#7c3aed,#a78bfa); } /* purple */
.category-badge.cat-internet{ background: linear-gradient(135deg,#f97316,#fb923c); } /* orange */
.category-badge.cat-default{ background: var(--brand-primary); }

/* Footer */
.site-footer{border-top:1px solid rgba(2,6,23,0.06); padding:32px 0; background:linear-gradient(180deg,#fbfdff,#f7f8fa)}
#site-footer{margin-top:auto}
.footer-inner{display:flex;align-items:flex-start;justify-content:space-between;gap:20px; flex-wrap:wrap}
.footer-logo{max-width:130px; height:auto; display:inline-block; object-fit:contain}

/* Brand column */
.site-footer .brand{display:flex; flex-direction:column; gap:8px}
.site-footer .logo-text{font-size:18px; font-weight:800}
.footer-admin-link .btn{background:#fff; border:1px solid var(--border); color:var(--text); border-radius:10px}
.footer-admin-link .btn:hover{background:#f8fafc}

/* Info columns */
.footer-info h4{margin:0 0 6px; font-size:15px}
.footer-info p{margin:0 0 6px}

/* Bottom row */
.site-footer .footer-bottom{width:100%; border-top:1px solid var(--line-strong); margin-top:18px; padding-top:12px; display:flex; justify-content:space-between; align-items:center; gap:12px; flex-wrap:wrap}
.site-footer .footer-bottom .muted{font-size:13px}

/* Full-width bottom strip that spans edge-to-edge */
.footer-bottom-full{width:100%; border-top:1px solid var(--line-strong); background: linear-gradient(180deg,#fbfdff,#f7f8fa);}
.footer-bottom-full .footer-bottom-inner{display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px 0}
.footer-bottom-full .footer-bottom-inner > div{color:var(--muted); font-size:13px}
@media (max-width:520px){
  .footer-bottom-full .footer-bottom-inner{flex-direction:column; gap:6px; text-align:center}
}

@media (max-width:800px){
  .footer-inner{padding:12px}
  .footer-info{flex-direction:column; gap:12px}
  .footer-logo{width:56px}
  .site-footer .brand{align-items:flex-start}
}

/* Desktop: use grid to allocate columns for brand / info / contact */
@media (min-width: 900px) {
  .footer-inner{ display: grid; grid-template-columns: 1fr; align-items:start; gap:24px }
  /* Top grid becomes 4 columns aligned to container width */
  .footer-top-grid{ display:grid; grid-template-columns: 220px 1fr 1fr 240px; gap:24px; align-items:start }
  .footer-col.brand{grid-column:1}
  .footer-col:nth-child(2){grid-column:2}
  .footer-col:nth-child(3){grid-column:3}
  .footer-col.footer-contact{grid-column:4; justify-self:end}
}

/* Tablet / small desktop: slightly narrower contact */
@media (min-width: 720px) and (max-width:899px){
  .footer-top-grid{ display:grid; grid-template-columns: 200px 1fr 220px; gap:18px }
}

/* Mobile: stack vertically and make contact full width */
@media (max-width:719px){
  .footer-inner{ display:flex; flex-direction:column; gap:12px }
  .footer-top-grid{ display:flex; flex-direction:column; gap:12px }
  .footer-col{width:100%}
  .brand{order:0}
  .footer-info{order:1}
  .footer-contact{order:2; width:100%; justify-content:flex-start}
  .footer-contact > div{width:100%}
  .footer-admin-link .btn{padding:8px 10px}
}

/* Footer contact box highlight */
.footer-contact > div{display:flex; flex-direction:column; align-items:flex-start}
.footer-contact a{font-weight:700}
.footer-contact .muted{font-size:12px}

/* Phone link + icon styles */
.footer-phone-link{display:inline-flex;align-items:center;gap:8px;color:var(--text);text-decoration:none}
.footer-phone-icon{width:20px;height:20px;flex:0 0 20px;color:var(--brand-primary)}
.footer-contact-number-text{font-weight:700;font-size:16px}
.footer-phone-link:focus,.footer-phone-link:hover{outline:2px solid rgba(79,70,229,0.12);border-radius:6px}

@media (max-width:520px){
  .footer-contact{width:100%;}
  .footer-contact > div{width:100%;}
}

/* Reveal */
.reveal{opacity:0; transform: translateY(10px); transition: .5s ease}
.reveal.visible{opacity:1; transform:none}

/* Loading skeleton shimmer animation */
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.loading-skeleton {
  animation: pulse 1.5s ease-in-out infinite;
}

/* Forms */
input, textarea, select{
  width:100%;
  padding:12px 12px;
  border-radius:12px;
  border:1px solid var(--border);
  background: #fff;
  color: var(--text);
}
label{display:block; margin:0 0 6px; font-size:13px; color:var(--muted)}
input:focus, textarea:focus, select:focus{outline:none; border-color: rgba(124,77,255,0.45); box-shadow:0 0 0 3px rgba(124,77,255,0.12)}

.carrier-subsidy{border:1px solid var(--border); border-radius:14px; padding:14px; background:#f8fafc; margin-top:4px}
.carrier-subsidy-grid{display:grid; grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); gap:12px}
.carrier-subsidy-row{display:flex; align-items:center; justify-content:space-between; gap:10px; padding:8px 10px; border-radius:10px; background:#fff; border:1px solid rgba(2,6,23,0.06)}
.carrier-subsidy-row span{font-weight:600; color:var(--text)}
.carrier-subsidy-row input{flex:1; min-width:0; text-align:right}
@media (max-width:520px){
  .carrier-subsidy-row{flex-direction:column; align-items:flex-start}
  .carrier-subsidy-row input{width:100%; text-align:left}
}

/* Admin/menu button interactions */
#admin-logged-in .btn,
#admin-logged-out .btn,
.menu .btn{
  cursor: pointer;
}
#admin-logged-in .btn:not(.primary):hover,
#admin-logged-out .btn:not(.primary):hover,
.menu .btn:not(.primary):hover{
  background:#f1f5f9;
}
.bestdeal-Btn{  
  color:#333;
  text-decoration: none;
  font-size: smaller;
}

.bestdeal-Btn:hover{color: #4f46e5; font-weight: 600; }

/* Keep login title non-click look */
#login-title{ cursor: default; }

/* Banner admin drag handle and dragging visuals */
.banner-drag-handle{
  width:44px; height:44px; border-radius:10px; border:1px dashed var(--border); background:transparent; display:inline-flex; align-items:center; justify-content:center; cursor:grab; font-size:18px; color:var(--muted);
}
.banner-drag-handle:active{ cursor:grabbing; }
.banner-row.dragging{opacity:0.6; transform:scale(0.995); box-shadow: 0 8px 24px rgba(15,23,42,0.12)}
.card.dragging{ outline: 2px dashed rgba(79,70,229,0.18); }

/* Tabs active state */
.tabs .btn.active{
  background: linear-gradient(135deg, var(--brand1), var(--brand3));
  color:#fff;
  border-color: transparent;
}
.subtabs .btn.active{
  background: rgba(37,99,235,0.10);
  border-color: rgba(37,99,235,0.35);
  color: var(--text);
}

/* Modal styles */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /* raise modal above other floating UI (chat, kakaotalk buttons, etc.) */
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  /* prevent clicks passing through except on children we enable */
  pointer-events: none;
}
.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  /* ensure overlay captures pointer events and blocks interaction with page beneath */
  pointer-events: auto;
  z-index: 99990;
}
.modal-content {
  position: relative;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  width: 100%;
  max-width: 900px;
  animation: modalSlideIn 0.3s ease;
  /* content must sit above the overlay so it's interactive */
  z-index: 99999;
  /* ensure modal content receives pointer events */
  pointer-events: auto;
}
/* body lock when any modal is open */
body.modal-open { overflow: hidden; }

/* Applications search panel (uses class-based styles instead of inline) */
.applications-search-panel{
  display:block;
  margin-bottom:16px;
  padding:12px;
  background:#f8fafc;
  border:1px solid var(--border);
  border-radius:12px;
}
.applications-search-row{display:flex; gap:8px; align-items:center; flex-wrap:wrap}
.applications-search-input{flex:1; min-width:220px; padding:10px; border:1px solid var(--border); border-radius:10px}
.applications-search-select{padding:10px; border:1px solid var(--border); border-radius:10px}
.applications-search-btn{height:42px}
.applications-search-clear{height:42px}

/* Search highlight */
.search-highlight{ background: #fff59d; padding:0 2px; border-radius:3px; font-weight:600 }

/* Application item styles (moved from inline) */
.application-item{ padding:16px; cursor:pointer; transition: all 0.2s; position:relative; border-radius:8px }
.application-item .app-meta{ display:grid; grid-template-columns: 1fr auto; gap:12px; align-items:start }
.application-item .app-title{ font-weight:600; font-size:14px; color:var(--muted); margin-bottom:4px }
.application-item .app-name{ font-size:18px; font-weight:700; margin-bottom:8px }
.application-item.new-application{ border: 2px solid #fbbf24; box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.1) }
.application-item.deleted-application{ opacity:0.85; background:#f9fafb; border: 1px solid #e5e7eb }
.application-item.deleted-application .app-name{ color:#6b7280 }

@media (max-width:720px){
  .applications-search-row{flex-direction:column; align-items:stretch}
  .applications-search-input{min-width:0}
  .applications-search-select{width:100%}
  .applications-search-btn, .applications-search-clear{width:100%}
  .application-item .app-meta{ grid-template-columns: 1fr }
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid var(--border);
}
.modal-header h2 {
  margin: 0;
}
.modal-header .btn {
  min-width: auto;
  padding: 8px 12px;
  font-size: 18px;
  line-height: 1;
}
@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

/* Chat UI: KakaoTalk-like bubbles for admin and client chats */
.chat-body{display:flex; flex-direction:column; gap:10px;}
.chat-msg{max-width:76%; padding:10px 12px; border-radius:14px; line-height:1.4; position:relative; word-wrap:break-word; box-shadow: 0 2px 8px rgba(15,23,42,0.06);}
.chat-msg .chat-meta{display:block; font-size:12px; color:var(--muted); margin-top:6px}
.chat-msg-self{align-self:flex-end; background:linear-gradient(180deg,#ffe680,#ffd24d); color:#111; border-bottom-right-radius:6px; border-bottom-left-radius:14px; border-top-left-radius:14px; border-top-right-radius:14px}
.chat-msg-other{align-self:flex-start; background:#f2f3f5; color:var(--text); border-bottom-left-radius:6px; border-bottom-right-radius:14px; border-top-left-radius:14px; border-top-right-radius:14px}

/* speech bubble tails */
.chat-msg-self:after, .chat-msg-other:after{content:''; position:absolute; width:12px; height:12px; bottom:6px; transform: rotate(45deg);}
.chat-msg-self:after{right:-6px; background:linear-gradient(180deg,#ffe680,#ffd24d);}
.chat-msg-other:after{left:-6px; background:#f2f3f5}

/* admin chat modal specific adjustments */
#admin-chat-body{background: #fff; padding:16px; display:flex; flex-direction:column; gap:8px}
#admin-chat-body .chat-msg{max-width:72%;}

/* timestamps aligned to right for self messages */
.chat-meta-right{text-align:right; color:var(--muted); font-size:12px; margin-top:6px}

@media (max-width:720px){
  .chat-msg{max-width:84%; padding:10px}
  #admin-chat-body{padding:12px}
}

/* 신규 신청 애니메이션 */
.new-application {
  animation: newAppGlow 2s ease-in-out infinite;
}

@keyframes newAppGlow {
  0%, 100% {
    box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.1);
  }
  50% {
    box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.3);
  }
}

/* 미열람 빨간점 애니메이션 (비활성화됨)
.unread-dot {
  animation: unreadPulse 2s ease-in-out infinite;
}

@keyframes unreadPulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.2);
    opacity: 0.8;
  }
}

.unread-badge {
  animation: unreadPulse 2s ease-in-out infinite;
}
*/

/* Admin banner preview styles (thumbnail previews in admin UI) */
.banner-row{display:flex;gap:12px;align-items:center}

/* desktop preview: wide banner (approx 1920x600 -> ratio ~3.2:1) */
.banner-row.desktop .banner-preview-img,
.banner-row.desktop .banner-placeholder{
  width:240px; /* thumbnail width */
  height:75px; /* wide and short */
  border-radius:8px; overflow:hidden;
}

/* mobile preview: taller banner (approx 720x500 -> ratio ~1.44:1) */
.banner-row.mobile .banner-preview-img,
.banner-row.mobile .banner-placeholder{
  width:160px; /* smaller width */
  height:110px; /* taller area */
  border-radius:8px; overflow:hidden;
}

.banner-preview-img{display:block;width:100%;height:100%;object-fit:cover}
.banner-placeholder{display:flex;align-items:center;justify-content:center;color:var(--muted);font-size:13px}

/* Debug helper: when body.admin-debug is present, force-show admin login area so you can sign in
  This is temporary and non-destructive; removed automatically when admin logs in. */
body.admin-debug #admin-logged-out,
body.admin-debug #login-form { display: block !important; }
body.admin-debug #tabs-top { display: none !important; }

/* While auth session is being checked, hide both admin panels to avoid flicker.
  JS will add `body.admin-loading` at script load and remove it after auth resolves. */
body.admin-loading #admin-logged-in,
body.admin-loading #admin-logged-out { display: none !important; }

/* Admin loading indicator (spinner) */
.loader-ring{display:inline-block; position:relative; width:64px; height:64px}
.loader-ring div{box-sizing:border-box; display:block; position:absolute; width:48px; height:48px; margin:8px; border:4px solid var(--brand-primary); border-radius:50%; animation: loader-anim 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite; border-color: var(--brand-primary) transparent transparent transparent}
.loader-ring div:nth-child(1){animation-delay:-0.45s}
.loader-ring div:nth-child(2){animation-delay:-0.3s}
.loader-ring div:nth-child(3){animation-delay:-0.15s}

@keyframes loader-anim{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}

body.admin-loading #admin-loading-indicator { display: block !important; }

/* --- Chat list unread / admin meta styles --- */
/* Card-level unread highlight when a client message arrived and admin hasn't viewed */
.card[data-unread="1"]{
  box-shadow: 0 10px 30px rgba(239,68,68,0.06);
  border-color: rgba(239,68,68,0.12);
  transition: box-shadow .25s ease, border-color .25s ease, transform .2s ease;
}
.chat-card-left { display:flex; flex-direction:column; gap:6px }
.chat-card-left > div:first-child{ display:flex; align-items:center; gap:8px; font-weight:600 }
.chat-card-left .muted{ color:var(--muted); font-size:13px }

/* small red dot used to indicate unread on cards */
.unread-dot{ display:inline-block; width:10px; height:10px; border-radius:50%; background:#ef4444; box-shadow:0 0 0 4px rgba(239,68,68,0.08); transition: transform .18s ease, opacity .18s ease }
.card[data-unread="1"] .unread-dot{ transform: scale(1); opacity:1 }
.card[data-unread="0"] .unread-dot{ transform: scale(0.6); opacity:0 }

/* Admin chat meta area styling inside modal */
#admin-chat-meta{ padding:12px 16px; background: #fbfbfd; border-top:1px solid var(--border); display:flex; gap:12px; align-items:flex-start }
#admin-chat-meta label{ font-size:12px; color:var(--muted); margin:0 }
#admin-chat-roomname{ max-width:320px; padding:8px 10px; border-radius:8px }
#admin-chat-memo{ min-height:72px; padding:10px; border-radius:8px }
#admin-chat-save-meta{ align-self:flex-start; height:40px; padding:8px 12px }

@media (max-width:720px){
  #admin-chat-meta{ flex-direction:column; gap:8px }
  #admin-chat-roomname{ max-width:100% }
  #admin-chat-save-meta{ align-self:flex-end }
}

/* Dashboard summary: icons, colors, responsive */
.dashboard-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap:12px; }
.dashboard-summary .card { display:flex; gap:12px; align-items:center; padding:14px; border-radius:12px; }
.dashboard-icon { width:44px; height:44px; border-radius:10px; display:flex; align-items:center; justify-content:center; color:#fff; flex:0 0 44px; box-shadow: 0 8px 24px rgba(2,6,23,0.06); }
.dashboard-content { flex:1; min-width:0 }
.dashboard-kicker { font-size:13px; color:var(--muted) }
.dashboard-value { font-size:20px; font-weight:800; margin-top:6px }
.dashboard-sub { margin-top:6px; font-size:13px; color:var(--muted) }

/* Color themes for each card */
.dash-total .dashboard-icon { background: linear-gradient(135deg,#4f46e5,#7c3aed); }
.dash-apps .dashboard-icon { background: linear-gradient(135deg,#0ea5e9,#06b6d4); }
.dash-today .dashboard-icon { background: linear-gradient(135deg,#10b981,#34d399); }
.dash-visitors .dashboard-icon { background: linear-gradient(135deg,#f97316,#fb923c); }

/* Hide visitor statistics cards on dashboard as requested */
.dashboard-summary .dash-today,
.dashboard-summary .dash-visitors {
  display: none !important;
}

/* Kakao channel card: chat/talk 느낌 (background yellow, dark text icon) */
.dash-kakao .dashboard-icon { background: #FEE500; color: #111; }
.dash-kakao { cursor: pointer; }

/* Small yellow badge for new applications on dashboard card */
.dashboard-new-badge{
  position:absolute;
  top:8px;
  right:10px;
  width:12px;
  height:12px;
  border-radius:50%;
  background: #f59e0b; /* amber-500 */
  box-shadow: 0 0 0 6px rgba(245,158,11,0.10);
  z-index: 5;
}

/* New: red outline for applications card when there are new items (replaces small badge) */
.card.dash-apps.has-new-outline{
  /* full-strength red highlight */
  border-color: #ef4444; /* solid red border */
  box-shadow: 0 18px 40px rgba(239,68,68,0.24); /* pronounced red glow */
  /* solid red outer ring for maximum visibility */
  outline: 3px solid rgba(239,68,68,0.28);
  outline-offset: 3px;
  position: relative;
}

/* Optional subtle animated pulse if you want stronger attention (disabled by default)
.card.dash-apps.has-new-outline.pulse {
  animation: newAppPulse 1.8s ease-in-out infinite;
}
@keyframes newAppPulse {
  0% { box-shadow: 0 18px 40px rgba(239,68,68,0.10); }
  50% { box-shadow: 0 22px 52px rgba(239,68,68,0.16); }
  100% { box-shadow: 0 18px 40px rgba(239,68,68,0.10); }
}

/* smaller icon for compact screens */
@media (max-width:480px){
  .dashboard-icon{ width:40px; height:40px; flex:0 0 40px }
  .dashboard-value{ font-size:18px }
}

/* mobile: stack dashboard summary vertically with comfortable spacing */
@media (max-width:640px){
  .dashboard-summary { grid-template-columns: 1fr; }
  #tab-dashboard { padding:12px }
}

/* Applications tab new-item highlight */
.tabs .btn.has-new{ position:relative; }
.tabs .btn.has-new::after{
  content: '';
  position: absolute;
  top: 6px;
  right: 8px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ef4444; /* red */
  box-shadow: 0 0 0 6px rgba(239,68,68,0.12);
}
@keyframes tabBadgePulse {
  0%{ transform: scale(1); }
  50%{ transform: scale(1.08); }
  100%{ transform: scale(1); }
}
.tabs .btn.has-new::after{ animation: tabBadgePulse 1.6s ease-in-out infinite; }

