  /* ─── Design Tokens ─────────────────────────────── */
  :root {
    --sidebar-w: 248px;
    --sidebar-bg: #0C0C0E;
    --sidebar-hover: #1C1C21;
    --sidebar-active: #26262C;
    --sidebar-border: #2A2A30;
    --sidebar-text: #8B8B96;
    --sidebar-text-active: #F0F0F2;

    --bg: #F4F4F6;
    --surface: #FFFFFF;
    --surface-hover: #FAFAFA;
    --border: #E8E8EC;
    --border-subtle: #F0F0F2;

    --text-primary: #111113;
    --text-secondary: #6C6C78;
    --text-tertiary: #A0A0AB;

    --accent: #FF6B35;
    --accent-hover: #E85D2A;
    --accent-soft: rgba(255, 107, 53, 0.08);
    --accent-border: rgba(255, 107, 53, 0.2);

    --green: #10B981;
    --green-soft: rgba(16, 185, 129, 0.08);
    --blue: #3B82F6;
    --blue-soft: rgba(59, 130, 246, 0.08);
    --amber: #F59E0B;
    --amber-soft: rgba(245, 158, 11, 0.08);
    --red: #EF4444;
    --red-soft: rgba(239, 68, 68, 0.08);
    --purple: #8B5CF6;
    --purple-soft: rgba(139, 92, 246, 0.08);

    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.08);

    --font-display: 'Plus Jakarta Sans', 'Pretendard', sans-serif;
    --font-body: 'Pretendard', -apple-system, sans-serif;

    --transition: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  }

  /* ─── Reset & Base ──────────────────────────────── */
  *, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
  html { font-size: 14px; }
  body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text-primary);
    display: flex;
    min-height: 100vh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
  }

  /* ─── Sidebar ───────────────────────────────────── */
  .sidebar {
    width: var(--sidebar-w);
    min-width: var(--sidebar-w);
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 50;
    border-right: 1px solid var(--sidebar-border);
  }

  .sidebar-brand {
    padding: 24px 20px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .sidebar-brand .logo-mark {
    width: 32px;
    height: 32px;
    background: var(--accent);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 16px;
    color: #fff;
    letter-spacing: -0.5px;
  }
  .sidebar-brand .logo-text {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 17px;
    color: var(--sidebar-text-active);
    letter-spacing: -0.3px;
  }

  .sidebar-nav {
    flex: 1;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow-y: scroll;
    min-height: 0;
  }

  /* ─── Sidebar Section Headers ────────────────── */
  .nav-section-header {
    padding: 20px 20px 6px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--sidebar-text);
    opacity: 0.5;
    user-select: none;
  }
  .sidebar-nav .nav-section-header:first-child {
    padding-top: 8px;
  }

  .nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: var(--radius);
    color: var(--sidebar-text);
    cursor: pointer;
    transition: all var(--transition);
    font-size: 13.5px;
    font-weight: 500;
    position: relative;
    user-select: none;
  }
  .nav-item:hover { background: var(--sidebar-hover); color: var(--sidebar-text-active); }
  .nav-item.active {
    background: var(--sidebar-active);
    color: var(--sidebar-text-active);
  }
  .nav-item.active::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 18px;
    background: var(--accent);
    border-radius: 0 3px 3px 0;
  }
  .nav-item svg {
    width: 18px;
    height: 18px;
    opacity: 0.6;
    flex-shrink: 0;
  }
  .nav-item.active svg, .nav-item:hover svg { opacity: 1; }

  .nav-item .badge {
    margin-left: auto;
    background: var(--accent);
    color: #fff;
    font-size: 10.5px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
  }

  /* Sidebar client selector */
  /* 에이전트 상태 위젯 */
  .agent-status-widget {
    margin: 4px 10px 2px;
    padding: 10px 12px;
    background: var(--sidebar-hover);
    border-radius: var(--radius);
    border: 1px solid var(--sidebar-border);
  }
  .agent-status-header {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.7px;
    text-transform: uppercase;
    color: var(--sidebar-text);
    opacity: 0.55;
    margin-bottom: 7px;
  }
  .agent-status-body {
    display: flex;
    align-items: center;
    gap: 7px;
  }
  .agent-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    background: #6b7280;
    transition: background 0.3s;
  }
  .agent-dot.online  { background: #22c55e; box-shadow: 0 0 5px rgba(34,197,94,0.5); }
  .agent-dot.offline { background: #ef4444; }
  .agent-dot.restarting { background: #f59e0b; animation: blink 1s infinite; }
  @keyframes blink { 0%,100% { opacity:1; } 50% { opacity:0.3; } }
  .agent-label {
    font-size: 12px;
    color: var(--sidebar-text-active);
    line-height: 1.3;
  }
  .agent-cmd {
    font-size: 10.5px;
    font-family: monospace;
    background: rgba(0,0,0,0.2);
    border-radius: 4px;
    padding: 5px 8px;
    color: var(--sidebar-text);
    word-break: break-all;
    line-height: 1.4;
  }
  .agent-copy-btn {
    margin-top: 5px;
    width: 100%;
    padding: 4px 0;
    font-size: 11px;
    background: transparent;
    border: 1px solid var(--sidebar-border);
    border-radius: 4px;
    color: var(--sidebar-text);
    cursor: pointer;
    font-family: var(--font-body);
  }
  .agent-copy-btn:hover { background: var(--sidebar-border); }
  .agent-action-row {
    display: flex;
    gap: 5px;
  }
  .agent-action-btn {
    flex: 1;
    padding: 4px 0;
    font-size: 11px;
    background: transparent;
    border: 1px solid var(--sidebar-border);
    border-radius: 4px;
    color: var(--sidebar-text);
    cursor: pointer;
    font-family: var(--font-body);
  }
  .agent-action-btn:hover { background: var(--sidebar-border); }
  .agent-action-btn--danger { color: #ef4444; border-color: rgba(239,68,68,0.4); }
  .agent-action-btn--danger:hover { background: rgba(239,68,68,0.12); }

  .sidebar-client {
    padding: 16px 12px;
    border-top: 1px solid var(--sidebar-border);
  }
  .sidebar-client label {
    font-size: 10.5px;
    font-weight: 600;
    color: var(--sidebar-text);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    display: block;
    margin-bottom: 8px;
    opacity: 0.6;
  }
  .sidebar-client select {
    width: 100%;
    padding: 8px 10px;
    background: var(--sidebar-hover);
    border: 1px solid var(--sidebar-border);
    border-radius: var(--radius);
    color: var(--sidebar-text-active);
    font-size: 13px;
    font-family: var(--font-body);
    outline: none;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%238B8B96' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
  }
  .sidebar-client select:focus { border-color: var(--accent); }

  /* ─── Main Content ──────────────────────────────── */
  .main {
    margin-left: var(--sidebar-w);
    flex: 1;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
  }

  .topbar {
    position: sticky;
    top: 0;
    background: rgba(244,244,246,0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 0 32px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 30;
  }
  .topbar-title {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.3px;
  }
  .topbar-actions { display: flex; gap: 8px; align-items: center; }

  .page-content {
    padding: 28px 32px 48px;
    max-width: 1120px;
  }

  /* ─── Pages (tab switching) ─────────────────────── */
  .page { display: none; }
  .page.active {
    display: block;
    animation: pageIn 0.25s ease-out;
  }
  @keyframes pageIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
  }

  /* ─── Buttons ───────────────────────────────────── */
  .btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font-body);
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    line-height: 1.4;
  }
  .btn:hover { transform: translateY(-1px); }
  .btn:active { transform: translateY(0); }
  .btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

  .btn-primary { background: var(--accent); color: #fff; box-shadow: 0 1px 3px rgba(255,107,53,0.3); }
  .btn-primary:hover { background: var(--accent-hover); box-shadow: 0 2px 6px rgba(255,107,53,0.35); }
  .btn-dark { background: var(--text-primary); color: #fff; }
  .btn-dark:hover { background: #2a2a2e; }
  .btn-ghost { background: transparent; color: var(--text-secondary); border: 1px solid var(--border); }
  .btn-ghost:hover { background: var(--surface); border-color: #d0d0d5; color: var(--text-primary); }
  .btn-danger { background: var(--red-soft); color: var(--red); }
  .btn-danger:hover { background: var(--red); color: #fff; }
  .btn-success { background: var(--green-soft); color: var(--green); }
  .btn-success:hover { background: var(--green); color: #fff; }
  .btn-sm { padding: 5px 12px; font-size: 12px; border-radius: var(--radius-sm); }
  .btn svg { width: 15px; height: 15px; }

  /* ─── Cards & Surfaces ──────────────────────────── */
  .card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition);
  }
  .card:hover { box-shadow: var(--shadow); }

  .card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
  }
  .card-title {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.2px;
  }

  /* ─── Stat Cards ────────────────────────────────── */
  .stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 28px;
  }
  .stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
  }
  .stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
  }
  .stat-card:nth-child(1)::before { background: var(--accent); }
  .stat-card:nth-child(2)::before { background: var(--amber); }
  .stat-card:nth-child(3)::before { background: var(--green); }
  .stat-card:nth-child(4)::before { background: var(--blue); }

  .stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
  .stat-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }
  .stat-value {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -1px;
    color: var(--text-primary);
  }
  .stat-sub {
    font-size: 12px;
    color: var(--text-tertiary);
  }

  /* ─── Form Elements ─────────────────────────────── */
  .form-group { margin-bottom: 16px; }
  .form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
  }
  .form-field-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
    margin-bottom: 4px;
    letter-spacing: 0.02em;
  }
  .form-input {
    width: 100%;
    padding: 9px 13px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 13.5px;
    font-family: var(--font-body);
    color: var(--text-primary);
    background: var(--surface);
    outline: none;
    transition: all var(--transition);
  }
  .form-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
  }
  .form-input::placeholder { color: var(--text-tertiary); }

  .form-row {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    flex-wrap: wrap;
  }
  .form-row .form-group { margin-bottom: 0; }
  .form-row .form-group.flex-1 { flex: 1; min-width: 200px; }

  textarea.form-input {
    min-height: 80px;
    resize: vertical;
    line-height: 1.6;
  }

  /* ─── Calendar Entry Cards ──────────────────────── */
  .entry-list { display: flex; flex-direction: column; gap: 8px; }

  .entry-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all var(--transition);
    cursor: default;
  }
  .entry-card:hover {
    border-color: #d0d0d5;
    box-shadow: var(--shadow);
  }

  .entry-date-block {
    min-width: 56px;
    width: 56px;
    text-align: center;
    padding: 8px 4px;
    background: var(--bg);
    border-radius: var(--radius);
    border: 1px solid var(--border-subtle);
    flex-shrink: 0;
  }
  .entry-date-block .ed-month {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }
  .entry-date-block .ed-day {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.1;
  }
  /* 상대시간 */
  .ed-reltime {
    font-size: 10px;
    color: var(--text-tertiary);
    margin-top: 2px;
  }

  /* 컨텐츠 유형 뱃지 */
  .content-type-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 1px 7px;
    border-radius: 8px;
    white-space: nowrap;
    display: inline-block;
    margin-bottom: 4px;
  }
  .content-type-blog {
    background: #e8f5e9;
    color: #03C75A;
  }
  .content-type-shortform {
    background: #fff3ed;
    color: #ff6b35;
  }
  .content-type-instagram {
    background: #fce7f3;
    color: #be185d;
  }

  /* 시간 정보 행 (제목/본문 아래) */
  .entry-time-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 5px;
  }
  .entry-time-item {
    font-size: 11px;
    color: var(--text-tertiary);
  }
  .entry-time-scheduled { color: var(--accent); font-weight: 600; }
  .entry-time-generated  { color: var(--text-tertiary); }
  .entry-time-published  { color: #16a34a; }

  .entry-body { flex: 1; min-width: 0; }
  .entry-topic {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .entry-sub {
    font-size: 12px;
    color: var(--text-tertiary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .entry-desc {
    font-size: 11px;
    color: var(--text-tertiary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 2px;
    font-style: italic;
  }

  .status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 11px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
  }
  .status-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
  }
  .status-pending { background: var(--amber-soft); color: #92400E; }
  .status-pending::before { background: var(--amber); }
  .status-generating { background: var(--blue-soft); color: #1E40AF; }
  .status-generating::before { background: var(--blue); animation: pulse 1.5s infinite; }
  .status-ready { background: var(--green-soft); color: #065F46; }
  .status-ready::before { background: var(--green); }
  .status-posted { background: var(--purple-soft); color: #5B21B6; }
  .status-posted::before { background: var(--purple); }
  .status-published { background: var(--purple-soft); color: #5B21B6; }
  .status-published::before { background: var(--purple); }
  .status-failed { background: var(--red-soft); color: #991B1B; }
  .status-failed::before { background: var(--red); }
  .status-publishing { background: var(--blue-soft); color: #1E40AF; }
  .status-publishing::before { background: var(--blue); animation: pulse 1.5s infinite; }
  .status-draft_saved { background: #F3F4F6; color: #374151; }
  .status-draft_saved::before { background: #6B7280; }

  @keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
  }
  @keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
  }

  .entry-actions { display: flex; gap: 6px; flex-shrink: 0; }

  /* ─── Client Table ──────────────────────────────── */
  .client-table { width: 100%; border-collapse: collapse; }
  .client-table th {
    text-align: left;
    padding: 10px 16px;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
  }
  .client-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 13.5px;
    vertical-align: middle;
  }
  .client-table tr:last-child td { border-bottom: none; }
  .client-table tr:hover td { background: var(--surface-hover); }

  .client-id {
    font-family: 'SF Mono', 'Cascadia Code', monospace;
    font-size: 12.5px;
    background: var(--bg);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
  }
  .active-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
  }
  .active-indicator::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
  }
  .active-indicator.on { color: var(--green); }
  .active-indicator.on::before { background: var(--green); }
  .active-indicator.off { color: var(--text-tertiary); }
  .active-indicator.off::before { background: var(--text-tertiary); }

  .schedule-text {
    font-size: 12px;
    color: var(--text-tertiary);
    font-family: 'SF Mono', 'Cascadia Code', monospace;
  }

  /* ─── Add Client Form ───────────────────────────── */
  .add-client-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
  }

  /* ─── Modal ─────────────────────────────────────── */
  .modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(4px);
    z-index: 100;
    justify-content: center;
    align-items: flex-start;
    overflow-y: auto;
    padding: 40px 16px;
  }
  .modal-overlay.active { display: flex; }

  .modal {
    background: var(--surface);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 720px;
    overflow-y: visible;
    padding: 32px;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.2s ease-out;
    flex-shrink: 0;
  }
  @keyframes modalIn {
    from { opacity: 0; transform: scale(0.96) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
  }

  .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
  }
  .modal-title {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.3px;
  }
  .modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--bg);
    border-radius: var(--radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    transition: all var(--transition);
  }
  .modal-close:hover { background: var(--border); color: var(--text-primary); }

  .kw-card:hover { border-color: var(--accent) !important; background: rgba(99,102,241,0.04) !important; }

  .modal-body { font-size: 14px; line-height: 1.8; white-space: pre-wrap; color: var(--text-secondary); }

  .modal-tags {
    margin-top: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }
  .modal-tags span {
    background: var(--bg);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
  }

  .modal-images {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    overflow-x: auto;
    padding-bottom: 8px;
  }
  .modal-images img {
    width: 140px;
    height: 140px;
    object-fit: cover;
    border-radius: var(--radius);
    border: 1px solid var(--border);
  }

  /* ─── Empty State ───────────────────────────────── */
  .empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-tertiary);
  }
  .empty-state .empty-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    background: var(--bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .empty-state .empty-icon svg {
    width: 24px;
    height: 24px;
    color: var(--text-tertiary);
  }
  .empty-state .empty-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
  }
  .empty-state .empty-desc {
    font-size: 13px;
    color: var(--text-tertiary);
  }

  /* ─── 소재풀 배지 & 카드 ────────────────────────── */
  .mat-source-badge {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
  }
  .mat-source-badge-sm {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 600;
  }
  .mat-source-youtube_pipeline, .mat-source-youtube_pipeline.mat-source-badge-sm {
    background: var(--blue-soft);
    color: var(--blue);
  }
  .mat-source-deep_research, .mat-source-deep_research.mat-source-badge-sm {
    background: var(--purple-soft);
    color: var(--purple);
  }
  .mat-source-news_monitor, .mat-source-news_monitor.mat-source-badge-sm {
    background: var(--amber-soft);
    color: var(--amber);
  }
  .mat-source-manual, .mat-source-manual.mat-source-badge-sm {
    background: var(--bg);
    color: var(--text-tertiary);
  }
  .mat-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10.5px;
    font-weight: 600;
  }
  .mat-badge-unused {
    background: var(--green-soft);
    color: var(--green);
  }
  .mat-badge-used {
    background: var(--bg);
    color: var(--text-tertiary);
  }
  .mat-badge-nlm-processing {
    background: #fef3c7;
    color: #92400e;
  }
  .mat-badge-nlm-error {
    background: #fee2e2;
    color: #991b1b;
  }
  .mat-source-youtube_nlm, .mat-source-youtube_nlm.mat-source-badge-sm {
    background: #fee2e2;
    color: #dc2626;
  }
  .mat-accordion {
    font-size: 12.5px;
    color: var(--text-secondary);
  }
  .mat-acc-row {
    padding: 4px 0;
    line-height: 1.5;
  }
  .mat-acc-label {
    font-weight: 700;
    color: var(--text-tertiary);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-right: 8px;
  }
  .mat-send-btn {
    font-weight: 700 !important;
    color: var(--accent) !important;
    border: 1px solid var(--accent-border) !important;
    border-radius: 5px !important;
    min-width: 24px;
    text-align: center;
  }
  .mat-send-btn:hover {
    background: var(--accent-soft) !important;
  }

  /* ─── 소재풀 사이드패널 ────────────────────────── */
  .mat-side-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 280px;
    height: 100vh;
    background: var(--surface);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 50;
    box-shadow: var(--shadow-md);
  }
  /* 사이드패널 열릴 때 메인 콘텐츠 축소 */
  .main.has-side-panel .page-content {
    margin-right: 280px;
  }
  @media (max-width: 768px) {
    .mat-side-panel { display: none !important; }
    .main.has-side-panel .page-content { margin-right: 0; }
  }
  .mat-floating-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 100;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 16px;
    align-items: center;
    justify-content: center;
    gap: 4px;
    box-shadow: var(--shadow-lg);
  }
  /* 데스크탑에서 플로팅 버튼 숨김 (사이드패널 사용) */
  @media (min-width: 769px) {
    .mat-floating-btn { display: none !important; }
  }
  .mat-floating-btn span {
    font-size: 12px;
    font-weight: 700;
  }
  .mat-panel-overlay {
    position: fixed;
    inset: 0;
    z-index: 150;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: flex-end;
  }
  .mat-panel-overlay-content {
    width: 100%;
    max-height: 70vh;
    background: var(--surface);
    border-radius: 16px 16px 0 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  /* ─── Toast ─────────────────────────────────────── */
  .toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .toast {
    background: var(--text-primary);
    color: #fff;
    padding: 12px 20px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.3s ease-out;
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .toast.toast-success { background: #065F46; }
  .toast.toast-error { background: #991B1B; }
  .toast.toast-out { animation: toastOut 0.2s ease-in forwards; }
  @keyframes toastIn {
    from { opacity: 0; transform: translateY(12px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
  }
  @keyframes toastOut {
    to { opacity: 0; transform: translateY(-8px) scale(0.95); }
  }

  /* ─── Divider ───────────────────────────────────── */
  .divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 24px 0;
  }

  /* ─── Section spacing ───────────────────────────── */
  .section-gap { margin-bottom: 24px; }

  /* ─── Responsive ────────────────────────────────── */
  @media (max-width: 1024px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
  }
  /* mobile overrides handled in the block below */

  /* ─── Scrollbar ─────────────────────────────────── */
  .main::-webkit-scrollbar { width: 6px; }
  .main::-webkit-scrollbar-track { background: transparent; }
  .main::-webkit-scrollbar-thumb { background: #d1d1d6; border-radius: 3px; }
  .main::-webkit-scrollbar-thumb:hover { background: #b0b0b6; }

  /* Sidebar nav — dark theme scrollbar */
  .sidebar-nav::-webkit-scrollbar { width: 4px; }
  .sidebar-nav::-webkit-scrollbar-track { background: transparent; }
  .sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }
  .sidebar-nav::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }
  .sidebar-nav { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.1) transparent; }

  /* ─── Topbar Client Badge (Issue 8) ─────────────── */
  .topbar-client {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--accent-soft);
    border: 1px solid var(--accent-border);
    color: var(--accent);
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    margin-left: 10px;
    transition: all var(--transition);
  }
  .topbar-client::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
  }

  /* ─── Status Filter Tabs (Issue 9) ──────────────── */
  .filter-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
  }
  .filter-tab {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-body);
    transition: all var(--transition);
  }
  .filter-tab:hover { border-color: #d0d0d5; color: var(--text-primary); }
  .filter-tab.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
  }

  /* ─── Custom Confirm Dialog (Issue 5) ───────────── */
  .confirm-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 150;
    justify-content: center;
    align-items: center;
  }
  .confirm-overlay.active { display: flex; }
  .confirm-dialog {
    background: var(--surface);
    border-radius: var(--radius-xl);
    padding: 32px;
    width: 90%;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.2s ease-out;
  }
  .confirm-dialog-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
  }
  .confirm-dialog-icon svg { width: 22px; height: 22px; }
  /* type별 아이콘 색상 */
  .confirm-dialog[data-type="danger"] .confirm-dialog-icon { color: var(--red); background: var(--red-soft); }
  .confirm-dialog[data-type="primary"] .confirm-dialog-icon { color: var(--accent); background: var(--accent-soft); }
  .confirm-dialog[data-type="warning"] .confirm-dialog-icon { color: var(--amber); background: var(--amber-soft); }
  .confirm-dialog-title {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 8px;
  }
  .confirm-dialog-msg {
    font-size: 13.5px;
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.6;
    margin-bottom: 24px;
  }
  .confirm-dialog-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
  }
  .confirm-dialog-actions .btn { min-width: 100px; justify-content: center; }

  /* ─── Report Modal (FR-07) ──────────────────────── */
  #reportModalOverlay.active { display: flex !important; }
  .report-content h1, .report-content h2, .report-content h3 {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: -0.3px;
    color: var(--text-primary);
    margin-top: 24px;
    margin-bottom: 10px;
  }
  .report-content h1 { font-size: 20px; border-bottom: 2px solid var(--border); padding-bottom: 10px; }
  .report-content h2 { font-size: 16px; }
  .report-content h3 { font-size: 14px; color: var(--text-secondary); }
  .report-content p { margin: 8px 0; line-height: 1.8; color: var(--text-secondary); }
  .report-content table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 16px 0; }
  .report-content th, .report-content td { padding: 10px 14px; border: 1px solid var(--border); text-align: left; }
  .report-content th { background: var(--bg); font-weight: 600; color: var(--text-primary); }
  .report-content tr:nth-child(even) td { background: var(--surface-hover); }
  .report-content ul, .report-content ol { padding-left: 20px; margin: 8px 0; }
  .report-content li { margin-bottom: 4px; line-height: 1.7; color: var(--text-secondary); }
  .report-content strong { color: var(--text-primary); }
  .report-content blockquote {
    border-left: 3px solid var(--accent); padding: 8px 16px; margin: 12px 0;
    background: var(--accent-soft); color: var(--text-secondary); border-radius: 0 var(--radius) var(--radius) 0;
  }

  /* ─── Mobile Hamburger (Issue 10) ───────────────── */
  .hamburger-btn {
    display: none;
    width: 36px;
    height: 36px;
    border: none;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all var(--transition);
    flex-shrink: 0;
    margin-right: 10px;
  }
  .hamburger-btn:hover { background: var(--surface-hover); color: var(--text-primary); }
  .hamburger-btn svg { width: 18px; height: 18px; }

  .sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 40;
  }
  .sidebar-backdrop.active { display: block; }

  @media (max-width: 768px) {
    .sidebar {
      display: flex;
      transform: translateX(-100%);
      transition: transform 0.25s ease-out;
      z-index: 50;
    }
    .sidebar.open { transform: translateX(0); }
    .main { margin-left: 0; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .page-content { padding: 20px 16px 40px; }
    .topbar { padding: 0 16px; }
    .add-client-grid { grid-template-columns: 1fr; }
    .entry-card { flex-wrap: wrap; }
    .hamburger-btn { display: inline-flex; }
    .filter-tabs { gap: 4px; }
  }


  /* ─── Tone Learning Page ────────────────────────── */
  .tone-profiles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
  }

  .tone-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
  }
  .tone-card:hover { border-color: var(--accent); box-shadow: var(--shadow-md); transform: translateY(-2px); }
  .tone-card.selected { border-color: var(--accent); background: var(--accent-soft); }
  .tone-card-name {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.2px;
    margin-bottom: 4px;
  }
  .tone-card-desc {
    font-size: 12.5px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    line-height: 1.5;
  }
  .tone-card-meta {
    font-size: 11.5px;
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
  }
  .confidence-bar-wrap {
    background: var(--bg);
    border-radius: 4px;
    height: 6px;
    overflow: hidden;
    margin-bottom: 4px;
  }
  .confidence-bar {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--accent), var(--amber));
    transition: width 0.6s ease;
  }
  .confidence-label {
    font-size: 11px;
    color: var(--text-tertiary);
    text-align: right;
  }

  .tone-detail {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
  }
  .tone-detail-title {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .emotion-spectrum {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
  }
  .emotion-row {
    display: flex;
    align-items: center;
    gap: 12px;
  }
  .emotion-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    width: 80px;
    flex-shrink: 0;
  }
  .emotion-bar-wrap {
    flex: 1;
    background: var(--bg);
    border-radius: 4px;
    height: 8px;
    overflow: hidden;
  }
  .emotion-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s ease;
  }
  .emotion-val {
    font-size: 11.5px;
    color: var(--text-tertiary);
    width: 32px;
    text-align: right;
    flex-shrink: 0;
  }

  .expression-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
    margin-bottom: 16px;
  }
  .chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text-secondary);
    user-select: none;
  }
  .chip.chip-positive { background: var(--green-soft); color: #065F46; border-color: rgba(16,185,129,0.2); }
  .chip.chip-negative { background: var(--red-soft); color: #991B1B; border-color: rgba(239,68,68,0.2); }
  .chip.chip-required { background: var(--blue-soft); color: #1E40AF; border-color: rgba(59,130,246,0.2); }
  .chip.chip-forbidden { background: var(--amber-soft); color: #92400E; border-color: rgba(245,158,11,0.2); }
  .chip-remove {
    cursor: pointer;
    opacity: 0.6;
    font-size: 14px;
    line-height: 1;
    margin-left: 2px;
    transition: opacity var(--transition);
  }
  .chip-remove:hover { opacity: 1; }

  .history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .history-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: var(--bg);
    border-radius: var(--radius);
    font-size: 13px;
  }
  .history-item .history-date {
    font-size: 11.5px;
    color: var(--text-tertiary);
    white-space: nowrap;
    flex-shrink: 0;
  }
  .history-item .history-source {
    flex: 1;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* ─── Brand Guide Page ──────────────────────────── */
  .brand-section {
    margin-bottom: 28px;
  }
  .brand-section-title {
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .brand-section-title span.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
  }

  .chip-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
  }
  .chip-input-row input {
    flex: 1;
    max-width: 240px;
  }

  .seo-form-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
  }

  /* ─── Review Section in Modal ───────────────────── */
  .review-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
  }
  .review-section-title {
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .review-score-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 16px;
  }
  .review-score-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }
  .review-score-label {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
  }
  .review-score-bar-wrap {
    background: var(--bg);
    border-radius: 4px;
    height: 7px;
    overflow: hidden;
  }
  .review-score-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
  }
  .review-pass-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 14px;
  }
  .review-pass-badge.pass { background: var(--green-soft); color: #065F46; }
  .review-pass-badge.fail { background: var(--red-soft); color: #991B1B; }
  .review-feedback-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }
  .review-feedback-item {
    font-size: 13px;
    color: var(--text-secondary);
    padding: 8px 12px;
    background: var(--bg);
    border-radius: var(--radius);
    line-height: 1.5;
    border-left: 3px solid var(--border);
  }
  .review-feedback-item.fb-error { border-left-color: var(--red); }
  .review-feedback-item.fb-warn  { border-left-color: var(--amber); }
  .review-feedback-item.fb-ok    { border-left-color: var(--green); }

  /* ─── Diff Modal ────────────────────────────────── */
  .diff-modal {
    max-width: 600px;
  }
  .diff-block {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 14px 16px;
    font-size: 13px;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 12px;
  }
  .diff-block.diff-added { border-left: 3px solid var(--green); background: var(--green-soft); color: #065F46; }
  .diff-block.diff-removed { border-left: 3px solid var(--red); background: var(--red-soft); color: #991B1B; }
  .diff-block.diff-changed { border-left: 3px solid var(--amber); background: var(--amber-soft); color: #92400E; }

  /* ─── client-required nav items ────────────────── */
  .nav-item.client-required {
    opacity: 0.45;
    cursor: not-allowed;
  }
  .nav-item.client-required.client-active {
    opacity: 1;
    cursor: pointer;
  }

  /* ─── Calendar time input ────────────────────────── */
  input[type="time"].form-input { min-width: 120px; }

  /* ─── Calendar Overdue ───────────────────────────── */
  .overdue-section {
    background: var(--amber-soft);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: var(--radius-lg);
    padding: 12px;
    margin-bottom: 16px;
  }
  .overdue-section .overdue-title {
    font-size: 12px;
    font-weight: 700;
    color: #92400E;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
  }
  .entry-card.overdue { border-left: 3px solid var(--amber); }

  /* ─── Style Learning ──────────────────────────────── */
  .btn-loading { pointer-events: none; opacity: 0.8; position: relative; }
  .btn-loading::after {
    content: '';
    position: absolute;
    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;
  }
  .style-drop-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 40px 20px;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 13px;
    cursor: pointer;
    transition: all var(--transition);
  }
  .style-drop-zone:hover { border-color: #c0c0c5; }
  .style-drop-zone.dragover {
    border-color: var(--accent);
    background: rgba(99,102,241,0.04);
    color: var(--accent);
  }

/* ─── Monthly Calendar Grid ──────────────────── */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 20px;
}
.cal-grid .cal-dow {
  background: var(--surface);
  padding: 8px 4px;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary);
}
.cal-grid .cal-cell {
  background: var(--surface);
  min-height: 80px;
  padding: 6px;
  cursor: pointer;
  transition: background var(--transition);
  position: relative;
}
.cal-grid .cal-cell:hover { background: var(--surface-hover); }
.cal-grid .cal-cell.today { background: var(--accent-soft); }
.cal-grid .cal-cell.selected { outline: 2px solid var(--accent); outline-offset: -2px; }
.cal-grid .cal-cell.other-month { opacity: 0.35; }
.cal-cell-day {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.cal-grid .cal-cell.today .cal-cell-day { color: var(--accent); font-weight: 700; }
.cal-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}
.cal-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}
.cal-dot.posted { background: var(--accent); }
.cal-dot.ready { background: var(--green); }
.cal-dot.pending { background: transparent; border: 1.5px solid var(--text-tertiary); }
.cal-dot.generating { background: var(--amber); }
.cal-dot.failed { background: var(--red); }
.cal-dot.draft_saved { background: var(--purple); }

.cal-view-toggle {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.cal-view-toggle button {
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  border: none;
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}
.cal-view-toggle button.active {
  background: var(--accent);
  color: #fff;
}

.cal-nav {
  display: flex;
  align-items: center;
  gap: 12px;
}
.cal-nav-title {
  font-size: 16px;
  font-weight: 700;
  min-width: 140px;
  text-align: center;
}
.cal-nav button {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  width: 32px;
  height: 32px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}
.cal-nav button:hover { background: var(--surface-hover); }

/* ─── Accordion ──────────────────────────────── */
.accordion-section {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  overflow: hidden;
}
.accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg);
  user-select: none;
  transition: background var(--transition);
}
.accordion-header:hover { background: var(--surface-hover); }
.accordion-header .chevron {
  transition: transform var(--transition);
  width: 16px;
  height: 16px;
  opacity: 0.5;
}
.accordion-section.open .accordion-header .chevron {
  transform: rotate(180deg);
}
.accordion-body {
  display: none;
  padding: 12px 14px;
}
.accordion-section.open .accordion-body {
  display: block;
}

/* ─── 댓글 스케줄 주간 캘린더 스트립 ─────────────────── */
.comment-week-strip {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.cws-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 4px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
  min-width: 0;
}
.cws-cell:hover { background: var(--surface-hover); }
.cws-cell.today { background: var(--accent-soft); border-color: var(--accent-border); }
.cws-cell.selected { outline: 2px solid var(--accent); outline-offset: -2px; }
.cws-dow {
  font-size: 11px;
  color: var(--text-tertiary);
  font-weight: 500;
  margin-bottom: 4px;
}
.cws-date {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1;
}
.cws-cell.today .cws-date { color: var(--accent); }
.cws-count {
  margin-top: 5px;
  min-height: 18px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  border-radius: 9px;
  padding: 1px 6px;
  line-height: 16px;
  display: inline-block;
  visibility: hidden;
}
.cws-count:not(:empty) { visibility: visible; }

.agent-badge { font-size: 12px; padding: 2px 8px; border-radius: 10px; }
.agent-badge.online { background: #d1fae5; color: #065f46; }
.agent-badge.offline { background: #fee2e2; color: #991b1b; }

.badge-blog { background: #dbeafe; color: #1d4ed8; font-size: 11px; padding: 1px 6px; border-radius: 8px; }
.badge-insta { background: #fce7f3; color: #be185d; font-size: 11px; padding: 1px 6px; border-radius: 8px; }

/* ─── Agent Log Panel ─── */
.agent-log-panel {
  position: fixed; top: 0; right: 0; width: 420px; height: 100vh;
  background: #1a1a2e; color: #e0e0e0; z-index: 1000;
  transform: translateX(100%); transition: transform 0.25s ease;
  display: flex; flex-direction: column;
  box-shadow: -4px 0 24px rgba(0,0,0,0.3);
}
.agent-log-panel.open { transform: translateX(0); }
.agent-log-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px; font-size: 13px; font-weight: 700;
  background: #16213e; border-bottom: 1px solid #0f3460;
  color: #e0e0e0;
}
.agent-log-close {
  background: none; border: none; color: #888; cursor: pointer;
  padding: 4px; border-radius: 4px;
}
.agent-log-close:hover { background: rgba(255,255,255,0.1); color: #fff; }
.agent-log-body {
  flex: 1; overflow-y: auto; padding: 12px 14px; margin: 0;
  font-family: 'SF Mono', 'Consolas', 'Monaco', monospace;
  font-size: 11.5px; line-height: 1.7; white-space: pre-wrap; word-break: break-all;
}
.agent-log-body .log-info { color: #6bcb77; }
.agent-log-body .log-warning { color: #ffd93d; }
.agent-log-body .log-error { color: #ff6b6b; }
.agent-log-body .log-debug { color: #888; }
.agent-log-body .log-time { color: #4d96ff; }
.agent-log-toggle {
  position: fixed; bottom: 20px; right: 20px; z-index: 999;
  width: 44px; height: 44px; border-radius: 50%;
  background: #16213e; color: #6bcb77; border: 2px solid #0f3460;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  transition: background 0.2s;
}
.agent-log-toggle:hover { background: #1a1a2e; }
.agent-log-toggle.active { background: #0f3460; border-color: #6bcb77; }
.agent-log-body .log-source-server { color: #4d96ff; font-size: 10px; }
.agent-log-body .log-source-agent { color: #e9a53a; font-size: 10px; }
@media (max-width: 768px) {
  .agent-log-panel { width: 100vw; }
}

/* ─── Shortform Editor ─────────────────────────── */
.sf-slots-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.sf-slot-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: var(--surface);
}
.sf-slot-header {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.sf-slot-clip {
  width: 100%;
  aspect-ratio: 9/16;
  max-height: 180px;
  border-radius: 8px;
  overflow: hidden;
  background: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}
.sf-clip-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: pointer;
}
.sf-clip-empty {
  font-size: 12px;
  color: var(--text-tertiary);
}
.sf-slot-script {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-primary);
  margin-bottom: 8px;
  max-height: 60px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}
.sf-slot-actions {
  display: flex;
  gap: 4px;
}
.sf-slot-actions .btn {
  font-size: 14px;
  padding: 4px 8px;
}
/* BGM 선택 버튼 */
.sf-bgm-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 12px;
  cursor: pointer;
  background: var(--surface);
  color: var(--text-primary);
  transition: all .15s;
  user-select: none;
}
.sf-bgm-btn:hover { border-color: var(--accent); color: var(--accent); }
.sf-bgm-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.sf-bgm-play {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 11px;
  padding: 0 2px;
  color: inherit;
  opacity: .7;
  line-height: 1;
}
.sf-bgm-play:hover { opacity: 1; }

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