:root {
    --bg-app: #ffffff; /* 白背景に戻しました */
    --bg-panel: #ffffff;
    --text-primary: #333333;
    --text-secondary: #666666;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --border: #e0e0e0;
    --shadow: 0 2px 10px rgba(0,0,0,0.05);
}

body { margin: 0; font-family: 'Inter', 'Noto Sans JP', sans-serif; background-color: var(--bg-app); color: var(--text-primary); height: 100vh; overflow: hidden; }

/* Layout */
.app-layout { display: flex; flex-direction: column; height: 100%; }
.app-container { display: flex; flex: 1; overflow: hidden; }

/* Header - シンプルに */
.app-header {
    background: #fff;
    height: 60px;
    display: flex; align-items: center; padding: 0 24px;
    /* デザインをすっきりさせるためボーダー削除 */
}
.logo { font-weight: 700; font-size: 20px; color: #333; }

/* Preview Area */
.preview-area {
    flex: 1;
    padding: 24px;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    background-color: #f8f9fa; /* プレビューエリアだけ薄いグレーで区別 */
    position: relative;
}
.canvas-wrapper {
    position: relative; max-width: 100%; max-height: 70vh;
    border-radius: 8px; background: #000; box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}
canvas { max-width: 100%; max-height: 70vh; display: block; }

/* Sidebar */
.sidebar {
    width: 320px;
    background: #fff;
    border-left: 1px solid var(--border);
    display: flex; flex-direction: column; z-index: 5;
}
.scroll-content { flex: 1; overflow-y: auto; padding: 24px; }

.panel-section { margin-bottom: 24px; }
h4 { margin: 0 0 12px 0; font-size: 12px; color: #888; font-weight: 600; }

/* Inputs & Controls */
.btn { border: none; padding: 10px 16px; border-radius: 6px; cursor: pointer; font-weight: 600; font-size: 14px; text-decoration: none; display: inline-flex; justify-content: center; align-items: center; transition: 0.2s; }
.primary-btn { background: var(--accent); color: white; }
.primary-btn:hover { background: var(--accent-hover); }
.secondary-btn { background: #eee; color: #333; }
.secondary-btn:hover { background: #ddd; }
.full-width { width: 100%; }

input[type="text"], textarea, select {
    width: 100%; padding: 8px; border: 1px solid var(--border);
    border-radius: 6px; box-sizing: border-box; font-family: inherit; margin-bottom: 8px;
}
.file-upload-box {
    display: block; padding: 15px; border: 1px dashed #ccc;
    border-radius: 6px; text-align: center; cursor: pointer; background: #fafafa;
}
.file-upload-box:hover { border-color: var(--accent); background: #f0f7ff; }

/* Video Controls */
.video-controls {
    display: flex; align-items: center; gap: 16px; margin-top: 20px;
    background: #fff; padding: 10px 20px; border-radius: 50px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05); width: 80%; max-width: 500px;
}
.circle-btn { width: 32px; height: 32px; border-radius: 50%; background: #333; color: #fff; border: none; cursor: pointer; }
.seek-wrapper { flex: 1; display: flex; } input[type="range"] { width: 100%; }

/* Premium Modal */
.premium-content { max-width: 500px; text-align: left; }
.plan-comparison { display: flex; gap: 15px; margin: 20px 0; }
.plan-card { flex: 1; padding: 15px; border: 1px solid #eee; border-radius: 8px; text-align: center; }
.plan-card.premium { border: 2px solid #FFD700; background: #fffff0; }
.plan-card h4 { font-size: 16px; margin-bottom: 10px; color: #333; }
.plan-card ul { list-style: none; padding: 0; margin-bottom: 15px; text-align: left; font-size: 13px; }
.plan-card li { margin-bottom: 5px; }
.premium-btn { background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%); color: #333; width: 100%; }
.text-link { background: none; border: none; color: #888; text-decoration: underline; cursor: pointer; margin-top: 10px; width: 100%; }

/* Progress & Ads */
.progress-card {
    position: absolute; bottom: 80px; left: 50%; transform: translateX(-50%);
    background: #fff; padding: 20px 30px; border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1); border: 1px solid #eee;
    display: flex; flex-direction: column; align-items: center; gap: 12px; z-index: 20; min-width: 280px;
}
.spinner { width: 30px; height: 30px; border: 3px solid #f3f3f3; border-top: 3px solid var(--accent); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
.ad-placeholder { width: 100%; min-height: 100px; background: #f9f9f9; margin-top: 5px; border: 1px dashed #ccc; text-align: center; }
.ad-label { font-size: 9px; color: #999; text-align: right; padding: 2px; }

/* Modal & Others */
.modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); display: flex; justify-content: center; align-items: center; z-index: 100; backdrop-filter: blur(2px); }
.modal-content { background: #fff; padding: 30px; border-radius: 12px; text-align: center; box-shadow: 0 20px 40px rgba(0,0,0,0.2); }
.modal-content video { max-width: 100%; max-height: 50vh; margin-bottom: 15px; border-radius: 6px; background: #000; }
.share-buttons { display: flex; justify-content: center; gap: 10px; margin-top: 15px; }
.share-btn { padding: 8px 12px; border-radius: 4px; font-size: 12px; color: white; text-decoration: none; }
.x-btn { background: #000; } .fb-btn { background: #1877f2; } .line-btn { background: #06c755; }

.sidebar-footer { padding: 20px; border-top: 1px solid #eee; font-size: 11px; color: #999; text-align: center; }
.sidebar-footer a { color: #888; margin: 0 5px; }

@media (max-width: 900px) { .app-layout { height: auto; overflow: auto; } .app-container { flex-direction: column; } .preview-area { min-height: 400px; position: sticky; top: 0; z-index: 2; border-bottom: 1px solid var(--border); } .sidebar { width: 100%; border-left: none; } }