
    /* streaming.css — 配信管理ページ固有スタイル（共通スタイルはcommon.cssを参照） */

    :root {
      /* プラットフォームカラー（streaming固有） */
      --yt: #FF0000;
      --twitch: #9146FF;
      --tiktok: #00F2EA;
    }

    html {
      height: 100%;
      margin: 0;
      padding: 0;
      overflow: hidden;
    }

    body {
      height: 100%;
      margin: 0;
      padding: 0;
      overflow: hidden;
    }

    /* streaming.cssのnav-linkはborderあり・inline-flex・gap付き */
    .nav-link {
      background: var(--card2);
      border: 1px solid var(--border);
      padding: 6px 14px;
      font-size: 12px;
      display: inline-flex;
      align-items: center;
      gap: 5px;
    }

    .nav-link:hover {
      border-color: var(--accent);
    }

    .nav-link.active {
      background: var(--accent-glow);
      border-color: var(--accent);
    }

    /* header-rightのgapはstreaming固有で16px */
    .header-right {
      gap: 16px;
    }

    /* メインレイアウト */
    .main {
      max-width: 1400px;
      margin: 0 auto;
      padding: 24px;
    }

    .grid {
      display: grid;
      gap: 20px;
    }

    .grid-2 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(3, 1fr); }

    @media (max-width: 1100px) {
      .grid-3 { grid-template-columns: repeat(2, 1fr); }
    }

    @media (max-width: 700px) {
      .grid-2, .grid-3 { grid-template-columns: 1fr; }
      .main { padding: 12px; }
    }

    /* カード */
    .card {
      background: var(--card);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      padding: 20px;
    }

    .card-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 16px;
    }

    .card-title {
      font-size: 13px;
      font-weight: 600;
      color: var(--text-muted);
      text-transform: uppercase;
      letter-spacing: 0.8px;
      display: flex;
      align-items: center;
      gap: 8px;
    }

    /* =====================================================
       配信コントロールパネル
    ===================================================== */

    /* メインの配信ON/OFFボタン */
    .stream-toggle-wrap {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 16px;
      padding: 8px 0 16px;
    }

    .stream-toggle-btn {
      width: 140px;
      height: 140px;
      border-radius: 50%;
      border: 3px solid var(--border);
      background: var(--card2);
      color: var(--text-muted);
      font-size: 15px;
      font-weight: 700;
      cursor: pointer;
      transition: all 0.3s;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 8px;
      letter-spacing: 1px;
      position: relative;
    }

    .stream-toggle-btn .btn-icon {
      font-size: 32px;
      line-height: 1;
    }

    .stream-toggle-btn:hover {
      border-color: var(--green);
      color: var(--green);
      box-shadow: 0 0 24px rgba(34, 197, 94, 0.2);
    }

    .stream-toggle-btn.live {
      border-color: var(--red);
      color: var(--red);
      background: rgba(239, 68, 68, 0.05);
      box-shadow: 0 0 32px rgba(239, 68, 68, 0.25);
      animation: live-pulse 2s infinite;
    }

    .stream-toggle-btn.live:hover {
      border-color: var(--red);
      color: var(--red);
      box-shadow: 0 0 40px rgba(239, 68, 68, 0.35);
    }

    @keyframes live-pulse {
      0%, 100% { box-shadow: 0 0 32px rgba(239, 68, 68, 0.25); }
      50% { box-shadow: 0 0 50px rgba(239, 68, 68, 0.45); }
    }

    .stream-status-label {
      font-size: 13px;
      color: var(--text-muted);
      letter-spacing: 0.5px;
    }

    .stream-status-label.live {
      color: var(--red);
      font-weight: 700;
    }

    /* 配信時間カウンター */
    .stream-timer {
      font-size: 24px;
      font-weight: 700;
      font-family: monospace;
      color: var(--text);
      letter-spacing: 2px;
    }

    .stream-timer.live {
      color: var(--red);
    }

    /* プラットフォーム選択 */
    .platform-selector {
      display: flex;
      gap: 10px;
      flex-wrap: wrap;
    }

    .platform-check {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 10px 16px;
      background: var(--card2);
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      cursor: pointer;
      transition: all 0.2s;
      user-select: none;
      flex: 1;
      min-width: 110px;
    }

    .platform-check input[type="checkbox"] {
      display: none;
    }

    .platform-check .platform-dot {
      width: 10px;
      height: 10px;
      border-radius: 50%;
      border: 2px solid var(--border);
      transition: all 0.2s;
      flex-shrink: 0;
    }

    .platform-check .platform-name {
      font-size: 13px;
      font-weight: 600;
      color: var(--text-muted);
      transition: color 0.2s;
    }

    .platform-check.yt.selected {
      border-color: rgba(255, 0, 0, 0.4);
      background: rgba(255, 0, 0, 0.05);
    }

    .platform-check.yt.selected .platform-dot { background: var(--yt); border-color: var(--yt); }
    .platform-check.yt.selected .platform-name { color: var(--yt); }

    .platform-check.tw.selected {
      border-color: rgba(145, 70, 255, 0.4);
      background: rgba(145, 70, 255, 0.05);
    }

    .platform-check.tw.selected .platform-dot { background: var(--twitch); border-color: var(--twitch); }
    .platform-check.tw.selected .platform-name { color: var(--twitch); }

    .platform-check.tt.selected {
      border-color: rgba(0, 242, 234, 0.4);
      background: rgba(0, 242, 234, 0.05);
    }

    .platform-check.tt.selected .platform-dot { background: var(--tiktok); border-color: var(--tiktok); }
    .platform-check.tt.selected .platform-name { color: var(--tiktok); }

    /* OBS コントロール */
    .obs-status-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 12px 14px;
      background: var(--card2);
      border-radius: var(--radius-sm);
      margin-bottom: 12px;
    }

    .obs-indicator {
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .obs-dot {
      width: 10px;
      height: 10px;
      border-radius: 50%;
      background: var(--text-dim);
      transition: all 0.3s;
    }

    .obs-dot.connected {
      background: var(--green);
      box-shadow: 0 0 8px var(--green);
      animation: pulse 2s infinite;
    }

    .obs-dot.streaming {
      background: var(--red);
      box-shadow: 0 0 8px var(--red);
      animation: pulse 1.5s infinite;
    }

    .obs-label {
      font-size: 13px;
      color: var(--text);
      font-weight: 600;
    }

    .obs-sublabel {
      font-size: 11px;
      color: var(--text-dim);
    }

    .obs-btn-row {
      display: flex;
      gap: 8px;
      margin-bottom: 12px;
    }

    .btn {
      padding: 9px 18px;
      border-radius: var(--radius-sm);
      border: 1px solid var(--border);
      background: var(--card2);
      color: var(--text-muted);
      font-size: 13px;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.2s;
      white-space: nowrap;
    }

    .btn:hover { border-color: var(--accent); color: var(--text); }

    .btn-green {
      background: rgba(34, 197, 94, 0.1);
      border-color: rgba(34, 197, 94, 0.3);
      color: var(--green);
    }

    .btn-green:hover {
      background: rgba(34, 197, 94, 0.2);
      border-color: var(--green);
      color: var(--green);
    }

    .btn-red {
      background: rgba(239, 68, 68, 0.1);
      border-color: rgba(239, 68, 68, 0.3);
      color: var(--red);
    }

    .btn-red:hover {
      background: rgba(239, 68, 68, 0.2);
      border-color: var(--red);
      color: var(--red);
    }

    .btn:disabled {
      opacity: 0.4;
      cursor: not-allowed;
    }

    .scene-select {
      width: 100%;
      padding: 9px 12px;
      background: var(--card2);
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      color: var(--text);
      font-size: 13px;
      cursor: pointer;
      outline: none;
      transition: border-color 0.2s;
    }

    .scene-select:focus {
      border-color: var(--accent);
    }

    .scene-select option {
      background: var(--card2);
    }

    /* =====================================================
       ステータスパネル
    ===================================================== */

    .platform-status-row {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 14px;
      background: var(--card2);
      border-radius: var(--radius-sm);
      border: 1px solid transparent;
      margin-bottom: 10px;
      transition: border-color 0.3s;
    }

    .platform-status-row:last-child { margin-bottom: 0; }

    .platform-status-row.active {
      border-color: rgba(34, 197, 94, 0.2);
    }

    .platform-icon {
      width: 32px;
      height: 32px;
      border-radius: 6px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-weight: 700;
      font-size: 11px;
      flex-shrink: 0;
      letter-spacing: 0.5px;
    }

    .platform-icon.yt { background: rgba(255, 0, 0, 0.15); color: var(--yt); }
    .platform-icon.tw { background: rgba(145, 70, 255, 0.15); color: var(--twitch); }
    .platform-icon.tt { background: rgba(0, 242, 234, 0.15); color: var(--tiktok); }
    .platform-icon.obs { background: rgba(59, 130, 246, 0.15); color: var(--blue); }

    .platform-info {
      flex: 1;
    }

    .platform-info-name {
      font-size: 13px;
      font-weight: 600;
      color: var(--text);
    }

    .platform-info-sub {
      font-size: 11px;
      color: var(--text-dim);
      margin-top: 2px;
    }

    .platform-stats {
      display: flex;
      gap: 16px;
      flex-shrink: 0;
    }

    .pstat {
      text-align: right;
    }

    .pstat-val {
      font-size: 16px;
      font-weight: 700;
      color: var(--text);
      font-family: monospace;
    }

    .pstat-label {
      font-size: 10px;
      color: var(--text-dim);
    }

    .live-badge {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      padding: 3px 8px;
      border-radius: 4px;
      font-size: 11px;
      font-weight: 700;
      letter-spacing: 0.5px;
      flex-shrink: 0;
    }

    .live-badge.live {
      background: rgba(239, 68, 68, 0.15);
      color: var(--red);
      border: 1px solid rgba(239, 68, 68, 0.3);
    }

    .live-badge.live::before {
      content: '';
      width: 6px;
      height: 6px;
      border-radius: 50%;
      background: var(--red);
      animation: pulse 1.5s infinite;
    }

    .live-badge.offline {
      background: rgba(90, 98, 120, 0.15);
      color: var(--text-dim);
      border: 1px solid rgba(90, 98, 120, 0.2);
    }

    /* =====================================================
       チャットモニター
    ===================================================== */

    .tab-bar {
      display: flex;
      gap: 4px;
      margin-bottom: 14px;
      border-bottom: 1px solid var(--border);
      padding-bottom: 0;
    }

    .tab-btn {
      padding: 8px 16px;
      background: transparent;
      border: none;
      border-bottom: 2px solid transparent;
      color: var(--text-muted);
      font-size: 13px;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.2s;
      margin-bottom: -1px;
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .tab-btn:hover { color: var(--text); }

    .tab-btn.active {
      color: var(--accent-light);
      border-bottom-color: var(--accent);
    }

    .tab-dot {
      width: 7px;
      height: 7px;
      border-radius: 50%;
    }

    .chat-area {
      height: 320px;
      overflow-y: auto;
      display: flex;
      flex-direction: column;
      gap: 6px;
      padding-right: 4px;
      scrollbar-width: thin;
      scrollbar-color: var(--border) transparent;
    }

    .chat-area::-webkit-scrollbar { width: 4px; }
    .chat-area::-webkit-scrollbar-track { background: transparent; }
    .chat-area::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

    .chat-msg {
      display: flex;
      gap: 8px;
      align-items: flex-start;
      padding: 8px 10px;
      border-radius: var(--radius-sm);
      background: var(--card2);
      border: 1px solid transparent;
      transition: border-color 0.2s;
      animation: fadeIn 0.3s ease;
    }

    @keyframes fadeIn {
      from { opacity: 0; transform: translateY(4px); }
      to { opacity: 1; transform: translateY(0); }
    }

    .chat-msg.ai-reply {
      border-color: rgba(124, 58, 237, 0.3);
      background: rgba(124, 58, 237, 0.05);
    }

    .chat-platform-icon {
      width: 18px;
      height: 18px;
      border-radius: 3px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 9px;
      font-weight: 700;
      flex-shrink: 0;
      margin-top: 1px;
    }

    .chat-platform-icon.yt { background: rgba(255, 0, 0, 0.2); color: var(--yt); }
    .chat-platform-icon.tw { background: rgba(145, 70, 255, 0.2); color: var(--twitch); }

    .chat-content { flex: 1; min-width: 0; }

    .chat-username {
      font-size: 11px;
      font-weight: 700;
      color: var(--accent-light);
      margin-bottom: 2px;
    }

    .chat-text {
      font-size: 13px;
      color: var(--text);
      line-height: 1.4;
      word-break: break-word;
    }

    .chat-ai-label {
      font-size: 10px;
      padding: 1px 6px;
      background: var(--accent-glow);
      border: 1px solid rgba(124, 58, 237, 0.3);
      border-radius: 10px;
      color: var(--accent-light);
      margin-left: 6px;
      vertical-align: middle;
    }

    .chat-time {
      font-size: 10px;
      color: var(--text-dim);
      flex-shrink: 0;
      margin-top: 2px;
    }

    .chat-empty {
      display: flex;
      align-items: center;
      justify-content: center;
      height: 100%;
      color: var(--text-dim);
      font-size: 13px;
    }

    /* =====================================================
       設定パネル
    ===================================================== */

    .setting-row {
      margin-bottom: 18px;
    }

    .setting-row:last-child { margin-bottom: 0; }

    .setting-label {
      font-size: 12px;
      color: var(--text-muted);
      margin-bottom: 8px;
      display: flex;
      justify-content: space-between;
      align-items: center;
    }

    .setting-label-value {
      font-weight: 700;
      color: var(--text);
      font-family: monospace;
    }

    .slider {
      width: 100%;
      height: 6px;
      -webkit-appearance: none;
      appearance: none;
      background: var(--card2);
      border-radius: 3px;
      outline: none;
      cursor: pointer;
    }

    .slider::-webkit-slider-thumb {
      -webkit-appearance: none;
      appearance: none;
      width: 16px;
      height: 16px;
      border-radius: 50%;
      background: var(--accent);
      cursor: pointer;
      box-shadow: 0 0 8px var(--accent-glow);
      transition: box-shadow 0.2s;
    }

    .slider::-webkit-slider-thumb:hover {
      box-shadow: 0 0 14px var(--accent-glow);
    }

    .slider::-moz-range-thumb {
      width: 16px;
      height: 16px;
      border-radius: 50%;
      background: var(--accent);
      cursor: pointer;
      border: none;
    }

    .setting-input {
      width: 100%;
      padding: 9px 12px;
      background: var(--card2);
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      color: var(--text);
      font-size: 13px;
      font-family: monospace;
      outline: none;
      transition: border-color 0.2s;
    }

    .setting-input:focus {
      border-color: var(--accent);
    }

    .setting-input::placeholder {
      color: var(--text-dim);
    }

    .setting-number {
      width: 100%;
      padding: 9px 12px;
      background: var(--card2);
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      color: var(--text);
      font-size: 13px;
      font-family: monospace;
      outline: none;
      transition: border-color 0.2s;
    }

    .setting-number:focus {
      border-color: var(--accent);
    }

    .save-btn {
      width: 100%;
      padding: 10px;
      background: var(--accent);
      border: none;
      border-radius: var(--radius-sm);
      color: #fff;
      font-size: 13px;
      font-weight: 700;
      cursor: pointer;
      transition: all 0.2s;
      margin-top: 4px;
    }

    .save-btn:hover {
      background: var(--accent-light);
      box-shadow: 0 0 16px var(--accent-glow);
    }

    /* =====================================================
       声質変換バックエンド選択
    ===================================================== */

    .vc-backend-toggle {
      display: flex;
      gap: 8px;
      margin-bottom: 10px;
    }

    .vc-backend-btn {
      flex: 1;
      padding: 8px 10px;
      border-radius: var(--radius-sm);
      border: 1px solid var(--border);
      background: var(--card2);
      color: var(--text-muted);
      font-size: 12px;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.2s;
      text-align: center;
    }

    .vc-backend-btn:hover {
      border-color: var(--accent);
      color: var(--text);
    }

    .vc-backend-btn.active {
      background: var(--accent-glow);
      border-color: var(--accent);
      color: var(--accent-light);
    }

    .vc-status-row {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 8px 10px;
      background: var(--card2);
      border-radius: var(--radius-sm);
      border: 1px solid var(--border);
      margin-bottom: 6px;
      font-size: 12px;
    }

    .vc-status-dot {
      width: 8px;
      height: 8px;
      border-radius: 50%;
      background: var(--text-dim);
      flex-shrink: 0;
      transition: all 0.3s;
    }

    .vc-status-dot.online {
      background: var(--green);
      box-shadow: 0 0 6px var(--green);
      animation: pulse 2s infinite;
    }

    .vc-status-dot.offline {
      background: var(--red);
    }

    .vc-status-name {
      color: var(--text);
      font-weight: 600;
      flex: 1;
    }

    .vc-status-label {
      color: var(--text-muted);
      font-size: 11px;
    }

    .vc-wokada-slots {
      margin-top: 6px;
      font-size: 11px;
      color: var(--text-dim);
      padding: 6px 10px;
      background: var(--card2);
      border-radius: var(--radius-sm);
      border: 1px solid var(--border);
      display: none;
    }

    .vc-wokada-slots.visible {
      display: block;
    }

    /* =====================================================
       トースト通知
    ===================================================== */

    .toast-container {
      position: fixed;
      bottom: 24px;
      right: 24px;
      z-index: 999;
      display: flex;
      flex-direction: column;
      gap: 8px;
      pointer-events: none;
    }

    .toast {
      padding: 12px 20px;
      border-radius: var(--radius-sm);
      font-size: 13px;
      font-weight: 600;
      color: #fff;
      animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards;
      pointer-events: auto;
    }

    .toast.success { background: rgba(34, 197, 94, 0.9); }
    .toast.error { background: rgba(239, 68, 68, 0.9); }
    .toast.info { background: rgba(124, 58, 237, 0.9); }

    @keyframes toastIn {
      from { opacity: 0; transform: translateX(20px); }
      to { opacity: 1; transform: translateX(0); }
    }

    @keyframes toastOut {
      from { opacity: 1; transform: translateX(0); }
      to { opacity: 0; transform: translateX(20px); }
    }

    /* フッター */
    .footer-note {
      text-align: center;
      font-size: 11px;
      color: var(--text-dim);
      margin-top: 12px;
      padding-bottom: 24px;
    }

    /* =====================================================
       スマホ対応
    ===================================================== */

    @media (max-width: 640px) {
      .header {
        height: auto;
        padding: 10px 16px;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
      }

      .header-right {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 8px;
        padding-bottom: 2px;
        scrollbar-width: none;
      }

      .header-right::-webkit-scrollbar { display: none; }

      .nav-link {
        padding: 10px 14px;
        font-size: 13px;
        white-space: nowrap;
        min-height: 44px;
        flex-shrink: 0;
      }

      .stream-toggle-btn {
        width: 120px;
        height: 120px;
      }

      .platform-selector {
        flex-direction: column;
      }

      .platform-stats {
        gap: 10px;
      }

      .pstat-val { font-size: 14px; }

      .chat-area { height: 240px; }

      .tab-btn { padding: 8px 12px; font-size: 12px; }

      .obs-btn-row { flex-wrap: wrap; }
    }

    @media (min-width: 641px) and (max-width: 1024px) {
      .header { padding: 0 16px; }
      .main { padding: 16px; }
    }

    /* =====================================================
       GPUサーバー管理パネル
    ===================================================== */

    .gpu-panel {
      border-left: 3px solid var(--text-dim);
      transition: border-color 0.3s;
    }
    .gpu-panel.running { border-left-color: var(--green); }
    .gpu-panel.stopped { border-left-color: var(--red); }
    .gpu-panel.pending, .gpu-panel.stopping { border-left-color: var(--yellow); }

    .gpu-status-row {
      display: flex;
      align-items: center;
      gap: 10px;
      margin: 12px 0;
    }

    .gpu-indicator {
      width: 12px;
      height: 12px;
      border-radius: 50%;
      background: var(--text-dim);
    }
    .gpu-indicator.running { background: var(--green); box-shadow: 0 0 8px var(--green); }
    .gpu-indicator.stopped { background: var(--red); }
    .gpu-indicator.pending, .gpu-indicator.stopping {
      background: var(--yellow);
      animation: pulse 1s ease-in-out infinite;
    }

    .gpu-info-grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 8px;
      margin: 12px 0;
    }

    .gpu-info-item {
      background: var(--bg);
      padding: 8px 12px;
      border-radius: var(--radius-sm);
    }
    .gpu-info-item label {
      display: block;
      font-size: 11px;
      color: var(--text-muted);
    }
    .gpu-info-item span {
      font-size: 14px;
      font-weight: 600;
    }

    .gpu-services {
      display: flex;
      gap: 8px;
      margin: 8px 0;
    }
    .service-badge {
      padding: 4px 10px;
      border-radius: 12px;
      font-size: 12px;
      background: var(--card2);
      color: var(--text-muted);
    }
    .service-badge.active { background: rgba(34,197,94,0.15); color: var(--green); }
    .service-badge.inactive { background: rgba(239,68,68,0.15); color: var(--red); }

    .gpu-controls {
      display: flex;
      gap: 12px;
      margin: 16px 0 8px;
    }
    .btn-start {
      flex: 1;
      padding: 10px;
      background: var(--green);
      color: #fff;
      border: none;
      border-radius: var(--radius-sm);
      font-size: 15px;
      font-weight: 600;
      cursor: pointer;
    }
    .btn-start:disabled { opacity: 0.4; cursor: not-allowed; }
    .btn-stop {
      flex: 1;
      padding: 10px;
      background: var(--red);
      color: #fff;
      border: none;
      border-radius: var(--radius-sm);
      font-size: 15px;
      font-weight: 600;
      cursor: pointer;
    }
    .btn-stop:disabled { opacity: 0.4; cursor: not-allowed; }

    .gpu-cost {
      font-size: 12px;
      color: var(--yellow);
      background: rgba(234,179,8,0.1);
      padding: 2px 8px;
      border-radius: 8px;
    }

    .gpu-note {
      font-size: 11px;
      color: var(--text-dim);
      margin-top: 4px;
    }

    .btn-spinner {
      display: inline-block;
      width: 14px;
      height: 14px;
      border: 2px solid rgba(255,255,255,0.3);
      border-top-color: #fff;
      border-radius: 50%;
      animation: spin 0.6s linear infinite;
    }

