:root{
    --bg:#F2F4F6;
    --card:#FFFFFF;
    --text:#191F28;
    --muted:#6B7684;
    --line:#E5E8EB;
  
    --primary:#1B64FF;
    --primary-press:#0F52E6;
  
    --warn-bg:#FFF4E5;
    --warn-line:#FFE2B3;
    --warn-text:#8A4B00;
  
    --danger-bg:#FFF1F3;
    --danger-line:#FFD1D8;
  
    --shadow: 0 8px 24px rgba(2, 32, 71, 0.06);
    --radius: 18px;
  }
  
  *{ box-sizing:border-box; }
  html,body{ height:100%; }
  body{
    margin:0;
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, Segoe UI, Roboto, "Noto Sans KR", sans-serif;
  }
  
  .app{
    min-height:100%;
    display:flex;
    flex-direction:column;
  }
  
  /* Top header */
  .topbar{
    max-width: 1320px;
    width: 100%;
    margin: 0 auto;
    padding: 16px 22px 12px;
    display:flex;
    justify-content: space-between;
    gap: 16px;
    align-items:flex-start;
  }
  
  .topbar-left{
    display: flex;
    align-items: center;
    gap: 14px;   /* 로고-텍스트 간격 */
  }
  
  .logo{
    width: 56px;        /* 필요하면 48~56px 조절 */
    height: auto;
    flex-shrink: 0;
    background: transparent;
  }
  
  .logo img{
    width: 100%;
    height: auto;
    display: block;
  }
  
  .title{
    margin: 0;
    font-size: 26px;
    line-height: 1.25;
  }
  
  .subtitle{
    margin-top: 4px;
    font-size: 13px;
    color: var(--muted);
  }

  .subtitle .block{
    display: block;
  }
  
  .topbar-right{
    display:flex;
    flex-wrap:wrap;
    gap: 8px;
    justify-content:flex-end;
  }
  
  .pill{
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255,255,255,.75);
    font-size: 12px;
    font-weight: 900;
    color: var(--text);
  }
  .pill-solid{
    border-color: rgba(27,100,255,.25);
    background: rgba(27,100,255,.10);
    color: #0B3DB8;
  }
  .pill-warn{
    border-color: var(--warn-line);
    background: var(--warn-bg);
    color: var(--warn-text);
  }
  
  /* Layout */
  .layout{
    max-width: 1320px;
    width: 100%;
    margin: 0 auto;
    padding: 0 22px 26px;
    display:grid;
    grid-template-columns: 3fr 1fr; /* ✅ 75% / 25% */
    gap: 14px;
    flex: 1;
    min-height: 0;
  }
  
  .main{
    min-height:0;
  }
  
  .main-grid{
    display:grid;
    grid-template-columns: 1fr 1fr; /* 업로드/로그 나란히 */
    gap: 14px;
  }
  
  /* Cards */
  .card{
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
    min-height: 0;
  }
  
  .card-head{ margin-bottom: 12px; }
  .h2{
    margin:0;
    font-size: 16px;
    letter-spacing: -0.01em;
  }
  .muted{
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 13px;
  }
  .small{ font-size: 12px; }
  
  /* Upload */
  .upload{ display:block; cursor:pointer; user-select:none; }
  .upload input{ display:none; }
  
  .upload-inner{
    display:flex;
    align-items:center;
    gap: 12px;
    padding: 14px;
    border-radius: 16px;
    border: 1px dashed #C9D0D6;
    background: #FAFBFC;
    transition: background .15s ease, border-color .15s ease;
  }
  .upload:hover .upload-inner{
    background: #F5F8FF;
    border-color: rgba(27,100,255,.35);
  }
  .upload-icon{
    width: 40px; height: 40px;
    border-radius: 14px;
    display:grid;
    place-items:center;
    background: rgba(27,100,255,.10);
  }
  .upload-title{ font-weight: 900; font-size: 14px; }
  .upload-sub{ margin-top: 2px; color: var(--muted); font-size: 12px; }
  .upload-ext{
    margin-left:auto;
    font-size: 12px;
    font-weight: 900;
    color: var(--muted);
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: #fff;
  }
  
  /* Buttons */
  .btn-row{
    display:flex;
    gap: 10px;
    margin-top: 12px;
  }
  .btn{
    flex:1;
    border-radius: 14px;
    padding: 12px 14px;
    font-weight: 900;
    border: 1px solid var(--line);
    cursor:pointer;
    transition: transform .06s ease, background .15s ease, border-color .15s ease;
  }
  .btn:active{ transform: translateY(1px); }
  .btn:disabled{ opacity: .55; cursor:not-allowed; }
  
  .btn-primary{
    background: var(--primary);
    color:#fff;
    border-color: rgba(27,100,255,.35);
  }
  .btn-primary:hover{ background: var(--primary-press); }
  
  .btn-secondary{
    background: #fff;
    color: var(--text);
  }
  .btn-secondary:hover{
    background: #F7F9FB;
    border-color: #D7DCE0;
  }
  
  /* Notice */
  .notice{
    margin-top: 12px;
    padding: 12px;
    border-radius: 16px;
    border: 1px solid var(--warn-line);
    background: var(--warn-bg);
  }
  .notice-title{ font-weight: 900; font-size: 13px; }
  .notice-body{
    margin-top: 4px;
    color: #5B6674;
    font-size: 13px;
  }
  .sep{ margin: 0 6px; color: #9AA4B2; }
  
  /* Log */
  .log{
    margin: 0;
    height: 520px; /* ✅ PC 기준 안정적으로 길게 */
    padding: 14px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: #0B1220;
    color: #D6E4FF;
    font-size: 12px;
    line-height: 1.6;
    white-space: pre-wrap;
    overflow:auto;
  }
  
  .legend{
    margin-top: 10px;
    display:flex;
    gap: 12px;
    align-items:center;
    color: var(--muted);
    font-size: 12px;
  }
  .dot{
    width: 8px; height: 8px;
    border-radius: 50%;
    display:inline-block;
    margin-right: 6px;
  }
  .dot-ok{ background:#22C55E; }
  .dot-warn{ background:#FFB020; }
  .dot-err{ background:#FF5A70; }
  
  /* Side guide */
  .side{
    min-height:0;
    display:flex;
    flex-direction:column;
  }
  
  .side-head{
    padding: 16px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: rgba(255,255,255,.65);
    box-shadow: var(--shadow);
    margin-bottom: 14px;
  }
  
  .side-body{
    flex:1;
    min-height:0;
    padding: 16px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: #fff;
    box-shadow: var(--shadow);
    overflow:auto; /* ✅ 오른쪽만 스크롤 */
  }
  
  .section{ margin-bottom: 14px; }
  .section-title{
    font-weight: 900;
    font-size: 13px;
    margin-bottom: 8px;
  }
  
  .chips{
    display:flex;
    flex-wrap:wrap;
    gap: 8px;
  }
  .chip{
    font-size: 12px;
    font-weight: 900;
    padding: 8px 10px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: #fff;
  }
  
  .banner{
    margin-top: 10px;
    padding: 12px;
    border-radius: 14px;
    border: 1px solid var(--danger-line);
    background: var(--danger-bg);
  }
  .banner b{ display:block; font-size: 13px; }
  .banner span{
    display:block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
  }
  
  .list{
    margin: 0;
    padding-left: 18px;
    color: #384553;
    font-size: 13px;
    line-height: 1.6;
  }
  .list li{ margin: 6px 0; }
  
  /* Responsive */
  @media (max-width: 1100px){
    .layout{ grid-template-columns: 1fr; }
    .main-grid{ grid-template-columns: 1fr; }
    .log{ height: 360px; }
  }


  /* ===== 로직 설명 아코디언 ===== */
.logic-accordion{
  margin-top: 12px;
}

.logic-toggle{
  width: 100%;
  background: #f1f5f9;
  border: none;
  border-radius: 10px;
  padding: 10px 12px;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.logic-toggle .arrow{
  transition: transform .2s ease;
}

.logic-accordion.open .logic-toggle .arrow{
  transform: rotate(180deg);
}

.logic-panel{
  display: none;
  margin-top: 8px;
}

.logic-accordion.open .logic-panel{
  display: block;
}

.logic-step{
  display: flex;
  gap: 10px;
  padding: 8px;
  border-radius: 8px;
  margin-top: 6px;
  background: #f9fafb;
}

.logic-step.highlight{
  border-left: 3px solid #2563eb;
}

.logic-step.error{
  border-left: 3px solid #ef4444;
}

.logic-num{
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #2563eb;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
