/* スタジオHUB base — シェル・レイアウト・状態 */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.7; overflow-wrap: anywhere; word-break: break-word; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; font-size: 14px; }

/* アプリバー */
.appbar { background: var(--navy); color: #fff; padding: 12px 16px; display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 20; }
.appbar .logo { font-weight: 700; font-size: 15px; letter-spacing: .04em; white-space: nowrap; }
.appbar .company { font-size: 12px; color: rgba(255,255,255,.75); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex-shrink: 1; }
.appbar .spacer { flex: 1; }
.appbar select { background: rgba(255,255,255,.12); color: #fff; border: none; border-radius: 8px; padding: 5px 8px; font-size: 12px; max-width: 40vw; }

/* タブバー */
.tabbar { background: var(--surface); border-bottom: 1px solid var(--line); display: flex; gap: 4px; padding: 0 12px; position: sticky; top: 46px; z-index: 19; overflow-x: auto; }
.tabbar button { padding: 11px 14px; font-size: 13px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabbar button.active { color: var(--navy); border-bottom-color: var(--teal); }

/* コンテンツ */
main { max-width: 720px; margin: 0 auto; padding: 16px 14px 80px; }
.view { display: none; }
.view.active { display: block; }

/* カード */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: var(--pad); margin-bottom: 14px; }
.card h2 { font-size: 13px; color: var(--muted); font-weight: 700; margin-bottom: 10px; }

/* 3状態 */
.skel { border-radius: var(--radius); background: var(--surface-soft); animation: skel 1.2s ease-in-out infinite; }
@keyframes skel { 0%,100% { opacity: 1; } 50% { opacity: .55; } }
.empty { text-align: center; color: var(--muted); font-size: 13px; padding: 26px 12px; line-height: 2; }
.errbox { text-align: center; padding: 20px; }
.errbox p { color: var(--muted); font-size: 13px; margin-bottom: 10px; }

/* トースト */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--navy-deep); color: #fff; padding: 10px 18px; border-radius: 20px; font-size: 13px; opacity: 0; transition: opacity .3s; pointer-events: none; z-index: 50; max-width: 90vw; }
.toast.show { opacity: 1; }

/* 小さい画面での密度調整 */
@media (max-width: 400px) {
  main { padding: 12px 10px 70px; }
  .card { padding: 13px; }
  .appbar { padding: 10px 12px; }
  .appbar .logo { font-size: 14px; }
  .tabbar button { padding: 10px 12px; }
}

/* 接続画面 */
.connect-wrap { min-height: 80vh; display: flex; align-items: center; justify-content: center; padding: 20px 14px; }
.connect-card { max-width: 420px; width: 100%; }
.connect-card .brand { text-align: center; margin-bottom: 18px; }
.connect-card .brand strong { font-size: 20px; color: var(--navy); letter-spacing: .05em; }
.connect-card .brand p { font-size: 12px; color: var(--muted); margin-top: 4px; }
.connect-card textarea { width: 100%; min-height: 96px; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; font-size: 13px; word-break: break-all; }
.connect-note { font-size: 11px; color: var(--muted); margin-top: 10px; line-height: 1.8; }
