/* ========================================
   URLCustomDiscs-PackConverter
   完全版スタイルシート
   ======================================== */

   :root {
    /* モニター基準値（JSで動的設定） */
    --m-w: 100vw;
    --m-h: 100vh;
    
    /* レイアウト定数 */
    --gap: 15px;
    
    /* カラーパレット */
    --bg: #0d1017;
    --panel: #161b22;
    --border: #30363d;
    --accent: #388bfd;
    --text: #c9d1d9;
    --sub: #8b949e;
    --white: #f0f6fc;
    
    /* ステータスカラー */
    --error: #da3633;
    --success: #3fb950;
    --warning: #d29922;
  }
  
  /* ========================================
     基礎リセット
     ======================================== */
  
  * {
    box-sizing: border-box;
  }
  
  body, html { 
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    overflow: auto;
  }
  
  /* ========================================
     メインレイアウト
     ======================================== */
  
  .viewport { 
    display: flex; 
    justify-content: center; 
    align-items: stretch;
    width: 100%;
    min-height: 100vh;
    padding: 0;
  }
  
  .ad-spacer { 
    flex: 0 2 calc(var(--m-w) * 0.166);
    min-width: calc(var(--m-w) * 0.10);
  }
  
  .container { 
    display: flex; 
    flex-direction: column; 
    flex: 0 1 calc(var(--m-w) * 0.666);
    min-width: 600px;
    max-width: calc(var(--m-w) * 0.666);
    min-height: 100vh;
    padding: 20px 0;
    gap: var(--gap);
    overflow: hidden;
  }
  
  /* ========================================
     ヘッダー
     ======================================== */
  
  header { 
    flex: none; 
    height: 35px; 
    border-left: 4px solid var(--accent); 
    padding-left: 15px;
    display: flex;
    align-items: center;
  }
  
  header h1 { 
    margin: 0; 
    font-size: 30px; 
    font-weight: 800; 
    color: var(--white); 
    letter-spacing: -0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  /* ========================================
     アプリグループ
     ======================================== */
  
  .app-group { 
    display: flex;
    flex-direction: row;
    gap: 30px;
    flex: 1;
    min-height: 0;
  }
  
  /* ========================================
     パネル共通
     ======================================== */
  
  .panel { 
    flex: 1;
    display: flex; 
    flex-direction: column; 
    background: var(--panel); 
    border: 2px solid var(--border); 
    border-radius: 12px; 
    padding: 18px; 
    gap: 12px; 
    min-width: 0; 
    min-height: 0;
    overflow: hidden;
  }
  
  /* ========================================
     左パネル: 入力セクション
     ======================================== */
  
  .input-section { 
    flex: none;
    min-height: 0;
  }
  
  .config-box { 
    display: flex; 
    flex-direction: column; 
    gap: 6px; 
    margin-bottom: 12px;
  }
  
  .config-label { 
    font-size: 10px; 
    font-weight: 800; 
    color: var(--sub); 
    letter-spacing: 0.5px; 
  }
  
  .label-group { 
    display: flex; 
    align-items: center; 
    gap: 8px; 
  }
  
  input[type="text"],
  select { 
    width: 100%; 
    max-width: 100%;
    height: 42px; 
    background: var(--bg); 
    border: 2px solid var(--border); 
    border-radius: 6px; 
    color: var(--text) !important; 
    font-size: 12px; 
    padding: 0 15px; 
    outline: none;
    transition: border-color 0.2s;
  }
  
  input[type="text"]:focus,
  select:focus {
    border-color: var(--accent);
  }
  
  select { 
    appearance: none; 
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%238b949e' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 10.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E"); 
    background-repeat: no-repeat; 
    background-position: calc(100% - 15px) center; 
    padding-right: 35px;
    cursor: pointer;
  }
  
  /* ========================================
     ドロップゾーン
     ======================================== */
  
  .drop-section { 
    flex: 1;
    display: flex; 
    flex-direction: column; 
    gap: 12px; 
    min-height: 0;
    overflow: hidden;
  }
  
  .drop-zone { 
    flex: 1; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: center; 
    background: #21262d;
    border: 2px dashed var(--border);
    border-radius: 8px; 
    position: relative; 
    cursor: pointer; 
    transition: all 0.2s;
    padding: 15px; 
    min-height: 90px; 
  }
  
  .drop-zone:hover {
    border-color: var(--accent);
    background: rgba(56, 139, 253, 0.05);
  }
  
  .drop-zone.has-file { 
    border-color: var(--accent); 
    border-style: solid; 
    background: rgba(56, 139, 253, 0.1) !important;
  }
  
  .dz-icon { 
    font-size: 32px;
    margin-bottom: 10px;
    user-select: none;
  }
  
  .dz-text { 
    font-size: 12px;
    color: var(--sub); 
    text-align: center;
    user-select: none;
  }
  
  /* ========================================
     ボタン: スタート
     ======================================== */
  
  #btn-start { 
    flex: none; 
    height: 50px; 
    border-radius: 8px; 
    font-weight: 800; 
    font-size: 12px;
    background: #21262d; 
    color: var(--sub); 
    border: 2px solid var(--border); 
    cursor: pointer;
    transition: all 0.2s;
  }
  
  #btn-start:hover:not(:disabled) {
    background: #2d333b;
  }
  
  #btn-start.ready { 
    background: var(--accent); 
    color: var(--white); 
    border: none; 
  }
  
  #btn-start.ready:hover {
    background: #2f7fd8;
  }
  
  #btn-start:disabled {
    cursor: not-allowed;
    opacity: 0.5;
  }
  
  /* ========================================
     右パネル: コンソールエリア
     ======================================== */
  
  .console-group { 
    flex: 1; 
    display: flex; 
    flex-direction: column; 
    gap: 12px; 
    min-height: 0;
    overflow: hidden;
  }
  
  .console-container { 
    flex: 1; 
    display: flex; 
    flex-direction: column; 
    background: var(--bg); 
    border: 2px solid var(--border); 
    border-radius: 8px; 
    overflow: hidden;
    min-height: 0;
  }
  
  .console-label { 
    flex: none;
    padding: 10px 16px; 
    font-size: 10px; 
    font-weight: 800; 
    color: var(--sub); 
    border-bottom: 2px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
    letter-spacing: 1px;
  }
  
  #log-window { 
    flex: 1 1 0;
    padding: 20px 15px 15px 15px;
    overflow-y: auto;
    overflow-x: hidden;
    font-family: 'Consolas', monospace; 
    font-size: 12px; 
    line-height: 1.2;
    color: var(--text);
    min-height: 0;
    max-height: 100%;
  }
  
  /* ========================================
     ボタン: ダウンロード
     ======================================== */
  
  .btn-group-dl { 
    flex: none; 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 12px; 
  }
  
  .btn-dl { 
    height: 50px; 
    border-radius: 8px; 
    font-weight: 800; 
    font-size: 12px;
    background: #21262d; 
    color: var(--sub); 
    border: 2px solid var(--border); 
    cursor: pointer;
    transition: all 0.2s;
  }
  
  .btn-dl.active { 
    background: var(--white); 
    color: #24292f; 
    border: none; 
  }
  
  .btn-dl.active:hover {
    background: #e6edf3;
  }
  
  .btn-dl:disabled {
    cursor: not-allowed;
    opacity: 0.5;
  }
  
  /* ========================================
     ログ表示
     ======================================== */
  
  .log-line { 
    margin-bottom: 8px; 
    display: flex; 
    align-items: center;
    min-height: 28px;
  }
  
  .tag-container {
    display: flex;
    align-items: center;
    height: 20px;   
    margin-right: 12px; 
    flex-shrink: 0;
  }
  
  .tag { 
    width: 58px;
    height: 20px; 
    font-weight: 800; 
    font-size: 10px;
    border-radius: 2px; 
    line-height: 1;
    display: grid;
    place-items: center;    
    text-transform: uppercase; 
    letter-spacing: 0.8px;
    border: 1px solid var(--border);
    color: var(--sub);
  }
  
  .log-content {
    flex: 1;
    display: block; 
    line-height: 1.4;
    word-break: break-all;
    color: var(--text);
  }
  
  .log-line span:not(.tag) {
    display: inline-block;
    line-height: 1.4;
    color: var(--text);
  }
  
  .tag-phase { 
    border: 1px solid var(--accent);
    color: var(--accent);
  }
  
  .tag-error {
    border: 1px solid var(--error);
    color: var(--error);
  }
  
  .tag-success {
    border: 1px solid var(--success);
    color: var(--success);
  }
  
  .tag-warning {
    border: 1px solid var(--warning);
    color: var(--warning);
  }
  
  .summary-box { 
    margin-top: 20px;
    padding: 12px 16px; 
    background: rgba(56, 139, 253, 0.1); 
    border: 1px solid var(--accent); 
    border-left: 5px solid var(--accent); 
    border-radius: 6px; 
    font-size: 12px; 
    color: var(--white);
    line-height: 1.5;
  }
  
  /* ========================================
     インフォボタン
     ======================================== */
  
  .info-trigger { 
    width: 18px; 
    height: 18px; 
    background: var(--border); 
    color: var(--sub); 
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 10px; 
    cursor: help; 
    transition: all 0.2s;
    flex-shrink: 0;
  }
  
  .info-trigger:hover { 
    background: var(--accent); 
    color: var(--white); 
    transform: scale(1.1); 
  }
  
  .drop-zone .info-trigger { 
    position: absolute; 
    top: 12px; 
    right: 12px; 
  }
  
  .info-trigger.inline {
    position: static;
  }
  
  /* ========================================
     スクロールバー
     ======================================== */
  
  ::-webkit-scrollbar { 
    width: 6px; 
    height: 6px; 
  }
  
  ::-webkit-scrollbar-track { 
    background: var(--bg); 
  }
  
  ::-webkit-scrollbar-thumb { 
    background: var(--border); 
    border-radius: 4px; 
  }