/* ============================
   0) 공통 색상 변수
   ============================ */
:root{
  --bg:#020617;
  --card:#020617;

  --text:#ffffff;
  --muted:#d1d5db;

  --brand:#22c55e;
  --accent:#60a5fa;

  --border:#4b5563;
  --chip:#020617;

  --danger:#ef4444;
  --ok:#22c55e;
  --warn:#f59e0b;
}

*{ box-sizing:border-box; }

body{
  margin:0;
  background:
    radial-gradient(1000px 500px at 50% -10%,rgba(34,197,94,.12),transparent),
    var(--bg);
  color:var(--text);
  font-family:"Malgun Gothic","Apple SD Gothic Neo",system-ui,
    -apple-system,Segoe UI,Roboto,Ubuntu,'Noto Sans KR',sans-serif;
}

a{
  color:inherit;
  text-decoration:none;
}

.wrap{
  max-width:1100px;
  margin:24px auto;
  padding:20px;
}


/* ============================
   1) 레이아웃 공통
   ============================ */
.grid{
  display:grid;
  grid-template-columns:minmax(0,2fr) minmax(0,1.4fr);
  gap:16px;
  margin-top:16px;
}
@media(max-width:980px){
  .grid{ grid-template-columns:1fr; }
}

.card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:14px;
  padding:16px;
}
.card h3{
  margin:0 0 12px 0;
  font-size:18px;
}


/* ============================
   2) 카드/폼 공통
   ============================ */
.row{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
}
@media(max-width:720px){
  .row{ grid-template-columns:1fr; }
}

label{
  display:block;
  font-size:12px;
  color:var(--muted);
  margin:6px 0 6px 2px;
}

input[type="text"],
input[type="tel"],
input[type="datetime-local"],
select,
textarea{
  width:100%;
  padding:10px 12px;
  border-radius:10px;
  border:1px solid var(--border);
  background:#0b1020;
  color:var(--text);
  outline:none;
  font-size:14px;
}

textarea{
  min-height:60px;
  max-height:120px;
  resize:vertical;
}

.btn{
  padding:12px 14px;
  border-radius:12px;
  border:1px solid var(--border);
  background:#121a2b;
  color:var(--text);
  cursor:pointer;
  font-size:14px;
}
.btn.primary{
  background:var(--brand);
  color:#0b1220;
  border-color:transparent;
  font-weight:700;
}
.btn.ghost{
  background:rgba(255,255,255,.03);
}
.btn:disabled{
  opacity:.5;
  cursor:not-allowed;
}

.btn-outline{
  background:rgba(255,255,255,.02);
}


/* 방문/픽업/출장 안내 패널 (공통) */
.panel{
  border:1px solid var(--border);
  border-radius:10px;
  padding:12px 14px;
  background:rgba(15,23,42,.92);
  margin-top:8px;
}

.tiny.muted{
  font-size:12px;
  color:var(--muted);
}

.hidden{ display:none !important; }


/* ============================
   3) 견적 미리보기 테이블 (AS + 펑크 공통)
   ============================ */
table{
  width:100%;
  border-collapse:collapse;
  margin-top:10px;
}
th,td{
  border:1px solid var(--border);
  padding:10px;
  text-align:left;
  font-size:13px;
  color:#f9fafb;
}
th{
  background:rgba(255,255,255,.02);
}
.t-right{ text-align:right; }
.sum-row{
  color:#ef4444;
  font-weight:900;
  text-align:right;
  margin-top:8px;
}


/* ============================
   4) 배너/공지
   ============================ */
.banner{
  margin-top:12px;
  padding:10px;
  border-radius:10px;
  border:1px solid var(--border);
  background:#0e1526;
  color:var(--muted);
}
.banner.warn{
  border-color:#5c4a1a;
  color:#f1c97a;
  background:#2a2311;
}

.req{ color:#f87171; }


/* ============================
   5) 사진 업로드 공통
   ============================ */
.photos{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}
.thumb{
  width:90px;
  height:90px;
  border-radius:10px;
  border:1px solid var(--border);
  background:#0b1020;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
  position:relative;
}
.thumb img{
  width:100%;
  height:100%;
  object-fit:cover;
}
.thumb .meta{
  position:absolute;
  left:4px;
  bottom:4px;
  background:rgba(0,0,0,.5);
  padding:2px 4px;
  border-radius:6px;
  font-size:10px;
  color:#d1fae5;
}


/* ============================
   6) 펑크전용 + AS 공통 헤더/히어로
   ============================ */
.hero{
  margin:4px 0 16px;
  padding:8px 4px 0;
}
.hero h1{
  margin:0 0 4px;
  font-size:20px;
}
.hero p{
  margin:0;
  font-size:13px;
  color:var(--muted);
}


/* ============================
   7) 다이얼로그/메시지 (AS)
   ============================ */
.error{
  color:#ffd4d4;
  background:#3b0b0b;
  border:1px solid #5c1a1a;
  padding:10px;
  border-radius:10px;
  margin:10px 0;
  white-space:pre-line;
}
.ok{
  color:#052;
  background:#c7f9cc26;
  border:1px solid #1e6f5c;
  padding:10px;
  border-radius:10px;
  margin:10px 0;
  white-space:pre-line;
}


/* ============================
   8) 미니 채팅 (AS)
   ============================ */
.diag-chat{
  flex:1;
  min-height:260px;
  background:#020617;
  border:1px solid var(--border);
  border-radius:12px;
  padding:10px 12px;
  display:flex;
  flex-direction:column;
  gap:4px;
}
.diag-chat-log{
  flex:1 1 auto;
  overflow:auto;
  padding-right:4px;
  font-size:13px;
}
.diag-msg{
  max-width:100%;
  margin-bottom:6px;
  padding:6px 8px;
  border-radius:10px;
  white-space:pre-line;
}
.diag-msg.system{
  align-self:flex-start;
  background:#0b1120;
}
.diag-msg.user{
  align-self:flex-end;
  background:#022c22;
}


/* ============================
   9) 전동펑크 테이블 커스터마이즈
   ============================ */
#preview table {
  border-radius: 10px;
  overflow: hidden;
  table-layout: fixed;
  word-break: break-word;
}
#preview thead th {
  background: rgba(148,163,184,0.08);
  font-weight: 700;
}
#preview td:last-child { text-align:right; }

.badge-gray{
  display:inline-block;
  font-size:12px;
  padding:6px 10px;
  border:1px solid var(--border);
  border-radius:8px;
  background:rgba(148,163,184,.12);
  color:#e2e8f0;
}

.cta-row{
  margin-top:12px;
  display:flex!important;
  gap:8px;
  flex-wrap:wrap;
}
