:root {
  --navy:    #0D1B2A;
  --blue:    #1A5276;
  --mid:     #2471A3;
  --sky:     #3498DB;
  --light:   #EBF5FB;
  --teal:    #0E9488;
  --teal-l:  #CCFBF1;
  --green:   #16A34A;
  --green-l: #DCFCE7;
  --amber:   #D97706;
  --amber-l: #FEF3C7;
  --red:     #DC2626;
  --red-l:   #FEE2E2;
  --purple:  #7C3AED;
  --purple-l:#EDE9FE;
  --gray-l:  #F8FAFC;
  --gray-1:  #F1F5F9;
  --gray-2:  #E2E8F0;
  --gray-3:  #CBD5E1;
  --gray-4:  #94A3B8;
  --gray-5:  #64748B;
  --gray-7:  #334155;
  --white:   #FFFFFF;
  --sidebar-w: 256px;
  --header-h:  64px;
  --r:  16px;
  --rs: 10px;
  --shadow-sm: 0 1px 6px rgba(13,27,42,.07);
  --shadow:    0 4px 20px rgba(13,27,42,.10);
  --shadow-md: 0 12px 40px rgba(13,27,42,.14);
  --font-d: 'Gmarket Sans', 'Noto Sans KR', sans-serif;
  --font-b: 'Noto Sans KR', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }
body { font-family: var(--font-b); background: var(--gray-l); color: var(--navy); display: flex; min-height: 100vh; -webkit-font-smoothing: antialiased; }

/* ── Sidebar ── */
.sidebar {
  position: fixed; left: 0; top: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--navy);
  display: flex; flex-direction: column;
  z-index: 200; transition: transform .3s ease;
}
.sidebar-logo {
  display: flex; align-items: center; gap: 10px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  text-decoration: none;
}
.logo-box { width: 36px; height: 36px; background: var(--blue); border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.logo-text { font-family: var(--font-d); font-size: 17px; font-weight: 700; color: var(--white); }
.logo-sub  { font-size: 11px; color: rgba(255,255,255,.38); }

.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px; border-bottom: 1px solid rgba(255,255,255,.07);
}
.su-avatar { width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg, var(--sky), var(--teal)); display: flex; align-items: center; justify-content: center; font-size: 17px; flex-shrink: 0; }
.su-name  { font-size: 13px; font-weight: 700; color: var(--white); }
.su-plan  { font-size: 11px; color: rgba(255,255,255,.4); margin-top: 1px; }
.su-badge { margin-left: auto; background: var(--sky); color: var(--white); font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 100px; flex-shrink: 0; }

.sidebar-quota { margin: 10px 14px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.07); border-radius: var(--rs); padding: 11px 13px; }
.sq-label { font-size: 11px; color: rgba(255,255,255,.4); margin-bottom: 6px; }
.sq-bar-wrap { height: 5px; background: rgba(255,255,255,.1); border-radius: 3px; overflow: hidden; margin-bottom: 5px; }
.sq-bar { height: 100%; width: 60%; background: linear-gradient(90deg, var(--sky), #48C9B0); border-radius: 3px; }
.sq-nums { display: flex; justify-content: space-between; font-size: 11px; color: rgba(255,255,255,.4); }
.sq-nums strong { color: var(--white); }

.nav-section { font-size: 10px; font-weight: 700; letter-spacing: .7px; text-transform: uppercase; color: rgba(255,255,255,.25); padding: 12px 20px 4px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 9px 14px; margin: 1px 8px; border-radius: 9px; cursor: pointer; text-decoration: none; color: rgba(255,255,255,.5); font-size: 13px; font-weight: 500; transition: all .18s; position: relative; }
.nav-item:hover { background: rgba(255,255,255,.07); color: rgba(255,255,255,.8); }
.nav-item.active { background: rgba(52,152,219,.2); color: var(--white); font-weight: 700; }
.nav-item.active::before { content:''; position:absolute; left:0; top:0; bottom:0; width:3px; background:var(--sky); border-radius:0 2px 2px 0; }
.nav-icon { font-size: 15px; width: 20px; text-align: center; flex-shrink: 0; }
.nav-badge { margin-left: auto; background: var(--red); color: var(--white); font-size: 10px; font-weight: 700; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 100px; display: flex; align-items: center; justify-content: center; }
.nav-badge.sky { background: var(--sky); }

.sidebar-bottom { padding: 12px 14px; border-top: 1px solid rgba(255,255,255,.06); }
.ask-btn { display: flex; align-items: center; justify-content: center; gap: 7px; width: 100%; padding: 11px; background: var(--blue); color: var(--white); border: none; border-radius: 10px; font-family: var(--font-b); font-size: 13px; font-weight: 700; cursor: pointer; transition: all .22s cubic-bezier(.34,1.56,.64,1); text-decoration: none; }
.ask-btn:hover { background: var(--mid); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(26,82,118,.35); }

/* ── Main ── */
.main-wrap { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; min-height: 100vh; }

.header { height: var(--header-h); background: var(--white); border-bottom: 1px solid var(--gray-2); display: flex; align-items: center; justify-content: space-between; padding: 0 28px; position: sticky; top: 0; z-index: 100; box-shadow: var(--shadow-sm); }
.header-left { display: flex; align-items: center; gap: 14px; }
.mob-toggle { display: none; border: none; background: none; font-size: 20px; cursor: pointer; color: var(--gray-5); }
.header-title { font-family: var(--font-d); font-size: 17px; font-weight: 700; color: var(--navy); }
.header-sub   { font-size: 13px; color: var(--gray-4); }
.header-right { display: flex; align-items: center; gap: 8px; }
.hbtn { width: 38px; height: 38px; border-radius: 10px; background: var(--gray-1); border: none; cursor: pointer; font-size: 17px; display: flex; align-items: center; justify-content: center; transition: background .18s; position: relative; }
.hbtn:hover { background: var(--gray-2); }
.hbtn-dot { position: absolute; top: 7px; right: 7px; width: 8px; height: 8px; background: var(--red); border-radius: 50%; border: 2px solid var(--white); }
.new-ask-btn { display: flex; align-items: center; gap: 7px; background: var(--blue); color: var(--white); border: none; border-radius: 10px; padding: 9px 18px; font-family: var(--font-b); font-size: 13px; font-weight: 700; cursor: pointer; transition: all .22s cubic-bezier(.34,1.56,.64,1); text-decoration: none; }
.new-ask-btn:hover { background: var(--mid); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(26,82,118,.3); }

.content { padding: 24px 28px; flex: 1; }

/* Filter Bar */
.filter-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; flex-wrap: wrap; gap: 12px; }
.tab-group { display: flex; gap: 4px; background: var(--white); border: 1px solid var(--gray-2); border-radius: 12px; padding: 4px; box-shadow: var(--shadow-sm); }
.tab { padding: 8px 18px; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--gray-5); cursor: pointer; transition: all .18s; border: none; background: transparent; font-family: var(--font-b); display: flex; align-items: center; gap: 6px; }
.tab:hover { color: var(--navy); }
.tab.active { background: var(--blue); color: var(--white); box-shadow: 0 2px 8px rgba(26,82,118,.25); }
.tab-count { font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 100px; }
.tab.active .tab-count { background: rgba(255,255,255,.22); color: var(--white); }
.tab:not(.active) .tab-count { background: var(--gray-2); color: var(--gray-5); }

.filter-right { display: flex; gap: 8px; }
.sort-select { padding: 8px 14px; border: 1px solid var(--gray-2); border-radius: 9px; background: var(--white); font-family: var(--font-b); font-size: 13px; color: var(--gray-7); cursor: pointer; box-shadow: var(--shadow-sm); }

/* Summary Strip */
.summary-strip { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; margin-bottom: 24px; }
.strip-card { background: var(--white); border: 1px solid var(--gray-2); border-radius: var(--r); padding: 16px 18px; display: flex; align-items: center; gap: 14px; box-shadow: var(--shadow-sm); transition: all .2s; }
.strip-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.strip-icon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.strip-v { font-family: var(--font-d); font-size: 26px; font-weight: 700; color: var(--navy); line-height: 1; }
.strip-l { font-size: 12px; color: var(--gray-4); margin-top: 3px; }

/* Match Cards */
.match-list { display: flex; flex-direction: column; gap: 14px; }
.match-card {
  background: var(--white); border: 1.5px solid var(--gray-2); border-radius: 20px;
  box-shadow: var(--shadow-sm); overflow: hidden;
  transition: all .25s ease; cursor: pointer;
}
.match-card:hover { border-color: var(--gray-3); box-shadow: var(--shadow); transform: translateY(-2px); }
.match-card.expanded { border-color: var(--sky); box-shadow: 0 0 0 3px rgba(52,152,219,.1), var(--shadow-md); transform: none; }

.mc-head { display: flex; align-items: flex-start; gap: 14px; padding: 20px 22px 16px; }
.mc-field-icon { width: 48px; height: 48px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; }
.mc-info { flex: 1; min-width: 0; }
.mc-title-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.mc-title { font-family: var(--font-d); font-size: 16px; font-weight: 700; color: var(--navy); }
.mc-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 100px; }
.chip-urgent { background: var(--red-l); color: var(--red); }
.chip-field  { background: var(--light); color: var(--blue); }
.chip-normal { background: var(--gray-1); color: var(--gray-5); }
.mc-body-text { font-size: 13px; color: var(--gray-5); line-height: 1.7; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mc-right { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex-shrink: 0; }
.mc-time { font-size: 12px; color: var(--gray-4); }
.mc-toggle { background: var(--gray-1); border: none; border-radius: 8px; width: 28px; height: 28px; cursor: pointer; font-size: 13px; display: flex; align-items: center; justify-content: center; transition: all .2s; color: var(--gray-5); }
.match-card.expanded .mc-toggle { background: var(--light); color: var(--blue); transform: rotate(180deg); }

/* Steps */
.mc-steps { padding: 0 22px 20px; }
.steps-wrap { display: flex; align-items: center; position: relative; }
.step { display: flex; flex-direction: column; align-items: center; flex: 1; position: relative; z-index: 1; }
.step-circle {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700; margin-bottom: 8px;
  border: 2.5px solid var(--gray-2); background: var(--white);
  transition: all .4s ease; position: relative;
}
.step.done   .step-circle { background: var(--blue); border-color: var(--blue); color: var(--white); }
.step.active .step-circle { background: var(--white); border-color: var(--sky); color: var(--sky); box-shadow: 0 0 0 4px rgba(52,152,219,.15); }
.step.wait   .step-circle { background: var(--gray-1); border-color: var(--gray-2); color: var(--gray-4); }
.step.green.done .step-circle { background: var(--green); border-color: var(--green); }
.step-label { font-size: 11px; font-weight: 600; color: var(--gray-4); text-align: center; line-height: 1.4; }
.step.done .step-label { color: var(--blue); }
.step.active .step-label { color: var(--sky); font-weight: 700; }
.step.green.done .step-label { color: var(--green); }

.step-line { flex: 1; height: 2.5px; background: var(--gray-2); margin: 0; position: relative; top: -14px; z-index: 0; transition: background .4s ease; }
.step-line.done { background: var(--blue); }
.step-line.green { background: var(--green); }
.step-line.active { background: linear-gradient(90deg, var(--blue) 0%, var(--gray-2) 100%); }

@keyframes stepPulse { 0%,100%{box-shadow:0 0 0 4px rgba(52,152,219,.15);} 50%{box-shadow:0 0 0 8px rgba(52,152,219,.06);} }
.step.active .step-circle { animation: stepPulse 2s infinite; }

.mc-status-badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 100px; font-size: 12px; font-weight: 700; margin: 0 22px 10px; }
.badge-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge-dot.blink { animation: blinkStatus 1.4s infinite; }
@keyframes blinkStatus { 0%,100%{opacity:1;} 50%{opacity:.3;} }

.mc-detail { display: none; border-top: 1px solid var(--gray-1); }
.match-card.expanded .mc-detail { display: block; }

.expert-section { padding: 20px 22px; border-bottom: 1px solid var(--gray-1); }
.expert-profile-card { display: flex; align-items: center; gap: 14px; background: var(--gray-l); border: 1px solid var(--gray-2); border-radius: 14px; padding: 14px 16px; }
.ep-ava { width: 50px; height: 50px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 24px; background: var(--light); flex-shrink: 0; border: 2px solid var(--gray-2); }
.ep-name { font-size: 15px; font-weight: 700; color: var(--navy); margin-bottom: 2px; }
.ep-stats { margin-left: auto; display: flex; gap: 20px; flex-shrink: 0; }
.ep-stat-v { font-family: var(--font-d); font-size: 18px; font-weight: 700; color: var(--navy); }
.ep-stat-l { font-size: 11px; color: var(--gray-4); margin-top: 2px; }
.ep-action-btns { display: flex; gap: 8px; margin-top: 14px; }
.ep-btn { flex: 1; padding: 11px; border-radius: 10px; font-family: var(--font-b); font-size: 13px; font-weight: 700; cursor: pointer; transition: all .22s cubic-bezier(.34,1.56,.64,1); display: flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; }
.ep-btn.primary { background: var(--blue); color: var(--white); border: none; }
.ep-btn.outline { background: var(--white); color: var(--blue); border: 1.5px solid var(--blue); }
.ep-btn.gray { background: var(--gray-1); color: var(--gray-7); border: none; }

.timeline-section { padding: 18px 22px; border-bottom: 1px solid var(--gray-1); }
.tl-list { position: relative; }
.tl-list::before { content:''; position:absolute; left:14px; top:0; bottom:0; width:1.5px; background:var(--gray-2); }
.tl-item { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; position: relative; }
.tl-dot { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; flex-shrink: 0; position: relative; z-index: 1; }
.tl-dot.done { background: var(--blue); color: var(--white); }
.tl-dot.active { background: var(--white); border: 2.5px solid var(--sky); color: var(--sky); animation: stepPulse 2s infinite; }
.tl-dot.wait { background: var(--gray-1); border: 2px solid var(--gray-2); color: var(--gray-4); }
.tl-label { font-size: 13px; font-weight: 700; color: var(--navy); margin-bottom: 2px; }
.tl-time { font-size: 12px; color: var(--gray-4); }

.attach-section { padding: 16px 22px; }
.attach-list { display: flex; gap: 8px; flex-wrap: wrap; }
.attach-item { display: flex; align-items: center; gap: 8px; background: var(--gray-l); border: 1px solid var(--gray-2); border-radius: 9px; padding: 8px 12px; cursor: pointer; transition: all .18s; }
.attach-item:hover { background: var(--light); border-color: var(--sky); }

.waiting-section { padding: 24px 22px; text-align: center; }
.waiting-anim { position: relative; width: 80px; height: 80px; margin: 0 auto 16px; }
.waiting-circle { position: absolute; inset: 0; border-radius: 50%; border: 3px solid var(--gray-2); }
.waiting-arc { position: absolute; inset: 0; border-radius: 50%; border: 3px solid transparent; border-top-color: var(--sky); animation: spinMatch 1.2s linear infinite; }
@keyframes spinMatch { to { transform: rotate(360deg); } }
.waiting-icon { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 28px; }
.waiting-eta { display: inline-flex; align-items: center; gap: 6px; background: var(--light); border: 1px solid rgba(52,152,219,.2); color: var(--blue); font-size: 12px; font-weight: 700; padding: 6px 14px; border-radius: 100px; margin-top: 12px; }

.done-section { padding: 18px 22px; background: linear-gradient(135deg, #F0FDF4, #ECFDF5); border-top: 1px solid var(--gray-1); }
.done-header { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.done-icon { width: 40px; height: 40px; border-radius: 12px; background: var(--green); display: flex; align-items: center; justify-content: center; font-size: 20px; }
.done-title { font-family: var(--font-d); font-size: 16px; font-weight: 700; color: var(--green); }
.review-ask { display: flex; align-items: center; justify-content: space-between; background: var(--white); border: 1px solid var(--gray-2); border-radius: 12px; padding: 14px 16px; }
.review-stars-input { display: flex; gap: 4px; }
.star-btn { font-size: 22px; cursor: pointer; color: var(--gray-3); transition: all .15s; }
.star-btn.active { color: #F59E0B; }
.review-write-btn { background: var(--green); color: var(--white); border: none; border-radius: 9px; padding: 9px 18px; font-family: var(--font-b); font-size: 13px; font-weight: 700; cursor: pointer; }

/* Modal */
.overlay { position: fixed; inset: 0; background: rgba(13,27,42,.45); backdrop-filter: blur(6px); z-index: 500; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity .25s; }
.overlay.show { opacity: 1; pointer-events: all; }
.modal { background: var(--white); border-radius: 20px; width: 420px; max-width: 94vw; box-shadow: var(--shadow-md); transform: scale(.95) translateY(14px); transition: transform .3s cubic-bezier(.34,1.56,.64,1); overflow: hidden; }
.overlay.show .modal { transform: scale(1) translateY(0); }
.modal-head { padding: 22px 24px 14px; border-bottom: 1px solid var(--gray-1); }
.cancel-reasons { display: flex; flex-direction: column; gap: 8px; padding: 18px 24px; }
.reason-btn { padding: 12px 14px; border-radius: 10px; border: 1.5px solid var(--gray-2); background: var(--white); font-family: var(--font-b); font-size: 13px; text-align: left; cursor: pointer; transition: all .18s; color: var(--gray-7); }
.reason-btn.selected { border-color: var(--red); background: var(--red-l); color: var(--red); font-weight: 700; }
.modal-foot { display: flex; gap: 10px; padding: 14px 24px; border-top: 1px solid var(--gray-1); }
.modal-keep { flex: 1; padding: 13px; border-radius: 10px; border: 1.5px solid var(--gray-2); background: var(--white); font-family: var(--font-b); font-size: 14px; cursor: pointer; }
.modal-cancel-confirm { flex: 1; padding: 13px; border-radius: 10px; border: none; background: var(--red); color: var(--white); font-family: var(--font-b); font-size: 14px; font-weight: 700; cursor: pointer; }

/* Toast */
.toast { position: fixed; bottom: 24px; left: calc(var(--sidebar-w) + 24px); background: var(--navy); color: var(--white); padding: 13px 18px; border-radius: 12px; display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 500; box-shadow: var(--shadow-md); transform: translateY(70px); opacity: 0; transition: all .35s cubic-bezier(.34,1.56,.64,1); z-index: 600; }
.toast.show { transform: translateY(0); opacity: 1; }

@media (max-width: 860px) { .sidebar { transform: translateX(-100%); } .sidebar.open { transform: translateX(0); } .main-wrap { margin-left: 0; } .mob-toggle { display: flex; } .toast { left: 16px; right: 16px; } }
@media (max-width: 600px) { .content { padding: 14px; } .filter-bar { flex-direction: column; align-items: stretch; } .review-ask { flex-direction: column; gap: 12px; align-items: flex-start; } }

@keyframes fadeUpMatch { from{opacity:0;transform:translateY(14px);} to{opacity:1;transform:none;} }
.match-card, .strip-card { animation: fadeUpMatch .4s ease both; }
