/* generated */
:root{
  --bg:#0b0f19;--panel:#0f172a;--card:#111c33;--muted:#94a3b8;--text:#e2e8f0;
  --accent:#60a5fa;--accent2:#22c55e;--danger:#ef4444;--border:rgba(148,163,184,.18);
  --shadow:0 10px 30px rgba(0,0,0,.35);
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,"Noto Sans JP",sans-serif;
  background:radial-gradient(1000px 700px at 20% 0%, rgba(96,165,250,.18), transparent 60%),
             radial-gradient(900px 600px at 80% 20%, rgba(34,197,94,.10), transparent 55%),
             var(--bg);
  color:var(--text);
}
a{color:inherit;text-decoration:none}
.container{height:100%;display:grid;grid-template-columns:320px 1fr}
.sidebar{border-right:1px solid var(--border);background:linear-gradient(180deg,rgba(15,23,42,.92),rgba(15,23,42,.75));padding:16px}
.brand{display:flex;align-items:center;gap:10px;margin-bottom:14px}
.logo{width:38px;height:38px;border-radius:12px;background:linear-gradient(135deg,rgba(96,165,250,.9),rgba(34,197,94,.7));box-shadow:var(--shadow)}
.brand h1{font-size:16px;margin:0}
.brand .sub{font-size:12px;color:var(--muted)}
.nav{display:flex;gap:8px;margin:10px 0 14px}
.tab{padding:8px 10px;border:1px solid var(--border);border-radius:12px;background:rgba(17,28,51,.55);color:var(--muted);font-size:12px}
.tab.active{color:var(--text);border-color:rgba(96,165,250,.45);background:rgba(96,165,250,.12)}
.search{width:100%;border:1px solid var(--border);background:rgba(17,28,51,.5);padding:10px 12px;border-radius:12px;color:var(--text);outline:none}
.btn{border:1px solid var(--border);background:rgba(96,165,250,.14);color:var(--text);padding:10px 12px;border-radius:12px;cursor:pointer}
.btn:hover{border-color:rgba(96,165,250,.6)}
.btn.secondary{background:rgba(148,163,184,.08)}
.btn.danger{background:rgba(239,68,68,.12);border-color:rgba(239,68,68,.25)}
.btnRow{display:flex;gap:8px;margin-top:10px}
.convList{margin-top:14px;display:flex;flex-direction:column;gap:8px;max-height:calc(100vh - 220px);overflow:auto;padding-right:6px}
.convItem{border:1px solid var(--border);background:rgba(17,28,51,.5);padding:10px 10px;border-radius:14px;display:flex;align-items:center;justify-content:space-between;gap:10px}
.convItem.active{border-color:rgba(96,165,250,.55);background:rgba(96,165,250,.10)}
.convTitle{font-size:13px;line-height:1.2;max-width:200px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.convMeta{font-size:11px;color:var(--muted)}
.iconBtn{border:1px solid var(--border);background:rgba(148,163,184,.08);width:30px;height:30px;border-radius:12px;cursor:pointer;display:grid;place-items:center;color:var(--muted)}
.iconBtn:hover{border-color:rgba(148,163,184,.35);color:var(--text)}
.main{display:flex;flex-direction:column;height:100%}
.topbar{padding:16px 18px;border-bottom:1px solid var(--border);display:flex;align-items:center;justify-content:space-between;gap:10px;background:rgba(15,23,42,.35)}
.title{font-size:14px;color:var(--text);display:flex;align-items:center;gap:10px}
.badge{font-size:11px;padding:4px 8px;border-radius:999px;border:1px solid var(--border);color:var(--muted);background:rgba(17,28,51,.45)}
.select{border:1px solid var(--border);background:rgba(17,28,51,.5);padding:8px 10px;border-radius:12px;color:var(--text);outline:none;min-width:260px}
.chat{flex:1;overflow:auto;padding:18px}
.msg{max-width:860px;margin:0 auto 12px;display:flex}
.bubble{padding:12px 14px;border-radius:16px;border:1px solid var(--border);background:rgba(17,28,51,.55);box-shadow:0 6px 20px rgba(0,0,0,.18);white-space:pre-wrap;line-height:1.55}
.msg.user{justify-content:flex-end}
.msg.user .bubble{background:rgba(96,165,250,.13);border-color:rgba(96,165,250,.25)}
.msg.assistant{justify-content:flex-start}
.msg.system .bubble{background:rgba(148,163,184,.06);color:var(--muted)}
.composer{border-top:1px solid var(--border);padding:14px 18px;background:rgba(15,23,42,.45)}
.composerInner{max-width:980px;margin:0 auto;display:flex;gap:10px}
.textarea{flex:1;min-height:48px;max-height:160px;resize:vertical;border:1px solid var(--border);background:rgba(17,28,51,.5);padding:12px 12px;border-radius:14px;color:var(--text);outline:none}
.small{font-size:12px;color:var(--muted)}
hr.sep{border:none;border-top:1px solid var(--border);margin:14px 0}
.card{max-width:980px;margin:0 auto;border:1px solid var(--border);border-radius:16px;background:rgba(17,28,51,.45);box-shadow:var(--shadow);padding:16px}
.grid2{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.label{font-size:12px;color:var(--muted);margin-bottom:6px}
.input{width:100%;border:1px solid var(--border);background:rgba(17,28,51,.5);padding:10px 12px;border-radius:12px;color:var(--text);outline:none}
.row{border:1px solid var(--border);background:rgba(17,28,51,.5);border-radius:14px;padding:10px;margin-bottom:10px}
/* ハンバーガーボタン（デスクトップでは非表示） */
.hamburger{display:none;border:1px solid var(--border);background:rgba(148,163,184,.08);color:var(--text);font-size:22px;width:44px;height:44px;border-radius:12px;cursor:pointer;flex-shrink:0}
.hamburger:hover{border-color:rgba(96,165,250,.6)}

/* オーバーレイ背景 */
.overlay{display:none;position:fixed;inset:0;background:rgba(0,0,0,.55);z-index:90}
.overlay.open{display:block}

@media (max-width:960px){
  .container{grid-template-columns:1fr}

  /* サイドバー：固定オーバーレイ */
  .sidebar{
    display:flex;flex-direction:column;
    position:fixed;top:0;left:0;bottom:0;width:300px;max-width:85vw;
    z-index:100;
    transform:translateX(-100%);
    transition:transform .25s ease;
    border-right:1px solid var(--border);
    background:linear-gradient(180deg,rgba(15,23,42,.97),rgba(15,23,42,.92));
    padding:16px;
    overflow-y:auto;-webkit-overflow-scrolling:touch
  }
  .sidebar.open{transform:translateX(0)}

  /* ハンバーガー表示 */
  .hamburger{display:grid;place-items:center}

  /* topbar のモデル選択を折り返し可に */
  .topbar{flex-wrap:wrap;padding:10px 12px;gap:8px}
  .topbar form{flex-wrap:wrap;width:100%}
  .select{min-width:0;width:100%}
  .title{font-size:13px;flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

  /* composer をコンパクトに */
  .composer{padding:10px 10px}
  .composerInner{flex-wrap:wrap}
  .textarea{min-height:44px;width:100%;flex:1 1 100%}
  .composerInner .btn{min-height:44px;min-width:44px;padding:10px 14px}

  /* bubble を画面幅に追従 */
  .msg{max-width:100%}
  .bubble{max-width:calc(100vw - 40px)}

  /* 2カラムグリッドを1カラムに */
  .grid2{grid-template-columns:1fr}

  /* タッチ操作用ボタンサイズ */
  .btn{min-height:44px;min-width:44px}
  .tab{min-height:44px;display:grid;place-items:center}
  .iconBtn{width:38px;height:38px}
  .convList{max-height:calc(100vh - 280px)}
}
