/* =====================================================
       DESIGN TOKENS — edit :root to restyle everything
    ===================================================== */
    :root {
      --instagram:   #C47EBD;
      --newsletter:  red;
      --blog:        #5A8DD6;
      --threads:     #57A87E;
      --s-idea:      #A0AAB4;
      --s-drafting:  #5B9CF6;
      --s-ready:     #34C97E;
      --s-posted:    #1A1A1A;
      --s-archive:   #C8CDD4;
     
      --bg:          #f7f6ef;
      --surface:     #fefdfc;
      --surface-panel: #fffefc;
      --border:      #e8e8e8;
      --border-mid:  rgba(94,94,94,0.28);
      --text:        #2a2929;
      --muted:       #5E5E5E;
      --xmuted:      #969696;
      --brand:       #2a2929;
      --brand-fg:    #fefdfc;
      --sidebar-w:   15.5rem;
      --outline-accent: #4ECDC4;
      --radius:      0.4375rem;
      --radius-sm:   0.25rem;
      --radius-lg:   0.625rem;
      --radius-xl:   0.875rem;
      --shadow:      0 0.25rem 2px rgba(0,0,0,0.11);
      --shadow-sm:   0 2px 0.5rem rgba(0,0,0,0.07);
      --font:        'Instrument Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
      /* Shared page variables */
      --surface2:    #f0efe8;
      --border2:     #d0cfc9;
      --muted2:      #7a7a7a;
      --accent:      #4A5B05;
      --accent-dim:  rgba(167,139,250,0.12);

       /* projects area global varialbes */

       --active-badge-text: #4A5B05;
       --active-badge-bkg: #D5E693;
       --mom-badge-text: #706B03;
       --mom-badge-bkg: #F5F08B;
       --cold-badge-text: #3D80DE;
       --cold-badge-bkg: #DFECFF;
    }

    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
    body { font-family: var(--font); font-size: 0.875rem; background: var(--bg); color: var(--text); }

    /* =====================================================
       APP LAYOUT
    ===================================================== */
    .app { display: flex; height: 100vh; overflow: hidden; }

.cal-main-content {
      padding: 3rem;
    }

    /* =====================================================
       SIDEBAR
    ===================================================== */
    .sidebar {
      width: var(--sidebar-w);
      flex-shrink: 0;
      background: var(--surface-panel);
      border-right: 1px solid var(--border);
      display: flex;
      flex-direction: column;
      overflow: hidden;
      transition: width 0.2s ease;
    }
    .sidebar.collapsed {
      width: 3.25rem;
    }
    .sidebar.collapsed .sidebar-body,
    .sidebar.collapsed .sidebar-foot { display: none; }
    .sidebar.collapsed .sidebar-search-wrap { display: none; }
    .sidebar.collapsed .brand-name,
    .sidebar.collapsed .brand-links { display: none; }
    .sidebar.collapsed .sidebar-quick-icons { display: none; }
    .sidebar.collapsed .sidebar-brand { justify-content: center; padding: 0.75rem 0.375rem; }
    .sidebar.collapsed .sidebar-collapsed-nav {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 2px;
      padding: 0.375rem 0.25rem;
      flex: 1;
      overflow-y: auto;
    }
    .sidebar-collapsed-nav { display: none; }
    .sidebar-collapsed-nav .sidebar-item {
      padding: 0.5rem;
      margin: 0;
      width: 2.25rem;
      height: 2.25rem;
      justify-content: center;
      border-radius: var(--radius);
    }
    .sidebar-collapsed-nav .sidebar-item svg { width: 1rem; height: 1rem; }
    .sidebar-collapsed-nav .sidebar-dot { display: none; }

    /* Quick icon strip under search */
    .sidebar-quick-icons {
      display: flex;
      align-items: center;
      gap: 2px;
      padding: 0.25rem 0.625rem 0.375rem;
      border-bottom: 1px solid var(--border);
      flex-shrink: 0;
    }
    .sb-quick-btn {
      width: 1.875rem; height: 1.875rem;
      border-radius: var(--radius);
      border: none;
      background: none;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      color: var(--muted);
      transition: all 0.1s;
      flex-shrink: 0;
    }
    .sb-quick-btn:hover { background: var(--bg); color: var(--text); }
    .sb-quick-btn.active { background: rgba(94,94,94,0.09); color: var(--text); }
    .sb-quick-btn svg { width: 0.9375rem; height: 0.9375rem; }

    /* Collapse toggle button in brand header */
    .sidebar-collapse-btn {
      width: 1.375rem; height: 1.375rem;
      border-radius: var(--radius-sm);
      border: none;
      background: none;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      color: var(--muted);
      flex-shrink: 0;
      transition: all 0.1s;
    }
    .sidebar-collapse-btn:hover { background: var(--bg); color: var(--text); }

    .sidebar-brand {
      display: flex;
      align-items: center;
      gap: 0.5625rem;
      padding: 0.9375rem 0.625rem 0.8125rem;
      border-bottom: 1px solid var(--border);
      flex-shrink: 0;
    }
    .brand-badge {
      width: 1.75rem; height: 1.75rem;
      border-radius: 0.4375rem;
      background: var(--brand);
      color: var(--brand-fg);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 0.625rem;
      font-weight: 700;
      letter-spacing: 0.5px;
      flex-shrink: 0;
    }
    .brand-name {
      font-size: 1rem;
      font-weight: 500;
      letter-spacing: 0;
      line-height: 1;
      color: var(--text);
      font-family: 'Lora', Georgia, serif;
    }
    .brand-info { display: flex; flex-direction: row; gap: 0.4375rem; justify-content: space-between; flex: 1; min-width: 0; align-items: center; }
    .brand-links { display: flex; align-items: center; gap: 0.375rem; }
    .brand-icon-link { display: flex; align-items: center; color: var(--muted); text-decoration: none; transition: color 0.1s; }
    .brand-icon-link:hover { color: var(--text); }
    .brand-sync-btn { background: none; border: none; padding: 0; cursor: pointer; font-size: 0.6875rem; font-weight: 500; font-family: var(--font); color: #EA580C; display: flex; align-items: center; gap: 0.25rem; transition: opacity 0.1s; }
    .brand-sync-btn:hover { opacity: 0.75; }
    .brand-sync-status { font-size: 0.6875rem; color: var(--xmuted); display: flex; align-items: center; gap: 0.25rem; }

    .sidebar-body { flex: 1; overflow-y: auto; padding: 0.5rem; }

    .sidebar-group { padding: 0.625rem 0px; }

    .sidebar-label {
      display: block;
      font-size: 0.6875rem;
      font-weight: 700;
      letter-spacing: 2px;
      text-transform: uppercase;
      color: var(--muted);
      padding: 0.375rem 0.875rem 1rem;
      font-family: var(--font);
    }
    .ql-header { display: flex; align-items: center; justify-content: space-between; padding: 0.5rem 0.25rem 0.25rem; }
    .ql-add-btn { background: none; border: none; cursor: pointer; color: var(--muted); font-size: 1rem; line-height: 1; width: 1.25rem; height: 1.25rem; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); }
    .ql-add-btn:hover { background: var(--bg); color: var(--text); }
    .ql-empty { font-size: 0.6875rem; color: var(--xmuted); padding: 0.25rem 0.25rem 0.5rem; }
    .ql-item { display: flex; align-items: center; gap: 0.25rem; padding: 0.25rem 0.25rem; border-radius: var(--radius-sm); }
    .ql-item:hover { background: var(--bg); }
    .ql-item:hover .ql-actions { opacity: 1; }
    .ql-name { flex: 1; font-size: 0.75rem; color: var(--text); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .ql-name:hover { color: var(--brand); text-decoration: underline; }
    .ql-actions { opacity: 0; display: flex; gap: 2px; flex-shrink: 0; transition: opacity 0.1s; }
    .ql-btn { background: none; border: none; cursor: pointer; color: var(--muted); font-size: 0.6875rem; padding: 2px 0.25rem; border-radius: var(--radius-sm); }
    .ql-btn:hover { background: var(--border); color: var(--text); }
    .ql-form-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.32); z-index: 600; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(2px); }
    .ql-form-modal { background: var(--surface); border-radius: var(--radius-xl); box-shadow: var(--shadow); padding: 20px; width: 320px; display: flex; flex-direction: column; gap: 14px; }
    .ql-form-title { font-size: 0.875rem; font-weight: 600; color: var(--text); }
    .ql-form-row { display: flex; flex-direction: column; gap: 0.3125rem; }
    .ql-form-label { font-size: 0.625rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.6px; }
    .ql-form-input { padding: 0.4375rem 0.625rem; border: 1px solid var(--border); border-radius: var(--radius); font-size: 0.8125rem; font-family: var(--font); color: var(--text); background: var(--surface); width: 100%; box-sizing: border-box; }
    .ql-form-input:focus { outline: none; border-color: var(--border-mid); }
    .ql-form-foot { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 0.25rem; }


    .sidebar-item {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      padding: 0.4375rem 0.875rem;
      border-radius: 6px;
      font-size: 0.9375rem;
      font-weight: 600;
      letter-spacing: -0.3px;
      color: var(--muted);
      cursor: pointer;
      transition: all 0.1s;
      margin-bottom: 1px;
      user-select: none;
      border: 1px solid transparent;
    }
    .sb-count { margin-left: auto; font-size: 0.625rem; font-weight: 600; color: var(--muted); background: var(--border); border-radius: 6.1875rem; padding: 1px 0.375rem; min-width: 1.125rem; text-align: center; }

    .sidebar-item:hover { background: var(--bg); color: var(--text); }
    .sidebar-item.active { background: #fcfbf9; color: var(--text); border-color: #e4e4e4; }
    .sidebar-item svg { width: 0.875rem; height: 0.875rem; flex-shrink: 0; stroke-width: 1; }
    .sidebar-dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; flex-shrink: 0; }

    /* Sidebar sub-items (Brainstorm, Scratchpad, All Content, platform channels) */
    .sidebar-subitems.collapsed { display: none; }
    .sidebar-subitem {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      padding: 0.375rem 0.875rem 0.375rem 2.25rem;
      font-size: 0.9375rem;
      font-weight: 400;
      letter-spacing: -0.3px;
      color: var(--muted);
      cursor: pointer;
      border-radius: 6px;
      font-family: var(--font);
      user-select: none;
      transition: all 0.1s;
      margin-bottom: 1px;
    }
    .sidebar-subitem:hover { background: var(--bg); color: var(--text); }
    .sidebar-subitem.active { color: var(--text); font-weight: 500; }
    /* Collapsible group chevron arrow */
    .sb-group-arrow { width: 0.8125rem; height: 0.8125rem; margin-left: auto; flex-shrink: 0; color: var(--muted); transition: transform 0.2s ease; }
    .sb-group-arrow.is-collapsed { transform: rotate(-90deg); }

    .sidebar-divider { height: 1px; background: var(--border); margin: 0.375rem 0.25rem; }

    .sidebar-foot { display:none; }

    /* Auth section in sidebar footer */
    .auth-section { margin-top: 0.5rem; }
    .auth-btn {
      width: 100%;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 0.4375rem;
      padding: 0.4375rem 0.625rem;
      border-radius: var(--radius);
      border: 1px solid var(--border);
      background: var(--surface);
      font-size: 0.75rem;
      font-weight: 500;
      font-family: var(--font);
      color: var(--text);
      cursor: pointer;
      transition: all 0.1s;
    }
    .auth-btn:hover { background: var(--bg); }
    .sync-row {
      display: flex;
      align-items: center;
      gap: 0.375rem;
      padding: 0.25rem 2px 0;
      font-size: 0.6875rem;
      color: var(--xmuted);
    }
    .sync-dot {
      width: 0.375rem; height: 0.375rem;
      border-radius: 50%;
      flex-shrink: 0;
      background: var(--xmuted);
    }
    .sync-dot.ok    { background: #34C97E; }
    .sync-dot.error { background: #F87171; }
    .sync-dot.busy  { background: #5B9CF6; animation: pulse 1s infinite; }
    @keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.4} }

    /* =====================================================
       SCRATCH PAD — NOTION STYLE
    ===================================================== */
    .scratch-page { display: flex; flex-direction: column; height: 100%; background: var(--surface); overflow: hidden; }
    .scratch-cover-wrap { position: relative; height: 13.125rem; overflow: hidden; cursor: grab; flex-shrink: 0; }
    .scratch-cover-wrap:active { cursor: grabbing; }
    .scratch-cover-img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; user-select: none; }
    .scratch-cover-actions { position: absolute; bottom: 0.625rem; right: 0.875rem; display: none; gap: 0.375rem; z-index: 2; }
    .scratch-cover-wrap:hover .scratch-cover-actions { display: flex; }
    .scratch-cover-btn { background: rgba(255,255,255,0.9); border: none; border-radius: var(--radius-sm); padding: 0.3125rem 0.6875rem; font-size: 0.6875rem; font-weight: 500; cursor: pointer; font-family: var(--font); color: var(--text); }
    .scratch-cover-btn:hover { background: #fff; }
    .scratch-no-cover { padding: 0.625rem 4.5rem 0; }
    .scratch-add-cover-btn { background: none; border: none; color: var(--xmuted); font-size: 0.75rem; cursor: pointer; font-family: var(--font); padding: 0.25rem 0; display: flex; align-items: center; gap: 0.3125rem; }
    .scratch-add-cover-btn:hover { color: var(--muted); }
    .scratch-scroll { flex: 1; overflow-y: auto; }
    .scratch-content { padding: 1.75rem 4.5rem 5rem; max-width: 53.75rem; margin: 0 auto; }
    .scratch-editor { outline: none; font-size: 0.9375rem; line-height: 1.78; color: var(--text); min-height: 60vh; }
    .scratch-editor:empty::before { content: "Start writing… # Heading 1  ## Heading 2  ### Heading 3  - List  > Quote"; color: var(--xmuted); font-style: italic; pointer-events: none; white-space: pre; }
    .scratch-editor h1 { font-size: 2em; font-weight: 700; margin: 0.5em 0 0.1em; letter-spacing: -0.5px; line-height: 1.2; }
    .scratch-editor h2 { font-size: 1.5em; font-weight: 600; margin: 0.5em 0 0.1em; line-height: 1.3; }
    .scratch-editor h3 { font-size: 1.2em; font-weight: 600; margin: 0.4em 0 0.1em; }
    .scratch-editor blockquote { border-left: 0.1875rem solid var(--border-mid); padding-left: 0.875rem; color: var(--muted); margin: 0.25rem 0; }
    .scratch-editor code { background: var(--bg); border-radius: 0.1875rem; padding: 2px 0.3125rem; font-family: monospace; font-size: 0.87em; border: 1px solid var(--border); }
    .scratch-editor hr { border: none; border-top: 2px solid var(--border); margin: 1.25rem 0; }
    .scratch-editor ul, .scratch-editor ol { padding-left: 1.5rem; margin: 0.25rem 0; }
    .scratch-editor li { margin-bottom: 0.1875rem; }
    .scratch-editor strong, .scratch-editor b { font-weight: 700; }
    .scratch-editor em, .scratch-editor i { font-style: italic; }
    .scratch-editor div:empty::before, .scratch-editor p:empty::before { content: '\00a0'; }
    .scratch-mdtip { font-size: 0.625rem; color: var(--xmuted); margin-top: 2.5rem; line-height: 1.8; }
    .scratch-mdtip span { display: inline-block; background: var(--bg); border: 1px solid var(--border); border-radius: 0.1875rem; padding: 0 0.25rem; font-family: monospace; font-size: 0.625rem; margin: 0 1px; }

    /* =====================================================
       PLANNER VIEW
    ===================================================== */
    .planner-layout { display: flex; height: 100%; overflow: hidden; }
    .planner-cal-wrap { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; border-right: 1px solid var(--border); }
    .planner-cal-nav { display: flex; align-items: center; gap: 0.5rem; padding: 0.625rem 1rem; flex-shrink: 0; border-bottom: 1px solid var(--border); background: var(--surface); }
    .cal-scroll-wrap { overflow-y: auto; max-height: calc(100vh); }
    .cal-continuous-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
    .cdn-month-first { display: flex; flex-direction: row; align-items: center; gap: 0.1875rem; }
    .cdn-month-name { font-size: 0.6875rem; font-weight: 600; color: var(--muted); letter-spacing: 0.2px; white-space: nowrap; }
    .cdn-day-num { font-size: 0.75rem; font-weight: 500; color: var(--muted); }
    .planner-cal-inner .cal-scroll-wrap { max-height: 100vh; }
    .planner-cal-nav .month-label { font-size: 0.875rem; font-weight: 600; flex: 1; font-family: 'Lora', Georgia, serif; }
    .planner-cal-nav .nav-btn { background: none; border: 1px solid var(--border); border-radius: var(--radius-sm); width: 1.625rem; height: 1.625rem; cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--text); font-size: 0.75rem; }
    .planner-cal-nav .nav-btn:hover { background: var(--bg); }
    .planner-cal-inner { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-height: 0; }

    /* Planner calendar cells get drag-drop treatment */
    .planner-cal-inner .cal-cell { transition: background 0.1s; border: 1px solid var(--border); background: var(--surface); min-height: 7.5rem; }
    .planner-cal-inner .cal-cell.drag-over { background: #EEF4FF !important; outline: 2px dashed #5B9CF6; outline-offset: -2px; }
    .cal-cell.drag-over { background: #EEF4FF !important; outline: 2px dashed #5B9CF6; outline-offset: -2px; }

    /* Right panel */
    .planner-panel { width: 17.5rem; flex-shrink: 0; display: flex; flex-direction: column; overflow: hidden; background: var(--surface); }
    .planner-panel-head { padding: 0.75rem 0.875rem 0.5rem; flex-shrink: 0; border-bottom: 1px solid var(--border); }
    .clear-date-btn { background: none; border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--muted); cursor: pointer; font-size: 0.6875rem; padding: 0.1875rem 0.4375rem; line-height: 1; transition: all 0.1s; flex-shrink: 0; height: 100%; width: 2.5rem; }
    .clear-date-btn:hover { background: var(--bg); color: var(--text); border-color: var(--border-mid); }
    .planner-panel-title { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); margin-bottom: 0.5rem; }
    .planner-filters { display: flex; flex-wrap: wrap; gap: 0.25rem; }
    .planner-search { width: 100%; box-sizing: border-box; padding: 0.3125rem 0.5625rem; font-size: 0.75rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); color: var(--text); font-family: var(--font); margin-bottom: 0.5rem; outline: none; }
    .planner-search:focus { border-color: var(--border-mid); }
    .planner-fchip { padding: 0.1875rem 0.5rem; border-radius: 6.1875rem; font-size: 0.6875rem; font-weight: 500; cursor: pointer; border: 1px solid var(--border); color: var(--muted); background: var(--bg); transition: all 0.1s; }
    .planner-fchip:hover { border-color: var(--border-mid); color: var(--text); }
    .planner-fchip.on { color: #fff; border-color: transparent; }
    .planner-list { flex: 1; overflow-y: auto; padding: 0.5rem; display: flex; flex-direction: column; gap: 0.25rem; }
    .planner-empty { text-align: center; color: var(--muted); font-size: 0.75rem; padding: 2rem 1rem; }

    /* Draggable post cards in panel */
    .planner-card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 10px; cursor: grab; transition: box-shadow 0.1s, opacity 0.1s; }
    .planner-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
    .planner-card:active { cursor: grabbing; }
    .planner-card.dragging { opacity: 0.4; }
    .planner-card-plat { display: inline-flex; align-items: center; gap: 0.1875rem; padding: 1px 0.375rem; border-radius: 6.1875rem; font-size: 0.625rem; font-weight: 500; color: #fff; margin-bottom: 0.25rem; }
    .planner-card-title { font-size: 0.75rem; font-weight: 500; font-family: var(--font); line-height: 1.3; color: var(--text); }
    .planner-card-status { font-size: 0.6875rem; color: var(--muted); margin-top: 0.1875rem; }

    /* =====================================================
       BRAINSTORM VIEW
    ===================================================== */
    .bs-layout {
      display: flex;
      flex: 1;
      overflow: hidden;
    }
    .bs-left {
      width: 13.75rem;
      flex-shrink: 0;
      border-right: 1px solid var(--border);
      display: flex;
      flex-direction: column;
      overflow: hidden;
      background: var(--surface);
    }
    .bs-left-head {
      padding: 0.875rem 0.875rem 0.625rem;
      font-size: 0.75rem;
      font-weight: 700;
      color: var(--muted);
      text-transform: uppercase;
      letter-spacing: 0.6px;
      border-bottom: 1px solid var(--border);
      flex-shrink: 0;
    }
    .bs-list { flex: 1; overflow-y: auto; padding: 0.375rem; }
    .bs-session-item {
      padding: 0.5625rem 0.625rem;
      border-radius: var(--radius);
      cursor: pointer;
      transition: background 0.1s;
    }
    .bs-session-item:hover { background: var(--bg); }
    .bs-session-item.active { background: #EEEEED; }
    .bs-session-date { font-size: 0.75rem; font-weight: 600; color: var(--text); }
    .bs-session-sub  { font-size: 0.6875rem; color: var(--xmuted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

    .bs-empty {
      padding: 2.5rem 1.25rem;
      text-align: center;
      color: var(--xmuted);
      font-size: 0.8125rem;
      line-height: 1.6;
    }

    .bs-middle {
      flex: 1;
      display: flex;
      flex-direction: column;
      overflow: hidden;
      background: var(--bg);
    }
    .bs-middle-scroll { flex: 1; overflow-y: auto; padding: 1.75rem 2rem; }
    .bs-section-label {
      font-size: 0.625rem;
      font-weight: 700;
      color: var(--xmuted);
      text-transform: uppercase;
      letter-spacing: 0.7px;
      margin-bottom: 0.625rem;
    }
    .bs-prompts {
      display: flex;
      flex-direction: column;
      gap: 0.625rem;
      margin-bottom: 1.75rem;
    }
    .bs-prompt {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius-lg);
      padding: 0.8125rem 1rem;
      font-size: 0.8438rem;
      line-height: 1.6;
      color: var(--text);
    }
    .bs-notes-wrap { border-top: 1px solid var(--border); padding: 1.25rem 2rem; background: var(--surface); flex-shrink: 0; }
    .bs-notes-label { font-size: 0.6875rem; font-weight: 600; color: var(--muted); margin-bottom: 0.5rem; }
    .bs-notes-ta {
      width: 100%;
      min-height: 5.625rem;
      padding: 0.625rem 0.75rem;
      border: 1px solid var(--border);
      border-radius: var(--radius);
      font-size: 0.8125rem;
      font-family: var(--font);
      color: var(--text);
      background: var(--bg);
      resize: vertical;
      line-height: 1.55;
    }
    .bs-notes-ta:focus { outline: none; border-color: var(--border-mid); }
    .bs-notes-actions { display: flex; justify-content: flex-end; margin-top: 0.5rem; }

    .bs-right {
      width: 17.5rem;
      flex-shrink: 0;
      border-left: 1px solid var(--border);
      display: flex;
      flex-direction: column;
      overflow-y: auto;
      background: var(--surface);
      padding: 1.25rem 1.125rem;
    }
    .bs-right-head {
      font-size: 0.8125rem;
      font-weight: 700;
      color: var(--text);
      margin-bottom: 1rem;
    }
    .bs-form-row { margin-bottom: 0.75rem; }
    .bs-form-label { font-size: 0.6875rem; font-weight: 600; color: var(--muted); margin-bottom: 0.3125rem; }
    .bs-input {
      width: 100%;
      padding: 0.4375rem 0.5625rem;
      border: 1px solid var(--border);
      border-radius: var(--radius);
      font-size: 0.8125rem;
      font-family: var(--font);
      color: var(--text);
      background: var(--bg);
    }
    .bs-input:focus { outline: none; border-color: var(--border-mid); }
    .bs-select {
      width: 100%;
      padding: 0.4375rem 1.5rem 0.4375rem 0.5625rem;
      border: 1px solid var(--border);
      border-radius: var(--radius);
      font-size: 0.8125rem;
      font-family: var(--font);
      color: var(--text);
      background: var(--bg);
      appearance: none;
      -webkit-appearance: none;
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%236B7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
      background-repeat: no-repeat;
      background-position: right 0.5rem center;
    }
    .bs-select:focus { outline: none; border-color: var(--border-mid); }
    .bs-textarea {
      width: 100%;
      padding: 0.4375rem 0.5625rem;
      border: 1px solid var(--border);
      border-radius: var(--radius);
      font-size: 0.8125rem;
      font-family: var(--font);
      color: var(--text);
      background: var(--bg);
      resize: vertical;
      min-height: 5rem;
      line-height: 1.55;
    }
    .bs-textarea:focus { outline: none; border-color: var(--border-mid); }
    .bs-plat-chips { display: flex; flex-wrap: wrap; gap: 0.3125rem; }
    .bs-plat-chip {
      padding: 0.25rem 0.5625rem;
      border-radius: 6.1875rem;
      font-size: 0.6875rem;
      font-weight: 500;
      color: #fff;
      cursor: pointer;
      opacity: 0.38;
      transition: opacity 0.1s;
    }
    .bs-plat-chip.on { opacity: 1; }

    /* =====================================================
       MAIN AREA
    ===================================================== */
    .app-main { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }
    .app-body { display: flex; flex: 1; overflow: hidden; min-height: 0; gap: 1em; }
    .app-body > #main-content { flex: 1; overflow-y: auto; min-width: 0; display: flex; flex-direction: column; }
    /* Right panel (unscheduled / feed preview) */
    .right-panel { width: 0; flex-shrink: 0; overflow: hidden; background: var(--surface); display: flex; flex-direction: column; transition: width 0.2s ease; }
    .right-panel.open { width: 30rem; overflow-y: auto; }
    /* Calendar page title bar */
    .cal-title-bar { padding: 2rem; padding-left: 2rem; padding-bottom: 2rem; flex-shrink: 0; background: var(--surface); }
    .cal-title-row { display: flex; align-items: center; gap: 1rem; justify-content: space-between; }
    .cal-page-title { font-family: 'Lora', Georgia, serif; font-size: 2.625rem; font-weight: 400; color: var(--text); margin: 0; line-height: 1; }
    .cal-page-eyebrow {
      font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 1rem;
    }
    /* Month/year + stats row */
    .cal-month-row { display: flex; align-items: center; gap: 1.8rem;  padding-bottom: 3rem; background-color: transparent; flex-shrink: 0; }
    .cal-month-nav { display: flex; align-items: center; gap: 0.375rem; }
    .cal-month-nav-btn { background: none; border: 1px solid var(--border); border-radius: var(--radius-sm); width: 1.5rem; height: 1.7rem; cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--text); font-size: 0.875rem; line-height: 1; }
    .cal-month-nav-btn:hover { background: var(--bg); }
    .cal-month-label { font-family: 'Lora', Georgia, serif; font-size: 2.1875rem; font-weight: 400; color: var(--text); white-space: nowrap; }
    .cal-month-today-btn { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.1875rem 0.5rem; font-size: 0.86rem; font-weight: 500; letter-spacing: 0.5px; text-transform: uppercase; cursor: pointer; color: var(--muted); font-family: var(--font); }
    .cal-month-today-btn:hover { background: var(--bg); color: var(--text); }
    .cal-month-stat-group { display: flex; align-items: center; gap: 0.375rem; margin-left: 0.625rem; }
.cal-month-stat-item-progress, .cal-month-stat-item-scheduled {
display: inline-flex;
padding: 0.125rem 0.4375rem;
justify-content: center;
align-items: center;
gap: 0.225rem;
}
.cal-month-stat-item-progress {background-color: #F5F08B; color:#706B03;}
.cal-month-stat-item-scheduled {background-color: #D5E693; color:#4A5B05; }
    /* View toggle buttons (Calendar / Board) */
        .cal-vtbtn {
          display: flex;
          align-items: center;
          gap: 0.3125rem;
          padding: 0.3125rem 0.625rem;
          border: none;
          border-radius: var(--radius);
          cursor: pointer;
          color: var(--muted);
          background: transparent;
          font-family: var(--font);
          font-size: 0.8125rem;
          font-style: normal;
          font-weight: 500;
          line-height: normal;
          letter-spacing: -0.02438rem;
          text-transform: capitalize;
        }
    
        .cal-vtbtn.active {
          background: var(--accent);
          color: var(--brand-fg);
          border-radius: 5px;
          box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
        }
    
        .cal-vtbtn:hover:not(.active) {
          background: var(--bg);
        }
    /* Action buttons (+ New, View Unscheduled, Feed Preview) */
        .cal-action-btn {
          display: flex;
          align-items: center;
          gap: 5px;
          padding: 6px 10px;
          background: var(--bg);
          border: 1px solid transparent;
          border-radius: 7px;
          cursor: pointer;
          color: var(--text);
          font-family: var(--font);
          white-space: nowrap;
          font-size: 0.8125rem;
          font-style: normal;
          font-weight: 500;
          line-height: normal;
          letter-spacing: -0.02438rem;
          text-transform: capitalize;
        }
    
        .cal-action-btn:hover {
          opacity: 0.85;
        }
    
        .cal-action-btn.active {
          background: var(--text);
          color: var(--surface);
        }
    /* Single-month calendar grid */
    .cal-single-grid { display: grid; grid-template-columns: repeat(7,1fr); flex: 1; }
    /* Sidebar platform dots */
    .sb-plat-dots { display: flex; gap: 0.1875rem; margin-left: auto; align-items: center; }
    .sb-plat-dot { display: inline-flex; align-items: center; justify-content: center; min-width: 0.9375rem; height: 0.9375rem; border-radius: 6.1875rem; font-size: 0.5rem; font-weight: 700; padding: 0 0.25rem; line-height: 1; }
    .sb-plat-dot.yellow { background: #f5c720; color: #5e5e5e; }
    .sb-plat-dot.green { background: #6abd06; color: #fff; }

    /* =====================================================
       CONTROLS BAR
    ===================================================== */
    .controls-bar {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      padding: 0.625rem 3rem 1rem 2rem;
      background: var(--surface);
      border-bottom: 1px solid var(--border);
      flex-shrink: 0;
    }

    .cal-vtbtn-group {
      display: flex;
      gap: 0.25rem;
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 0.5rem;
      padding: 0.1875rem; 
    }
    .cal-stats { display: flex; align-items: center; gap: 0.875rem; margin-left: 0.625rem; }
    .cal-stats-label { font-size: 0.75rem; font-weight: 600; color: var(--text); }
    .cal-stat-item { font-size: 0.75rem; color: var(--muted); display: flex; align-items: center; gap: 0.3125rem; }
    .cal-stat-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 1.25rem; height: 1.25rem; border-radius: 6.1875rem; font-size: 0.6875rem; font-weight: 700; padding: 0 0.375rem; }
    .cal-stat-green  { background: #D1FAE5; color: #065F46; }
    .cal-stat-yellow { background: #FEF3C7; color: #92400E; }
    .today-btn { font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.4px; padding: 0.3125rem 0.6875rem; border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); background: var(--surface); }
    .today-btn:hover { background: var(--bg); }

    /* Sidebar inline search */
    .sidebar-search-wrap { padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 0.4375rem; flex-shrink: 0; }
    .sidebar-search-input { flex: 1; border: 1px solid rgba(94,94,94,0.18); border-radius: 0.4375rem; padding: 0.4375rem 0.625rem; font-size: 1rem; background: var(--surface); color: var(--muted); font-family: var(--font); cursor: pointer; outline: none; }
    .sidebar-search-input:hover, .sidebar-search-input:focus { border-color: var(--border-mid); outline: none; }

    /* ── Unscheduled right panel (Figma design) ── */
    .up-panel { display: flex; flex-direction: column; height: 100%; background: var(--bg); }
    .up-header { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.875rem 0.875rem 2rem; flex-shrink: 0; }
    .up-title { font-family: var(--font); font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.91px; text-transform: uppercase; color: var(--text); white-space: nowrap; }
    .up-search { flex: 1; border: 1px solid rgba(94,94,94,0.18); border-radius: 0.4375rem; padding: 0.375rem 0.625rem; font-size: 0.875rem; font-family: var(--font); background: var(--surface); color: var(--text); outline: none; min-width: 0; }
    .up-search::placeholder { color: rgba(94,94,94,0.65); }
    .up-filters { display: flex; flex-wrap: wrap; gap: 0.25rem; padding: 0 0.875rem 2rem; flex-shrink: 0; justify-content: center; }
        .up-fchip {
        display: flex;
        align-items: center;
        gap: 0.375rem;
        background: white;
        padding: 0.25rem 0.5rem;
        font-family: var(--font);
        font-size: 0.8125rem;
        text-transform: capitalie;
        color: var(--muted);
        cursor: pointer;
        white-space: nowrap;
        padding: 0.3125rem 0.625rem;
        border: 1px solid;
        border-radius: var(--radius);
        cursor: pointer;
        color: var(--muted);
        font-style: normal;
        font-weight: 500;
        line-height: normal;
        letter-spacing: -0.01438rem;
        }
    
        .up-fchip.on {
          background: transparent;
          color: black;
          font-weight: 600;
        }
    
        .up-fchip:not(.on):hover {
          background: var(--border);
        }
    
        .up-fchip-dot {
          width: 0.625rem;
          height: 0.625rem;
          border-radius: 50%;
          flex-shrink: 0;
        }
    .up-divider { height: 1px; background: var(--border); margin: 0 0.875rem 1rem; flex-shrink: 0; }
    .up-list { flex: 1; overflow-y: auto; padding: 0 0.625rem 0.625rem; display: flex; flex-direction: column; gap: 0; }
    .up-plat-section { display: flex; flex-direction: column; }
    .up-plat-hdr { display: flex; align-items: center; justify-content: space-between; padding: 0.625rem 0 1.5rem; }
    .up-plat-hdr-left { display: flex; align-items: center; gap: 0.375rem; font-family: var(--font); font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.91px; text-transform: uppercase; color: var(--muted); }
    .up-plat-dot { width: 0.625rem; height: 0.625rem; border-radius: 50%; flex-shrink: 0; }
    .up-sort-btn { background: white; border: 0.5px solid #5e5e5e; border-radius: 0.375rem; padding: 0.1875rem 0.4375rem; font-family: var(--font); font-size: 0.5rem; font-weight: 600; color: var(--text); cursor: pointer; display: flex; align-items: center; gap: 0.25rem; }
    .up-sort-btn:hover { background: var(--bg); }
    .up-section-divider { display: none; }
    .up-card { background: white; border-radius: 3px; padding: 10px; cursor: pointer; display: flex; flex-direction: column; gap: 10px; margin-bottom: 5px; transition: box-shadow 0.1s; }
    .up-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
    .up-card.dragging { opacity: 0.4; }
    .up-card-title { font-family: 'Lora', Georgia, serif; font-size: 1rem; font-weight: 400; color: var(--text); line-height: 1.2; }
    .up-card-tags { display: flex; align-items: center; gap: 0.5rem; }
    .up-card-plat { display: flex; align-items: center; gap: 0.25rem; background: var(--bg); border-radius: 6.1875rem; padding: 0.1875rem 0.5rem; }
    .up-card-plat-dot { width: 0.4375rem; height: 0.4375rem; border-radius: 50%; flex-shrink: 0; }
    .up-card-plat-name { font-family: var(--font); font-size: 0.5625rem; font-weight: 700; letter-spacing: 0.72px; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
    .up-card-divider { width: 1px; height: 0.625rem; background: var(--border); flex-shrink: 0; }
    .up-card-status { font-family: var(--font); font-size: 0.5625rem; font-weight: 700; letter-spacing: 0.72px; text-transform: uppercase; color: var(--muted); }
    .up-empty { padding: 2rem 0.875rem; text-align: center; color: var(--muted); font-size: 0.8125rem; font-family: var(--font); }

    /* Next-month sidebar section */
    .sidebar-nm-item { display: flex; align-items: center; gap: 0.375rem; padding: 0.3125rem 0.875rem; font-size: 0.8125rem; color: var(--text); }
    .nm-badge { margin-left: auto; background: var(--bg); border: 1px solid var(--border); border-radius: 6.1875rem; font-size: 0.625rem; font-weight: 600; padding: 1px 0.375rem; color: var(--muted); }


    .filter-select {
      font-size: 0.8125rem;
      font-style: normal;
      font-weight: 500;
      line-height: normal;
      letter-spacing: -0.02438rem;
      text-transform: capitalize;
      border: 1px solid #5E5E5E;
      font-family: var(--font);
      color: var(--text);
      background: transparent;
      border: none;
      cursor: pointer;
      outline: none;
      padding: 2px 0.25rem;
    }
    .filter-select:focus { outline: none; border-color: var(--border-mid); }

    .controls-gap { flex: 1; }

    .month-nav { display: flex; align-items: center; gap: 0.25rem; }
    .month-label { font-size: 0.9375rem; font-weight: 600; min-width: 8.5625rem; text-align: center; letter-spacing: -0.3px; font-family: 'Lora', Georgia, serif; }

    .icon-btn {
      width: 1.75rem; height: 1.75rem;
      border-radius: var(--radius);
      border: 1px solid var(--border);
      background: var(--surface);
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      color: var(--muted);
      transition: all 0.1s;
      flex-shrink: 0;
    }
    .icon-btn:hover { background: var(--bg); color: var(--text); }

    .view-toggle { display: flex; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
    .vtbtn { padding: 0.3125rem 0.6875rem; font-size: 0.75rem; font-weight: 500; font-family: var(--font); background: var(--surface); color: var(--muted); border: none; cursor: pointer; transition: all 0.1s; }
    .vtbtn + .vtbtn { border-left: 1px solid var(--border); }
    .vtbtn.active { background: var(--brand); color: #fff; }


  
    /* =====================================================
       BUTTONS
    ===================================================== */
    .btn { display: inline-flex; align-items: center; gap: 0.3125rem; padding: 0.375rem 0.8125rem; border-radius: var(--radius); font-size: 0.75rem; font-weight: 500; font-family: var(--font); cursor: pointer; border: none; transition: all 0.1s; white-space: nowrap; }
    .btn-primary { background: var(--accent); color: #fff; }
    .btn-primary:hover { opacity: 0.82; }
    .btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); }
    .btn-ghost:hover { background: var(--bg); color: var(--text); }

    /* =====================================================
       MAIN CONTENT
    ===================================================== */
    #main-content { flex: 1; overflow: auto; display: flex; flex-direction: column; }

    /* =====================================================
       CALENDAR — MONTH VIEW
    ===================================================== */
    .cal-month { display: flex; flex-direction: column; flex: 1; min-height: 0; }
    .cal-dow-header { display: grid; grid-template-columns: repeat(7,1fr); border: 1px solid #E8E8E8; background: var(--surface); flex-shrink: 0; }
    .cal-dow { padding: 0.4375rem 0.75rem; font-size: 0.8125rem; font-weight: 700; color: var(--xmuted); text-transform: uppercase; letter-spacing: 0.91px; border-right: 1px solid #E8E8E8; }
    .cal-grid { display: grid; grid-template-columns: repeat(7,1fr); grid-auto-rows: minmax(6.75rem,1fr); background: var(--border); gap: 1px; flex: 1; }
    .cal-cell { background: var(--surface); padding: 0.4375rem 0.5rem; cursor: pointer; position: relative; min-height: 6.75rem; }
    .cal-cell:hover { background: #FAFAF8; }
    .cal-cell.other-month { background: #f3f3f3; }
    .cal-single-grid .cal-cell.other-month .cdn { opacity: 0.35; }
    .cdn { font-size: 0.75rem; font-weight: 500; color: var(--muted); width: 1.375rem; height: 1.375rem; display: flex; align-items: center; justify-content: center; margin-bottom: 0.3125rem; border-radius: 50%; }
    .cal-single-grid .cdn { font-size: 0.875rem; font-weight: 400; color: var(--text); width: fit-content; border-radius: 100%; margin-bottom: 0; padding: 0.3125rem; }
    .cal-single-grid .cal-cell { padding: 0.5rem 0.625rem; display: flex; flex-direction: column; gap: 0.25rem; cursor: pointer; border: 0.5px solid #E8E8E8;}
    .cal-single-grid .cell-posts { flex: 1; display: flex; flex-direction: column; gap: 0.1875rem; }
    .cal-single-grid .cell-add { display: none; }
    .cal-single-grid .cal-cell:hover .cell-add { display: flex; }
    .cdn.cdn-month-first { width: auto; height: auto; border-radius: 0.25rem; padding: 1px 0.1875rem; background: none; justify-content: flex-start; }
    .cal-cell.today .cdn { background: var(--accent); color: #fff; font-weight: 500; }
    .cell-posts { display: flex; flex-direction: column; gap: 0.1875rem; }
        .post-bar { display: flex; align-items: flex-start; gap: 0.3125rem; border-radius: 0.25rem; padding: 0.25rem 0.375rem; font-size: 0.6875rem; color: #fff; cursor: pointer; overflow: hidden; font-weight: 500; letter-spacing: 0.2px; flex-direction: column; }
    .post-bar:hover { opacity: 0.82; }
    .post-bar.dragging { opacity: 0.35; cursor: grabbing; }
    .pb-top { display: flex; align-items: flex-start; gap: 0.75rem; width: 100%; }
    .pb-icon { width: 0.6875rem; height: 0.6875rem; flex-shrink: 0; display: flex; align-items: center; justify-content: center; padding-top: 0.25rem; }
    .pb-icon svg { width: 0.6875rem; height: 0.6875rem; display: block; }
    .pbt { white-space: normal; word-break: break-word; flex: 1; line-height: 1.35; font-family: var(--font); }
    .pb-bottom { display: flex; align-items: center; gap: 0.25rem; width: 100%; }
    .pb-status { font-size: 0.5rem; font-weight: 700; background: transparent; border-radius: 2px; padding: 1px 0.25rem; padding-left: 1.5rem; letter-spacing: 0.4px; text-transform: uppercase; white-space: nowrap; }
    .pbs { font-size: 0.5625rem; font-weight: 700; background: rgba(255,255,255,0.25); border-radius: 2px; padding: 1px 0.1875rem; flex-shrink: 0; line-height: 1.4; margin-top: 1px; }
    .cell-add { display: none; align-items: center; justify-content: center; width: 1.125rem; height: 1.125rem; border-radius: 50%; background: var(--border); color: var(--muted); font-size: 0.8125rem; line-height: 1; cursor: pointer; border: none; margin-top: 0.1875rem; font-family: var(--font); }
    .cell-add:hover { background: var(--border-mid); }
    .cal-cell:hover .cell-add { display: flex; }

    /* =====================================================
       CALENDAR — WEEK VIEW
    ===================================================== */
    .cal-week { display: flex; flex-direction: column; flex: 1; min-height: 0; }
    .week-dow-hdr { display: grid; grid-template-columns: repeat(7,1fr); background: var(--surface); border-bottom: 1px solid var(--border); flex-shrink: 0; }
    .wdc { padding: 0.625rem 0.75rem; }
    .wdn { font-size: 0.6875rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
    .wdd { font-size: 1.25rem; font-weight: 600; margin-top: 2px; display: inline-flex; align-items: center; justify-content: center; width: 2.125rem; height: 2.125rem; border-radius: 50%; }
    .wdd.today { background: var(--brand); color: #fff; }
    .week-grid { display: grid; grid-template-columns: repeat(7,1fr); background: var(--border); gap: 1px; flex: 1; overflow-y: auto; }
    .week-cell { background: var(--surface); padding: 0.5rem; min-height: 17.5rem; cursor: pointer; }
    .week-cell:hover { background: #FAFAF8; }
    .week-card { border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden; margin-bottom: 8px; cursor: pointer; transition: box-shadow 0.1s; background: var(--surface); }
    .week-card:hover { box-shadow: var(--shadow-sm); }
    .wci { width: 100%; height: 5.5rem; object-fit: cover; display: block; }
    .wcip { width: 100%; height: 3.375rem; }
    .wcb { padding: 0.4375rem 0.5rem; }
    .wcp { display: inline-flex; align-items: center; gap: 0.1875rem; padding: 1px 0.375rem; border-radius: 6.1875rem; font-size: 0.625rem; font-weight: 500; color: #fff; margin-bottom: 0.25rem; }
    .wct { font-size: 0.6875rem; font-weight: 500; font-family: var(--font); line-height: 1.3; margin-bottom: 0.1875rem; }
    .wcc { font-size: 0.625rem; color: var(--muted); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
    .wcs { display: flex; align-items: center; gap: 0.25rem; font-size: 0.625rem; color: var(--muted); margin-top: 0.3125rem; }

    /* =====================================================
       HOVER POPUP
    ===================================================== */
    .hover-popup { position: fixed; z-index: 900; background: var(--surface); border-radius: 5px; box-shadow: 0 8px 40px rgba(0,0,0,0.18); overflow: hidden; pointer-events: none; opacity: 0; transition: opacity 0.13s; display: flex; flex-direction: row; width: 22rem; }
    .hover-popup.show { opacity: 1; }
    .hover-popup.has-img { height: 9rem; }
    .pp-img-col { width: 9rem; flex-shrink: 0; }
    .pp-img { width: 100%; height: 100%; object-fit: cover; display: block; }
    .pp-body { padding: 0.875rem 1rem; display: flex; flex-direction: column; flex: 1; min-width: 0; justify-content: space-between; overflow: hidden; }
    #pp-plat-pill { display: none; }
    .pp-plat-dot { width: 0.8125rem; height: 0.8125rem; border-radius: 50%; background: #c4c4c4; flex-shrink: 0; }
    .pp-plat-name { font-family: var(--font); font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; color: var(--text); white-space: nowrap; }
    .pp-title { font-family: 'Lora', Georgia, serif; font-size: 1.0625rem; font-weight: 400; line-height: 1.25; color: var(--text); flex: 1; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
    .hover-popup.has-img .pp-title { -webkit-line-clamp: 2; }
    .pp-bottom { display: flex; flex-direction: row; align-items: center; gap: 0.5rem; margin-top: 0.625rem; }
    .pp-sched { font-family: var(--font); font-size: 0.625rem; font-weight: 700; letter-spacing: 0.7px; text-transform: uppercase; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

    /* =====================================================
       ALL CONTENT VIEW
    ===================================================== */
    .all-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
    .ac-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 1rem 1.5rem 0.75rem;
      flex-shrink: 0;
      border-bottom: 1px solid var(--border);
      background: var(--surface);
      gap: 0.75rem;
    }
    .ac-head-left { display: flex; align-items: center; gap: 0.625rem; }
    .ac-head-title { font-size: 1rem; font-weight: 600; letter-spacing: -0.2px; }
    .ac-head-count { font-size: 0.75rem; color: var(--muted); background: var(--bg); border: 1px solid var(--border); padding: 2px 0.5rem; border-radius: 6.1875rem; }

    .ac-filters { display: flex; gap: 0.375rem; }

    .ac-scroll { flex: 1; overflow-y: auto; }
    .ac-list { padding: 0 1.5rem; }

    .ac-item {
      display: flex;
      align-items: flex-start;
      gap: 1rem;
      padding: 1rem 0;
      border-bottom: 1px solid var(--border);
      cursor: pointer;
      position: relative;
    }
    .ac-item:last-child { border-bottom: none; }
    .ac-item:hover .ac-actions { opacity: 1; }
    .ac-item:hover .ac-thumb-wrap { opacity: 0.9; }

    .ac-thumb-wrap { width: 5.375rem; height: 5.375rem; flex-shrink: 0; border-radius: var(--radius); overflow: hidden; background: var(--bg); }
    .ac-thumb { width: 100%; height: 100%; object-fit: cover; display: block; }
    .ac-thumb-ph { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; }

    .ac-body { flex: 1; min-width: 0; padding-top: 1px; }
    .ac-top { display: flex; align-items: center; gap: 0.375rem; margin-bottom: 0.3125rem; flex-wrap: wrap; }

    .tag-plat { display: inline-flex; align-items: center; gap: 0.1875rem; padding: 2px 0.4375rem; border-radius: 6.1875rem; font-size: 0.625rem; font-weight: 500; color: var(--accent); }
    .tag-fmt { font-size: 0.6875rem; color: var(--muted); }
    .tag-stat { display: inline-flex; align-items: center; gap: 0.25rem; font-size: 0.6875rem; color: var(--muted); }
    .tag-stat-dot { width: 0.375rem; height: 0.375rem; border-radius: 50%; flex-shrink: 0; }

    .ac-date { font-size: 0.6875rem; color: var(--xmuted); margin-left: auto; flex-shrink: 0; }
    .ac-title { font-size: 0.875rem; font-weight: 600; font-family: var(--font); margin-bottom: 0.25rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .ac-caption { font-size: 0.75rem; color: var(--muted); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
    .ac-no-caption { font-size: 0.75rem; color: var(--xmuted); font-style: italic; }

    .ac-actions {
      display: flex;
      align-items: center;
      gap: 0.1875rem;
      flex-shrink: 0;
      opacity: 0;
      transition: opacity 0.1s;
      padding-top: 1px;
    }
    .ac-icon-btn {
      width: 1.875rem; height: 1.875rem;
      border-radius: var(--radius);
      border: 1px solid var(--border);
      background: var(--surface);
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      color: var(--muted);
      transition: all 0.1s;
    }
    .ac-icon-btn:hover { background: var(--bg); color: var(--text); }

    /* =====================================================
       DETAIL VIEW
    ===================================================== */
    .detail { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

    .detail-topbar {
      display: flex;
      align-items: center;
      gap: 0.625rem;
      padding: 0.625rem 1.25rem;
      border-bottom: 1px solid var(--border);
      background: var(--surface);
      flex-shrink: 0;
    }
    .detail-back {
      display: flex;
      align-items: center;
      gap: 0.3125rem;
      font-size: 0.75rem;
      font-weight: 500;
      color: var(--muted);
      cursor: pointer;
      padding: 0.3125rem 0.5rem;
      border-radius: var(--radius);
      border: none;
      background: transparent;
      font-family: var(--font);
      transition: all 0.1s;
    }
    .detail-back:hover { background: var(--bg); color: var(--text); }
    .detail-topbar-gap { flex: 1; }

    .detail-body { display: flex; flex: 1; overflow: hidden; }

    /* Left: image + caption */
    .detail-left {
      width: 44%;
      flex-shrink: 0;
      border-right: 1px solid var(--border);
      display: flex;
      flex-direction: column;
      overflow-y: auto;
      background: var(--bg);
    }

    .detail-img-wrap {
      width: 100%;
      background: #1A1A1A;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
    }
    .detail-img { width: 100%; max-height: 26.25rem; object-fit: contain; display: block; }
    .detail-img-ph {
      width: 100%;
      height: 18.75rem;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-direction: column;
      gap: 0.75rem;
    }
    .detail-img-ph-icon {
      font-size: 4.5rem;
      line-height: 1;
      opacity: 0.55;
    }
    .detail-img-ph-label {
      font-size: 0.75rem;
      font-weight: 600;
      letter-spacing: 0.8px;
      text-transform: uppercase;
      opacity: 0.45;
    }

    .detail-caption-area { padding: 0.875rem 1.125rem 1.25rem; flex: 1; }
    .detail-handle { font-size: 0.75rem; font-weight: 700; color: var(--text); margin-bottom: 0.4375rem; }
    .detail-caption-text { font-size: 0.8125rem; line-height: 1.62; color: var(--text); white-space: pre-wrap; word-break: break-word; }
    .detail-caption-empty { font-size: 0.8125rem; color: var(--xmuted); font-style: italic; }

    /* Right: title + fields */
    .detail-right { flex: 1; overflow-y: auto; padding: 1.625rem 1.875rem; }

    .detail-title { font-size: 1.3125rem; font-weight: 700; letter-spacing: -0.4px; margin-bottom: 1.375rem; line-height: 1.2; }

    .detail-fields { display: flex; flex-direction: column; }
    .detail-field {
      display: flex;
      align-items: flex-start;
      gap: 0;
      padding: 0.8125rem 0;
      border-bottom: 1px solid var(--border);
    }
    .detail-field:last-child { border-bottom: none; }
    .dfl { font-size: 0.75rem; font-weight: 500; color: var(--muted); width: 6.875rem; flex-shrink: 0; padding-top: 2px; }
    .dfv { font-size: 0.8125rem; font-weight: 500; flex: 1; display: flex; align-items: center; gap: 0.375rem; flex-wrap: wrap; line-height: 1.4; }
    .dfv-muted { color: var(--muted); font-weight: 400; font-style: italic; }

    .det-plat { display: inline-flex; align-items: center; gap: 0.25rem; padding: 0.1875rem 0.5625rem; border-radius: 6.1875rem; font-size: 0.6875rem; font-weight: 500; color: #fff; }
    .det-stat { display: inline-flex; align-items: center; gap: 0.375rem; padding: 0.25rem 0.6875rem; border-radius: 6.1875rem; font-size: 0.75rem; font-weight: 600; color: #fff; }
    .det-stat-dot { width: 0.4375rem; height: 0.4375rem; border-radius: 50%; background: rgba(255,255,255,0.65); }

    /* Detail inline-edit form */
    .detail-img-wrap-editable {
      width: 100%;
      background: #1A1A1A;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
      position: relative;
      cursor: pointer;
    }
    .detail-img-change-overlay {
      position: absolute;
      inset: 0;
      background: rgba(0,0,0,0.42);
      display: none;
      align-items: center;
      justify-content: center;
      color: #fff;
      font-size: 0.75rem;
      font-weight: 500;
      gap: 0.3125rem;
    }
    .detail-img-wrap-editable:hover .detail-img-change-overlay { display: flex; }

    .det-img-actions {
      display: flex;
      gap: 0.375rem;
      padding: 0.5rem 0.875rem;
      border-bottom: 1px solid var(--border);
      flex-shrink: 0;
      background: var(--bg);
    }
    .det-img-actions .btn { flex: 1; justify-content: center; font-size: 0.7188rem; }

    .detail-title-input {
      font-size: 1.3125rem;
      font-weight: 700;
      font-family: var(--font);
      letter-spacing: -0.4px;
      border: none;
      outline: none;
      color: var(--text);
      background: transparent;
      width: 100%;
      margin-bottom: 1.25rem;
      padding: 0.25rem 0;
      border-bottom: 2px solid transparent;
      transition: border-color 0.1s;
    }
    .detail-title-input:focus { border-bottom-color: var(--border-mid); }
    .detail-title-input::placeholder { color: var(--xmuted); }

    .detail-form-rows { display: flex; flex-direction: column; }
    .detail-form-row {
      display: flex;
      align-items: center;
      gap: 0;
      padding: 0.6875rem 0;
      border-bottom: 1px solid var(--border);
    }
    .detail-form-row:last-child { border-bottom: none; }
    .detail-form-row.top { align-items: flex-start; }

    .det-select {
      padding: 0.375rem 1.5rem 0.375rem 0.5625rem;
      border: 1px solid var(--border);
      border-radius: var(--radius);
      font-size: 0.8125rem;
      font-family: var(--font);
      color: var(--text);
      background: var(--surface);
      cursor: pointer;
      appearance: none;
      -webkit-appearance: none;
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%236B7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
      background-repeat: no-repeat;
      background-position: right 0.5rem center;
      min-width: 10rem;
    }
    .det-select:focus { outline: none; border-color: var(--border-mid); }

    .det-input {
      padding: 0.375rem 0.5625rem;
      border: 1px solid var(--border);
      border-radius: var(--radius);
      font-size: 0.8125rem;
      font-family: var(--font);
      color: var(--text);
      background: var(--surface);
    }
    .det-input:focus { outline: none; border-color: var(--border-mid); }

    .det-datetime { display: flex; gap: 0.375rem; flex: 1; }

    .det-textarea {
      padding: 0.5rem 0.5625rem;
      border: 1px solid var(--border);
      border-radius: var(--radius);
      font-size: 0.8125rem;
      font-family: var(--font);
      color: var(--text);
      background: var(--surface);
      width: 100%;
      flex: 1;
      resize: vertical;
      min-height: 5rem;
      line-height: 1.55;
    }
    .det-textarea:focus { outline: none; border-color: var(--border-mid); }

    .det-topbar-actions { display: flex; align-items: center; gap: 0.5rem; }
    .btn-danger {
      padding: 0.375rem 0.8125rem;
      border-radius: var(--radius);
      font-size: 0.75rem;
      font-weight: 500;
      font-family: var(--font);
      cursor: pointer;
      border: 1px solid #F2C5C5;
      background: #FEF2F2;
      color: #B91C1C;
      transition: all 0.1s;
    }
    .btn-danger:hover { background: #FEE2E2; border-color: #F87171; }

    /* =====================================================
       POST MODAL
    ===================================================== */
    .overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.32); z-index: 500; display: none; align-items: center; justify-content: center; backdrop-filter: blur(0.1875rem); }
    .overlay.open { display: flex; }

        .modal {
          background: var(--surface);
          border-radius: var(--radius-xl);
          box-shadow: var(--shadow);
          width: 40%;
          max-width: 70rem;
          max-height: 90vh;
          height: 55vh;
          display: flex;
          flex-direction: column;
          overflow: hidden;
          position: relative;
        }
    
        .modal-head {
          display: none;
        }
    
        .mti {
          width: 100%;
          font-size: 1.55rem;
          font-weight: 400;
          font-family: 'Lora', Georgia, serif;
          border: none;
          outline: none;
          color: var(--text);
          background: transparent;
          letter-spacing: -0.3px;
          padding: 0 0 0.25rem;
          margin-bottom: 0.25rem;
          resize: none;
          line-height: 1.3;
          min-height: 2.6em;
          overflow: visible;
        }
    
        .mti::placeholder {
          color: var(--xmuted);
        }
    
        .modal-close {
          width: 1.75rem;
          height: 1.75rem;
          border-radius: var(--radius);
          border: none;
          background: var(--bg);
          cursor: pointer;
          display: flex;
          align-items: center;
          justify-content: center;
          color: var(--muted);
          font-size: 1.0625rem;
          line-height: 1;
          flex-shrink: 0;
        }
    
        .modal-close:hover {
          background: var(--border);
        }
    
        .modal-body {
          display: flex;
          flex: 1;
          overflow: hidden;
        }
    
        .modal-left {
          width: 35%;
          flex-shrink: 0;
          border-right: 1px solid var(--border);
          display: none;
          flex-direction: column;
        }
    
        .modal-left.ig-active {
          display: flex;
        }
    .img-area { flex: 1; min-height: 25rem; max-height: 15.9375rem; cursor: pointer; position: relative; overflow: hidden; background: var(--bg); display: flex; align-items: center; justify-content: center; }
    .iap { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
    .iah { position: absolute; inset: 0; background: rgba(0,0,0,0.38); display: none; align-items: center; justify-content: center; gap: 0.3125rem; color: #fff; font-size: 0.75rem; font-weight: 500; }
    .img-area:hover .iah { display: flex; }
    .iaph { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; color: var(--muted); pointer-events: none; }
    .iaphi { width: 2.375rem; height: 2.375rem; border-radius: 50%; background: var(--border); display: flex; align-items: center; justify-content: center; font-size: 1rem; }
    .img-acts { display: flex; gap: 0.375rem; padding: 0.625rem; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
    .img-acts .btn { flex: 1; justify-content: center; }

    .modal-right { flex: 1; overflow-y: auto; padding: 1.25rem 1.5rem; display: flex; flex-direction: column; gap: 0; }

    .fr { display: flex; flex-direction: column; gap: 0.3125rem; }
    .fl { font-size: 0.625rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.6px; }

    .plat-chips { display: flex; gap: 0.3125rem; flex-wrap: wrap; }
    .plat-chip { display: inline-flex; align-items: center; gap: 0.25rem; padding: 2px 0.625rem; border-radius: 5px; font-size: 0.6875rem; font-weight: 500; cursor: pointer; border: 2px solid transparent; opacity: 1; transition: all 0.1s; }
    .plat-chip.on { opacity: 1; border-color: var(--accent) !important; }
    .plat-chip svg { width: 0.75rem; height: 0.75rem; display: block; }

    .stat-chips { display: flex; gap: 0.3125rem; flex-wrap: wrap; }
    .stat-chip { display: inline-flex; align-items: center; gap: 0.3125rem; padding: 0.3125rem 0.625rem; border-radius: 5px; font-size: 0.6875rem; font-weight: 500; cursor: pointer; border: 1.5px solid var(--border); background: var(--surface); color: var(--muted); transition: all 0.1s; }
    .stat-chip.on { color: #fff; border-color: transparent; background-color: var(--accent) !important; }

    .fi { padding: 0.4375rem 0.625rem; border: 1px solid var(--border); border-radius: var(--radius); font-size: 0.8125rem; font-family: var(--font); color: var(--text); background: var(--surface); width: 100%; }
    .fi:focus { outline: none; border-color: var(--border-mid); }
    .fta { height: 100%;padding: 0.5rem 0.625rem; border: 1px solid var(--border); border-radius: var(--radius); font-size: 0.8125rem; font-family: var(--font); color: var(--text); background: var(--surface); width: 100%; resize: vertical; min-height: 5rem; line-height: 1.55; }
    .fta:focus { outline: none; border-color: var(--border-mid); }
    .dtr { display: grid; grid-template-columns: 1fr 1fr auto; gap: 0.5rem; align-items: center; }

    .modal-foot { display: flex; align-items: center; padding: 0.6875rem 1.375rem; border-top: 1px solid var(--border); gap: 0.5rem; flex-shrink: 0; }
    .btn-danger { padding: 0.375rem 0.8125rem; border-radius: var(--radius); font-size: 0.75rem; font-weight: 500; font-family: var(--font); cursor: pointer; border: 1px solid #FECACA; background: transparent; color: #DC2626; }
    .btn-danger:hover { background: #FEF2F2; }
    .foot-r { margin-left: auto; display: flex; gap: 0.5rem; }

    /* =====================================================
       TABLE VIEW
    ===================================================== */
    .table-wrap { padding: 1.375rem; overflow: auto; flex: 1; }
    .data-table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border); }
    .data-table th { padding: 0.5625rem 0.8125rem; text-align: left; font-size: 0.625rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; background: var(--bg); border-bottom: 1px solid var(--border); }
    .data-table td { padding: 0.6875rem 0.8125rem; font-size: 0.75rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
    .data-table tr:last-child td { border-bottom: none; }
    .data-table tbody tr:hover td { background: #FAFAF8; cursor: pointer; }
    .tt { width: 2.125rem; height: 2.125rem; border-radius: var(--radius-sm); object-fit: cover; display: block; }
    .ttp { width: 2.125rem; height: 2.125rem; border-radius: var(--radius-sm); background: var(--bg); }
    .tpl { display: inline-flex; align-items: center; gap: 0.1875rem; padding: 2px 0.4375rem; border-radius: 6.1875rem; font-size: 0.625rem; font-weight: 500; color: #fff; }
    .tst { display: inline-flex; align-items: center; gap: 0.25rem; padding: 2px 0.4375rem; border-radius: 6.1875rem; font-size: 0.625rem; border: 1px solid var(--border); color: var(--muted); }

    /* =====================================================
       BOARD VIEW
    ===================================================== */
    .board-wrap { display: flex; gap: 0.875rem; padding: 1.375rem; overflow-x: auto; flex: 1; align-items: flex-start; }
    .board-col { flex-shrink: 0; width: 15.5rem; background: var(--bg); border-radius: var(--radius-lg); border: 1px solid var(--border); overflow: hidden; }
    .bch { display: flex; align-items: center; justify-content: space-between; padding: 0.6875rem 0.8125rem; border-bottom: 1px solid var(--border); }
    .bct { display: flex; align-items: center; gap: 0.4375rem; font-size: 0.75rem; font-weight: 600; }
    .bcc { font-size: 0.625rem; color: var(--muted); background: var(--border); padding: 1px 0.375rem; border-radius: 6.1875rem; }
    .bcards { padding: 0.5625rem; display: flex; flex-direction: column; gap: 0.4375rem; min-height: 3.125rem; }
    .bcard { background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden; cursor: pointer; transition: box-shadow 0.1s; }
    .bcard:hover { box-shadow: var(--shadow-sm); }
    .bci { width: 100%; height: 7.375rem; object-fit: cover; display: block; }
    .bcip { width: 100%; height: 2.875rem; }
    .bcb { padding: 0.5625rem 0.625rem; }
    .bcp { display: inline-flex; align-items: center; gap: 0.1875rem; padding: 2px 0.4375rem; border-radius: 6.1875rem; font-size: 0.625rem; font-weight: 500; color: #fff; margin-bottom: 0.3125rem; }
    .bctt { font-size: 0.75rem; font-weight: 500; font-family: var(--font); line-height: 1.3; margin-bottom: 0.3125rem; }
    .bcd { font-size: 0.625rem; color: var(--muted); }

    /* =====================================================
       EMPTY + TOAST
    ===================================================== */
    .empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.625rem; padding: 3.75rem 1.25rem; color: var(--muted); text-align: center; flex: 1; }
    .empty-icon { font-size: 2rem; opacity: 0.3; }
    .empty-title { font-size: 0.9375rem; font-weight: 600; color: var(--text); }
    .empty-desc { font-size: 0.8125rem; max-width: 15rem; line-height: 1.5; }

    .toast { position: fixed; bottom: 1.375rem; left: 50%; transform: translateX(-50%); background: var(--brand); color: #fff; padding: 0.5625rem 1.125rem; border-radius: var(--radius-lg); font-size: 0.75rem; font-weight: 500; z-index: 9999; pointer-events: none; animation: fadeUp 0.18s ease; }
    @keyframes fadeUp { from { opacity:0; transform: translateX(-50%) translateY(0.375rem); } to { opacity:1; transform: translateX(-50%) translateY(0); } }

    #img-fi { display: none; }

    /* =====================================================
       RESPONSIVE
    ===================================================== */
    @media (max-width: 48rem) {
      /* ── Desktop elements hidden on mobile ── */
      .sidebar { display: none !important; }
      .controls-bar { display: none !important; }

      /* ── App layout ── */
      .app { flex-direction: column; }
      .app-main { overflow: hidden; height: calc(100vh - 3.25rem); height: calc(100svh - 3.25rem); display: flex; flex-direction: column; }
      #main-content { min-height: 0; overflow-y: auto; flex: 1; width: 100%; box-sizing: border-box; }
      .app-body { padding: 0 !important; }
      .right-panel { display: none !important; }
      .cal-title-bar { display: none !important; }

      /* ── Mobile header ── */
      .mobile-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 0.875rem;
        height: 3.25rem;
        background: var(--surface);
        border-bottom: 1px solid var(--border);
        position: sticky;
        top: 0;
        z-index: 300;
        flex-shrink: 0;
      }
      .mobile-header-left { display: flex; align-items: center; gap: 0.5625rem; }
      .mobile-title { font-size: 0.8125rem; font-weight: 600; color: var(--text); letter-spacing: -0.1px; }
      .mobile-header-right { display: flex; align-items: center; gap: 0.375rem; }
      .mobile-icon-btn {
        width: 2.125rem; height: 2.125rem;
        border: none; background: none; cursor: pointer;
        display: flex; align-items: center; justify-content: center;
        color: var(--text); border-radius: var(--radius);
        -webkit-tap-highlight-color: transparent;
      }
      .mobile-icon-btn:active { background: var(--bg); }

      /* ── Mobile menu dropdown ── */
      .mobile-menu {
        display: none;
        position: fixed;
        top: 3.25rem; left: 0; right: 0; bottom: 0;
        background: var(--surface);
        z-index: 290;
        overflow-y: auto;
        border-top: 1px solid var(--border);
        flex-direction: column;
      }
      .mobile-menu.open { display: flex; }
      .mobile-menu-body { flex: 1; padding: 0.5rem; }
      .mobile-menu-foot {
        padding: 0.75rem 0.5rem 1.75rem;
        border-top: 1px solid var(--border);
        flex-shrink: 0;
      }

      /* ── Mobile calendar: month header ── */
      .mob-month-hdr {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 1rem 1.25rem 1.25rem;
        background: var(--bg);
        flex-shrink: 0;
        gap: 0.75rem;
      }
      .mob-month-label {
        font-family: 'Lora', Georgia, serif;
        font-size: 2.1875rem;
        font-weight: 400;
        color: var(--text);
        line-height: 1;
        white-space: nowrap;
      }
      .mob-stats-bar {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        flex-wrap: wrap;
        padding: 1rem 1.25rem 1.6875rem;
        background: var(--bg);
        flex-shrink: 0;
      }
      .mob-stats-label { font-family: var(--font); font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.91px; text-transform: uppercase; color: var(--muted); }
      .mob-stat-item { display: flex; align-items: center; gap: 0.3125rem; font-family: var(--font); font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.91px; text-transform: uppercase; color: var(--muted); }
      .mob-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 0.9375rem; height: 0.9375rem; border-radius: 6.1875rem; font-size: 0.5rem; font-weight: 700; padding: 0 0.25rem; line-height: 1; }
      .mob-badge.yellow { background: #f5c720; color: #5e5e5e; }
      .mob-badge.green  { background: #6abd06; color: #fff; }
      .mob-nav-group { display: flex; align-items: center; gap: 0.25rem; flex-shrink: 0; }
      .mob-nav-btn { background: none; border: none; cursor: pointer; color: var(--text); padding: 0.25rem 0.375rem; font-size: 1.125rem; line-height: 1; -webkit-tap-highlight-color: transparent; }
      .mob-today-btn {
        background: var(--surface);
        border: 1px solid rgba(0,0,0,0);
        border-radius: 0.4375rem;
        font-family: var(--font);
        font-size: 0.8125rem;
        font-weight: 700;
        letter-spacing: 0.91px;
        text-transform: uppercase;
        padding: 0.375rem 0.875rem;
        cursor: pointer;
        color: var(--text);
        box-shadow: 0 4px 2px rgba(0,0,0,0.11);
        -webkit-tap-highlight-color: transparent;
      }
      .mob-today-btn:active { opacity: 0.8; }

      /* ── Mobile calendar: timeline list ── */
      .mob-cal-content { background: white; flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }
      .mob-cal-list { display: flex; flex-direction: column; }
      .mob-date-row { display: flex; min-height: 3.75rem; }
      .mob-date-col {
        width: 4.75rem;
        flex-shrink: 0;
        padding: 0.875rem 0 0.875rem 1.25rem;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
      }
      .mob-day-abbr { font-family: var(--font); font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.91px; text-transform: uppercase; color: var(--muted); }
      .mob-day-num  { font-family: 'Inter', sans-serif; font-size: 1.3125rem; font-weight: 500; color: var(--text); line-height: 1; }
      .mob-vline { width: 1px; background: var(--border); flex-shrink: 0; }
      .mob-posts-col { flex: 1; padding: 0.625rem 0.8125rem; display: flex; flex-direction: column; gap: 0.375rem; }
      .mob-group-divider { height: 1px; background: var(--border); }
      .mob-card {
        background: white;
        border-radius: 0.1875rem;
        padding: 0.625rem;
        display: flex;
        flex-direction: column;
        gap: 0.625rem;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
      }
      .mob-card:active { opacity: 0.75; }
      .mob-card-img { width: 100%; border-radius: 2px; display: block; object-fit: cover; }
      .mob-card-title { font-family: 'Lora', Georgia, serif; font-size: 1rem; font-weight: 400; color: var(--text); line-height: 1.2; }
      .mob-card-caption { font-family: var(--font); font-size: 1rem; font-weight: 400; color: var(--text); line-height: 1.12; }
      .mob-card-tags { display: flex; align-items: center; gap: 0.5rem; }
      .mob-card-plat { display: flex; align-items: center; gap: 0.25rem; background: var(--bg); border-radius: 6.1875rem; padding: 0.1875rem 0.5rem; }
      .mob-card-plat-dot { width: 0.4375rem; height: 0.4375rem; border-radius: 50%; flex-shrink: 0; }
      .mob-card-plat-name { font-family: var(--font); font-size: 0.5625rem; font-weight: 700; letter-spacing: 0.72px; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
      .mob-card-tag-div { width: 1px; height: 0.625rem; background: var(--border); flex-shrink: 0; }
      .mob-card-status { font-family: var(--font); font-size: 0.5625rem; font-weight: 700; letter-spacing: 0.72px; text-transform: uppercase; color: var(--muted); }
      .mob-empty { padding: 2.5rem 1.25rem; text-align: center; color: var(--muted); font-size: 0.875rem; font-family: var(--font); }

      /* ── Modal adjustments ── */
      .modal { max-width: 100% !important; width: 100% !important; max-height: 100vh !important; max-height: 100svh !important; border-radius: 0 !important; height: 100vh; height: 100svh; overflow: hidden; display: flex; flex-direction: column; }
      .modal-body { flex-direction: column; overflow-y: auto; }
      .modal-left { width: 100%; border-right: none; border-bottom: 1px solid var(--border); max-height: unset; flex-shrink: 0; }
      .modal-right { overflow-y: visible; order: -1; }
      .modal-body { flex: 1; min-height: 0; }
      .modal-foot { flex-shrink: 0; background: var(--surface); position: sticky; bottom: 0; z-index: 2; }
      .detail-body { flex-direction: column; }
      .detail-left { width: 100%; border-right: none; border-bottom: 1px solid var(--border); }
    }

    /* ── Mobile elements hidden on desktop ── */
    @media (min-width: 48.0625rem) { .mobile-header { display: none; } .mobile-menu { display: none !important; } .mob-today-bar { display: none; } .mob-stats-bar { display: none; } }

    /* =====================================================
       PLANNER — PER-PLATFORM SORT CONTROLS (Feature 1)
    ===================================================== */
    .planner-platform-section { margin-bottom: 0.25rem; }
    .planner-platform-hdr {
      display: flex;
      align-items: center;
      gap: 0.375rem;
      padding: 0.5rem 0.25rem 0.25rem;
    }
    .planner-platform-hdr-label {
      font-size: 0.6875rem;
      font-weight: 600;
      color: var(--muted);
      flex: 1;
      display: flex;
      align-items: center;
      gap: 0.3125rem;
    }
    .planner-platform-count {
      font-size: 0.625rem;
      color: var(--xmuted);
      background: var(--border);
      padding: 1px 0.3125rem;
      border-radius: 6.1875rem;
      font-weight: 500;
    }
    .planner-sort-select {
      padding: 2px 1.125rem 2px 0.375rem;
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      font-size: 0.625rem;
      font-family: var(--font);
      color: var(--muted);
      background: var(--surface);
      cursor: pointer;
      appearance: none;
      -webkit-appearance: none;
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5'%3E%3Cpath d='M1 1l3 3 3-3' stroke='%236B7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
      background-repeat: no-repeat;
      background-position: right 0.3125rem center;
    }
    .planner-sort-select:focus { outline: none; border-color: var(--border-mid); }
    .planner-card { cursor: pointer; }

    /* =====================================================
       SPOTLIGHT SEARCH (Feature 4)
    ===================================================== */
    .spotlight-overlay {
      position: fixed;
      inset: 0;
      background: rgba(0,0,0,0.45);
      z-index: 1000;
      display: none;
      align-items: flex-start;
      justify-content: center;
      padding-top: 15vh;
      backdrop-filter: blur(0.25rem);
    }
    .spotlight-overlay.open { display: flex; }
    .spotlight-modal {
      background: var(--surface);
      border-radius: var(--radius-xl);
      box-shadow: 0 20px 60px rgba(0,0,0,0.3);
      border: 1px solid var(--border);
      width: 92%;
      max-width: 35rem;
      overflow: hidden;
      max-height: 70vh;
      display: flex;
      flex-direction: column;
    }
    .spotlight-input-wrap {
      display: flex;
      align-items: center;
      gap: 0.625rem;
      padding: 0.875rem 1.125rem;
      border-bottom: 1px solid var(--border);
      flex-shrink: 0;
    }
    .spotlight-input-wrap svg { color: var(--muted); flex-shrink: 0; }
    .spotlight-input {
      flex: 1;
      border: none;
      outline: none;
      font-size: 1rem;
      font-family: var(--font);
      color: var(--text);
      background: transparent;
    }
    .spotlight-input::placeholder { color: var(--xmuted); }
    .spotlight-kbd {
      font-size: 0.625rem;
      color: var(--xmuted);
      background: var(--bg);
      border: 1px solid var(--border);
      border-radius: 0.25rem;
      padding: 2px 0.375rem;
      font-family: var(--font);
      flex-shrink: 0;
    }
    .spotlight-results { flex: 1; overflow-y: auto; padding: 0.375rem; }
    .spotlight-empty {
      padding: 2rem 1.25rem;
      text-align: center;
      color: var(--xmuted);
      font-size: 0.8125rem;
    }
    .spotlight-result {
      display: flex;
      align-items: center;
      gap: 0.625rem;
      padding: 0.5625rem 0.75rem;
      border-radius: var(--radius);
      cursor: pointer;
      transition: background 0.1s;
    }
    .spotlight-result:hover, .spotlight-result.focused { background: var(--bg); }
    .spotlight-result-icon {
      width: 2rem; height: 2rem;
      border-radius: var(--radius-sm);
      flex-shrink: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 0.875rem;
      overflow: hidden;
    }
    .spotlight-result-body { flex: 1; min-width: 0; }
    .spotlight-result-title {
      font-size: 0.8125rem;
      font-weight: 500;
      color: var(--text);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .spotlight-result-meta {
      display: flex;
      align-items: center;
      gap: 0.375rem;
      margin-top: 2px;
      flex-wrap: wrap;
    }
    .spotlight-result-plat {
      display: inline-flex;
      align-items: center;
      gap: 2px;
      padding: 1px 0.375rem;
      border-radius: 6.1875rem;
      font-size: 0.625rem;
      font-weight: 500;
      color: #fff;
    }
    .spotlight-result-stat {
      font-size: 0.625rem;
      color: var(--muted);
      display: flex;
      align-items: center;
      gap: 0.1875rem;
    }
    .spotlight-result-stat-dot { width: 0.3125rem; height: 0.3125rem; border-radius: 50%; flex-shrink: 0; }
    .spotlight-result-fmt { font-size: 0.625rem; color: var(--xmuted); }
    .sidebar-search-btn {
      width: 1.5rem; height: 1.5rem;
      border-radius: var(--radius);
      border: 1px solid var(--border);
      background: transparent;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      color: var(--muted);
      transition: all 0.1s;
      margin-left: auto;
      flex-shrink: 0;
    }
    .sidebar-search-btn:hover { background: var(--bg); color: var(--text); }
        .modal.ig-wide {
          width: 92%;
          height: unset;
        }
    .prop-row { display: flex; align-items: flex-start; gap: 1rem; padding: 0.625rem 0; border-bottom: 1px solid var(--border); }
    .prop-status-chips, .prop-scheduled-row { flex-direction: column;}
    .prop-row:last-child { border-bottom: none; }
    .prop-label { font-size: 0.75rem; color: var(--muted); font-weight: 500; width: 5.5rem; flex-shrink: 0; padding-top: 0.375rem; }
    .prop-select { width: auto; min-width: 8.75rem; }
    .modal-section-label { font-size: 0.625rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.6px;}
    .copy-caption-btn { display: flex; align-items: center; gap: 0.25rem; background: none; border: none; cursor: pointer; color: var(--muted); font-family: var(--font); font-size: 0.625rem; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase; padding: 2px 0.25rem; border-radius: 0.25rem; transition: color 0.1s; }
    .copy-caption-btn:hover { color: var(--text); }
    .caption-preview { flex: 1; overflow-y: auto; padding: 0.75rem 0.875rem; font-size: 0.75rem; line-height: 1.6; color: var(--text); border-top: 1px solid var(--border); }
    .cp-handle { font-weight: 700; }
    .cp-text { color: var(--text); white-space: pre-wrap; word-break: break-word; }
    .cp-text.empty { color: var(--xmuted); font-style: italic; }
    .modal-close-float { position: absolute; top: 0.875rem; right: 1rem; z-index: 10; width: 1.75rem; height: 1.75rem; border-radius: var(--radius); border: none; background: var(--bg); cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 1.0625rem; line-height: 1; }
    .modal-close-float:hover { background: var(--border); }
    .modal-outline-btns { display: flex; gap: 0.375rem; align-items: center; }
    .modal-outline-btn { font-size: 0.6875rem; font-weight: 600; padding: 0.3125rem 0.75rem; border-radius: 6.1875rem; border: none; cursor: pointer; font-family: var(--font); background: var(--outline-accent); color: #fff; transition: opacity 0.1s; white-space: nowrap; }
    .modal-outline-btn:hover { opacity: 0.82; }
    /* Outline view */
    .outline-view { display: flex; flex-direction: column; height: 100%; overflow: hidden; background: var(--bg); }
    .outline-topbar { display: flex; align-items: center; padding: 0.6875rem 1.25rem; background: var(--surface); border-bottom: 1px solid var(--border); flex-shrink: 0; gap: 0.625rem; }
    .outline-breadcrumb { flex: 1; display: flex; align-items: center; gap: 0.4375rem; font-size: 0.8125rem; font-weight: 500; color: var(--muted); min-width: 0; }
    .outline-breadcrumb .bc-link { cursor: pointer; color: var(--text); font-weight: 600; }
    .outline-breadcrumb .bc-link:hover { text-decoration: underline; }
    .outline-breadcrumb .bc-sep { opacity: 0.4; }
    .outline-breadcrumb .bc-cur { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .outline-back-btn { font-size: 0.6875rem; font-weight: 600; padding: 0.375rem 0.875rem; border-radius: 6.1875rem; border: none; cursor: pointer; font-family: var(--font); background: var(--outline-accent); color: #fff; flex-shrink: 0; transition: opacity 0.1s; }
    .outline-back-btn:hover { opacity: 0.82; }
    .outline-body { flex: 1; overflow-y: auto; padding: 1.75rem 0; }
    .outline-card { max-width: 780px; margin: 0 auto; background: var(--surface); border-radius: var(--radius-xl); box-shadow: var(--shadow-sm); padding: 32px 36px; }
    .outline-title { font-size: 1.375rem; font-weight: 700; color: var(--text); margin-bottom: 1.5rem; letter-spacing: -0.3px; }
    .outline-prop-row { display: flex; align-items: flex-start; padding: 0.625rem 0; border-bottom: 1px solid var(--border); gap: 1rem; }
    .outline-prop-label { width: 7.5rem; flex-shrink: 0; font-size: 0.8125rem; color: var(--muted); padding-top: 0.1875rem; }
    .outline-prop-val { flex: 1; }
    .outline-section-label { font-size: 0.7rem; font-weight: 500; color: var(--text); margin: 1.375rem 0 0.375rem; }
    .outline-ta { width: 100%; font-family: var(--font); font-size: 0.8125rem; border: 1px solid var(--border); border-radius: var(--radius); padding: 0.5rem 0.625rem; color: var(--text); background: var(--bg); resize: vertical; min-height: 5.625rem; outline: none; line-height: 1.55; }
    .outline-ta:focus { border-color: var(--border-mid); }
    .outline-pills { display: flex; gap: 0.375rem; flex-wrap: wrap; }
    .outline-pill { font-size: 0.75rem; font-weight: 500; padding: 0.3125rem 0.8125rem; border-radius: 5px; border: 1.5px solid var(--border); background: var(--surface); color: var(--muted); cursor: pointer; transition: all 0.1s; }
    .outline-pill.on { background: var(--accent); color: #fff; }
    .outline-select { font-family: var(--font); font-size: 0.8125rem; border: 1px solid var(--border); border-radius: var(--radius); padding: 0.375rem 0.625rem; background: var(--bg); color: var(--text); outline: none; }
    .outline-select:focus { border-color: var(--border-mid); }
    .outline-save-row { display: flex; justify-content: flex-end; margin-top: 1.5rem; gap: 0.5rem; }
    .outline-stat-chips { display: flex; gap: 0.375rem; flex-wrap: wrap; }
  

  
    /* ── Mobile FAB (floating add button) ── */
    .mob-fab { display: none; }
    @media (max-width: 48rem) {
      .mob-fab {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.4375rem;
        position: fixed;
        bottom: 1.5rem;
        right: 1.25rem;
        z-index: 300;
        background: var(--brand);
        color: var(--brand-fg);
        border: none;
        border-radius: 6.1875rem;
        padding: 0.8125rem 1.25rem;
        font-size: 0.875rem;
        font-weight: 600;
        font-family: var(--font);
        box-shadow: 0 4px 16px rgba(0,0,0,0.22);
        cursor: pointer;
        letter-spacing: -0.2px;
      }
      .mob-fab:active { opacity: 0.85; }
    }

    /* =====================================================
       INSTAGRAM PANEL
    ===================================================== */

   
    .ig-panel { display: flex; height: 100%; overflow: hidden; background: var(--bg); }
    .ig-profile-sidebar {
      width: 16.375rem; flex-shrink: 0;
      background: var(--surface); border-right: 1px solid var(--border);
      display: flex; flex-direction: column; overflow-y: auto;
      padding: 1.5rem 1.25rem 2rem; gap: 0;
    }
    .ig-avatar-wrap { display: flex; justify-content: center; margin-bottom: 1.125rem; position: relative; width: fit-content; align-self: center; }
    .ig-avatar { width: 5.625rem; height: 5.625rem; border-radius: 50%; background: var(--bg); border: 2px solid var(--border); object-fit: cover; display: block; cursor: pointer; transition: opacity 0.15s; }
    .ig-avatar:hover { opacity: 0.82; }
    .ig-avatar-overlay { position: absolute; inset: 0; border-radius: 50%; background: rgba(0,0,0,0.42); display: none; align-items: center; justify-content: center; color: #fff; font-size: 0.6875rem; font-weight: 500; cursor: pointer; text-align: center; padding: 0.25rem; }
    .ig-avatar-wrap:hover .ig-avatar-overlay { display: flex; }
    .ig-avatar-placeholder { width: 5.625rem; height: 5.625rem; border-radius: 50%; background: var(--bg); border: 2px dashed var(--border-mid); display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--xmuted); font-size: 1.5rem; transition: border-color 0.1s; }
    .ig-avatar-placeholder:hover { border-color: var(--border-mid); color: var(--muted); }
    .ig-editable-field { font-family: var(--font); border: none; outline: none; background: transparent; color: var(--text); cursor: text; border-bottom: 1px solid transparent; transition: border-color 0.1s; padding: 1px 0; }
    .ig-editable-field:hover { border-bottom-color: var(--border); }
    .ig-editable-field:focus { border-bottom-color: var(--border-mid); }
    .ig-username { font-size: 0.8125rem; font-weight: 600; width: 100%; color: var(--muted); margin-bottom: 0.625rem; }
    .ig-account-name { font-size: 0.875rem; font-weight: 700; width: 100%; margin-bottom: 2px; }
    .ig-stats-row { display: flex; gap: 0; margin: 0 0 0.75rem; }
    .ig-stat { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; padding: 0.375rem 0; }
    .ig-stat + .ig-stat { border-left: 1px solid var(--border); }
    .ig-stat-num { font-size: 0.875rem; font-weight: 700; color: var(--text); font-family: var(--font); border: none; outline: none; background: transparent; text-align: center; width: 5rem; border-bottom: 1px solid transparent; transition: border-color 0.1s; }
    .ig-stat-num:hover { border-bottom-color: var(--border); }
    .ig-stat-num:focus { border-bottom-color: var(--border-mid); }
    .ig-stat-label { font-size: 0.625rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.4px; }
    .ig-bio { font-size: 0.75rem; line-height: 1.55; color: var(--text); resize: none; width: 100%; min-height: 3.4375rem; font-family: var(--font); border: none; outline: none; background: transparent; border-bottom: 1px solid transparent; transition: border-color 0.1s; padding: 1px 0; margin-bottom: 0.375rem; }
    .ig-bio:hover { border-bottom-color: var(--border); }
    .ig-bio:focus { border-bottom-color: var(--border-mid); }
    .ig-link { font-size: 0.75rem; color: #5B9CF6; font-weight: 500; font-family: var(--font); border: none; outline: none; background: transparent; width: 100%; border-bottom: 1px solid transparent; transition: border-color 0.1s; padding: 1px 0; }
    .ig-link:hover { border-bottom-color: #5B9CF6; }
    .ig-link:focus { border-bottom-color: #5B9CF6; }
    .ig-this-month-box { margin-top: 1.125rem; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 0.75rem 0.875rem; }
    .ig-this-month-label { font-size: 0.625rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.6px; margin-bottom: 0.5rem; }
    .ig-this-month-row { display: flex; align-items: center; justify-content: space-between; font-size: 0.75rem; color: var(--muted); margin-bottom: 0.3125rem; }
    .ig-this-month-row:last-child { margin-bottom: 0; }
    .ig-this-month-num { font-size: 0.8125rem; font-weight: 700; color: var(--text); }
    .ig-feed-wrap { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; border-right: 1px solid var(--border); }
    .ig-feed-header { display: flex; align-items: center; gap: 0.625rem; padding: 0.75rem 1rem 0.625rem; flex-shrink: 0; border-bottom: 1px solid var(--border); background: var(--surface); }
    .ig-feed-title { font-size: 0.875rem; font-weight: 600; letter-spacing: -0.2px; }
    .ig-feed-count { font-size: 0.75rem; color: var(--muted); background: var(--bg); border: 1px solid var(--border); padding: 2px 0.5rem; border-radius: 6.1875rem; }
    .ig-feed-autolabel { display: none; }
    .ig-feed-scroll { flex: 1; overflow-y: auto; padding: 0.75rem; }
    .ig-feed-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.25rem; }
    .ig-tile { aspect-ratio: 2 / 2.75; position: relative; border-radius: var(--radius-sm); overflow: hidden; background: var(--bg); cursor: pointer; transition: opacity 0.1s; }
    .ig-tile img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
    .ig-tile:hover { opacity: 0.88; }
    .ig-tile.dragging { opacity: 0.35; }
    .ig-tile.drag-over-ig { outline: 2px dashed var(--instagram); outline-offset: -2px; }
    .ig-tile[draggable="true"] { cursor: grab; }
    .ig-tile[draggable="true"]:active { cursor: grabbing; }
    .ig-tile-status { display: none; }
    .ig-tile-drag-handle { position: absolute; top: 0.3125rem; right: 0.3125rem; width: 1.25rem; height: 1.25rem; border-radius: 0.25rem; background: rgba(0,0,0,0.5); display: none; align-items: center; justify-content: center; color: #fff; font-size: 0.75rem; }
    .ig-tile:hover .ig-tile-drag-handle { display: flex; }
    .ig-feed-empty { text-align: center; color: var(--muted); font-size: 0.75rem; padding: 3rem 1.5rem; line-height: 1.6; }
    .ig-unscheduled-panel { width: 17.5rem; flex-shrink: 0; display: flex; flex-direction: column; overflow: hidden; }
    .ig-unsched-head { padding: 0.75rem 0.875rem 0.625rem; flex-shrink: 0; border-bottom: 1px solid var(--border); }
    .ig-unsched-count-row { display: flex; align-items: center; gap: 0.375rem; margin-bottom: 0.1875rem; }
    .ig-unsched-count-label { font-size: 0.75rem; font-weight: 700; color: var(--text); }
    .ig-unsched-count-badge { font-size: 0.6875rem; font-weight: 700; color: var(--muted); }
    .ig-unsched-sublabel { display: none; }
    .ig-unsched-search { width: 100%; box-sizing: border-box; padding: 0.3125rem 0.5625rem; font-size: 0.75rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); color: var(--text); font-family: var(--font); margin-bottom: 0.375rem; outline: none; }
    .ig-unsched-search:focus { border-color: var(--border-mid); }
    .ig-unsched-sort { font-size: 0.6875rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
    .ig-status-pills { display: flex; flex-wrap: wrap; gap: 0.25rem; padding: 0.5rem 0.5rem 0.25rem; flex-shrink: 0; }
    .ig-status-pill { padding: 0.1875rem 0.5625rem; border-radius: 6.1875rem; font-size: 0.6875rem; font-weight: 600; cursor: pointer; border: 1.5px solid var(--border); background: var(--surface); color: var(--muted); transition: all 0.1s; white-space: nowrap; }
    .ig-status-pill:hover { border-color: var(--border-mid); color: var(--text); }
    .ig-status-pill.on { color: #fff; border-color: transparent; }
    .ig-unsched-card-date { font-size: 0.625rem; color: var(--xmuted); margin-top: 0.1875rem; }
    .ig-unsched-list { flex: 1; overflow-y: auto; padding: 0.375rem 0.5rem; display: flex; flex-direction: column; gap: 0.25rem; }
    .ig-unsched-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 10px; cursor: pointer; transition: box-shadow 0.1s; }
    .ig-unsched-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
    .ig-unsched-card-status { display: inline-flex; align-items: center; gap: 0.1875rem; font-size: 0.625rem; font-weight: 600; margin-bottom: 0.25rem; color: var(--muted); }
    .ig-unsched-card-status-dot { width: 0.3125rem; height: 0.3125rem; border-radius: 50%; flex-shrink: 0; }
    .ig-unsched-card-title { font-size: 0.75rem; font-weight: 500; color: var(--text); line-height: 1.35; }

    /* =====================================================
       NEWSLETTER PANEL
    ===================================================== */
    .nl-panel-wrap { display: flex; flex-direction: column; height: 100%; overflow: hidden; background: var(--bg); }
    .nl-topbar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 0.5rem; padding: 0.625rem 1rem; background: var(--surface); border-bottom: 1px solid var(--border); flex-shrink: 0; }
    .nl-topbar-title { font-size: 0.8125rem; font-weight: 600; color: var(--text); }
    .nl-topbar-center { display: flex; gap: 0.25rem; justify-content: center; }
    .nl-view-btn { font-size: 0.6875rem; font-weight: 600; padding: 0.3125rem 0.6875rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--muted); cursor: pointer; font-family: var(--font); transition: all 0.1s; }
    .nl-view-btn.on { background: var(--brand); color: var(--brand-fg); border-color: var(--brand); }
    .nl-view-btn:not(.on):hover { background: var(--bg); }
    /* Calendar layout */
    .nl-cal-layout { display: flex; flex: 1; overflow: hidden; }
    .nl-cal-wrap { flex: 1; display: flex; flex-direction: column; overflow: hidden; border-right: 1px solid var(--border); }
    .nl-cal-nav { display: flex; align-items: center; gap: 0.5rem; padding: 0.625rem 1rem; flex-shrink: 0; border-bottom: 1px solid var(--border); background: var(--surface); }
    .nl-cal-nav .month-label { font-size: 0.875rem; font-weight: 600; flex: 1; font-family: 'Lora', Georgia, serif; }
    .nl-cal-nav .nav-btn { background: none; border: 1px solid var(--border); border-radius: var(--radius-sm); width: 1.625rem; height: 1.625rem; cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--text); font-size: 0.75rem; }
    .nl-cal-nav .nav-btn:hover { background: var(--bg); }
    /* Board layout */
    .nl-board-layout { display: flex; flex: 1; overflow: hidden; }
    .nl-board-content { flex: 1; display: flex; gap: 0.75rem; padding: 1rem; overflow-x: auto; overflow-y: hidden; align-items: flex-start; }
    .nl-board-col { flex-shrink: 0; width: 15rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); display: flex; flex-direction: column; max-height: 100%; overflow: hidden; transition: width 0.18s ease; }
    .nl-board-col.collapsed { width: 2.375rem; }
    .nl-col-hdr { display: flex; align-items: center; gap: 0.4375rem; padding: 0.625rem 0.75rem; border-bottom: 1px solid var(--border); flex-shrink: 0; cursor: pointer; user-select: none; min-height: 2.5rem; }
    .nl-board-col.collapsed .nl-col-hdr { border-bottom: none; flex-direction: column; padding: 0.75rem 0; justify-content: flex-start; height: 100%; }
    .nl-col-dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; flex-shrink: 0; }
    .nl-board-col.collapsed .nl-col-dot { margin-bottom: 0.375rem; }
    .nl-col-label { font-size: 0.75rem; font-weight: 600; color: var(--text); flex: 1; white-space: nowrap; }
    .nl-board-col.collapsed .nl-col-label { writing-mode: vertical-rl; transform: rotate(180deg); flex: 0; font-size: 0.6875rem; }
    .nl-col-count { font-size: 0.6875rem; color: var(--muted); }
    .nl-col-chevron { font-size: 0.6875rem; color: var(--xmuted); flex-shrink: 0; }
    .nl-board-col.collapsed .nl-col-count,
    .nl-board-col.collapsed .nl-col-chevron { display: none; }
    .nl-col-cards { flex: 1; overflow-y: auto; padding: 0.5rem; display: flex; flex-direction: column; gap: 0.375rem; }
    .nl-board-col.collapsed .nl-col-cards { display: none; }
    .nl-board-card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 9px 11px; cursor: pointer; transition: box-shadow 0.1s; }
    .nl-board-card:hover { box-shadow: var(--shadow-sm); }
    .nl-board-card-title { font-size: 0.75rem; font-weight: 500; color: var(--text); line-height: 1.4; margin-bottom: 0.1875rem; }
    .nl-board-card-meta { font-size: 0.625rem; color: var(--xmuted); }
    /* Shared unscheduled panel for nl */
    .nl-unsched-panel { width: 16.25rem; flex-shrink: 0; display: flex; flex-direction: column; overflow: hidden; background: var(--surface); border-left: 1px solid var(--border); }

    /* =====================================================
       SNIPPETS LIBRARY
    ===================================================== */
    .snip-page { display:flex; height:100%; overflow:hidden; }
    .snip-sidebar { width:12.5rem; flex-shrink:0; border-right:1px solid var(--border); overflow-y:auto; padding:0.75rem 0; background:var(--surface-panel); }
    .snip-sidebar-label { font-size:0.625rem; font-weight:700; color:var(--muted); letter-spacing:1.5px; text-transform:uppercase; padding:0.625rem 1rem 0.25rem; display:block; }
    .snip-filter-item { display:flex; align-items:center; justify-content:space-between; padding:0.375rem 1rem; font-size:0.8125rem; color:var(--muted); cursor:pointer; transition:all 0.1s; }
    .snip-filter-item:hover { background:var(--bg); color:var(--text); }
    .snip-filter-item.active { background:rgba(94,94,94,0.09); color:var(--text); font-weight:500; }
    .snip-filter-count { font-size:0.625rem; font-weight:600; color:var(--muted); background:var(--border); border-radius:6.1875rem; padding:1px 0.375rem; min-width:1.125rem; text-align:center; flex-shrink:0; }
    .snip-filter-fav { display:flex; align-items:center; gap:0.375rem; padding:0.5rem 1rem; font-size:0.8125rem; color:var(--muted); cursor:pointer; transition:all 0.1s; border-bottom:1px solid var(--border); margin-bottom:0.25rem; }
    .snip-filter-fav:hover { color:var(--text); }
    .snip-filter-fav.active { color:#f59e0b; }
    .snip-main { flex:1; display:flex; flex-direction:column; overflow:hidden; min-width:0; }
    .snip-topbar { display:flex; align-items:center; gap:0.625rem; padding:0.75rem 1.25rem; border-bottom:1px solid var(--border); flex-shrink:0; }
    .snip-topbar-title { font-size:1rem; font-weight:600; color:var(--text); font-family:'Lora',Georgia,serif; flex:1; }
    .snip-add-btn { display:flex; align-items:center; gap:0.375rem; padding:0.4375rem 0.875rem; background:var(--brand); color:var(--brand-fg); border:none; border-radius:var(--radius); font-size:0.75rem; font-weight:600; font-family:var(--font); cursor:pointer; flex-shrink:0; transition:opacity 0.1s; }
    .snip-add-btn:hover { opacity:0.85; }
    .snip-search-input { flex:1; max-width:16.25rem; padding:0.4375rem 0.75rem; border:1px solid var(--border); border-radius:var(--radius); font-size:0.8125rem; font-family:var(--font); background:var(--bg); color:var(--text); }
    .snip-search-input:focus { outline:none; border-color:var(--border-mid); }
    .snip-grid-wrap { flex:1; overflow-y:auto; padding:1.25rem; }
    .snip-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(14.375rem,1fr)); gap:1rem; }
    .snip-empty { display:flex; align-items:center; justify-content:center; flex-direction:column; gap:0.75rem; height:12.5rem; font-size:0.875rem; color:var(--xmuted); }
    .snip-card { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-lg); overflow:hidden; cursor:pointer; transition:box-shadow 0.15s,transform 0.15s; }
    .snip-card:hover { box-shadow:var(--shadow); transform:translateY(-1px); }
    .snip-card-thumb { width:100%; height:8.125rem; background:var(--bg); overflow:hidden; position:relative; }
    .snip-card-thumb img { width:100%; height:100%; object-fit:cover; }
    .snip-card-thumb-code { width:100%; height:100%; overflow:hidden; padding:0.625rem 0.75rem; font-size:0.5625rem; font-family:'Courier New',monospace; color:var(--muted); white-space:pre; pointer-events:none; line-height:1.4; }
    .snip-card-fav { position:absolute; top:7px; right:7px; background:rgba(255,255,255,0.9); border-radius:50%; width:24px; height:24px; display:flex; align-items:center; justify-content:center; font-size:13px; cursor:pointer; border:none; box-shadow:0 1px 3px rgba(0,0,0,0.15); line-height:1; }
    .snip-card-fav:hover { background:#fff; }
    .snip-card-body { padding:0.6875rem 0.8125rem; }
    .snip-card-title { font-size:0.8125rem; font-weight:600; color:var(--text); margin-bottom:0.4375rem; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
    .snip-card-tags { display:flex; flex-wrap:wrap; gap:0.25rem; }
    .snip-lang-badge { font-size:0.5625rem; font-weight:700; letter-spacing:0.5px; text-transform:uppercase; padding:2px 0.375rem; border-radius:0.1875rem; }
    .snip-lang-badge.css  { background:#2563eb; color:#fff; }
    .snip-lang-badge.html { background:#ea580c; color:#fff; }
    .snip-lang-badge.js   { background:#ca8a04; color:#fff; }
    .snip-lang-badge.json { background:#16a34a; color:#fff; }
    .snip-lang-badge.default { background:var(--brand); color:var(--brand-fg); }
    .snip-cat-tag { font-size:0.5625rem; font-weight:500; padding:2px 0.375rem; border-radius:0.1875rem; background:var(--bg); color:var(--muted); border:1px solid var(--border); text-transform:capitalize; }
    .snip-plat-tag { font-size:0.5625rem; font-weight:500; padding:2px 0.375rem; border-radius:0.1875rem; background:rgba(94,94,94,0.08); color:var(--muted); }
    /* Detail view */
    .snip-detail-wrap { display:flex; height:100%; overflow:hidden; }
    .snip-detail-main { flex:1; overflow-y:auto; padding:1.75rem 2.25rem; }
    .snip-detail-back { display:inline-flex; align-items:center; gap:0.3125rem; font-size:0.75rem; color:var(--muted); cursor:pointer; margin-bottom:1.125rem; background:none; border:none; font-family:var(--font); padding:0; transition:color 0.1s; }
    .snip-detail-back:hover { color:var(--text); }
    .snip-detail-title { font-size:1.375rem; font-weight:600; color:var(--text); font-family:'Lora',Georgia,serif; margin-bottom:0.5rem; }
    .snip-detail-desc { font-size:0.875rem; color:var(--muted); line-height:1.65; margin-bottom:1.375rem; }
    .snip-detail-section { margin-bottom:1.375rem; }
    .snip-detail-section-label { font-size:0.625rem; font-weight:700; color:var(--muted); text-transform:uppercase; letter-spacing:1px; margin-bottom:0.5rem; }
    .snip-code-wrap { position:relative; border-radius:var(--radius); overflow:hidden; border:1px solid var(--border); }
    .snip-code-actions { position:absolute; top:0.5rem; right:0.5rem; display:flex; gap:0.375rem; z-index:2; }
    .snip-code-btn { display:flex; align-items:center; gap:0.25rem; padding:0.25rem 0.625rem; border-radius:var(--radius-sm); border:none; font-size:0.6875rem; font-weight:600; font-family:var(--font); cursor:pointer; transition:all 0.1s; background:rgba(255,255,255,0.12); color:#fff; }
    .snip-code-btn:hover { background:rgba(255,255,255,0.22); }
    .snip-code-pre { margin:0; font-size:0.75rem; line-height:1.6; overflow-x:auto; }
    .snip-code-pre code { font-family:'Courier New',Courier,monospace; padding:1rem !important; display:block; background:#282c34 !important; }
    .snip-detail-img { width:100%; border-radius:var(--radius); border:1px solid var(--border); margin-top:0.375rem; }
    /* Right panel */
    .snip-detail-panel { width:15rem; flex-shrink:0; border-left:1px solid var(--border); overflow-y:auto; padding:1.375rem 1.125rem; background:var(--surface-panel); }
    .snip-panel-title { font-size:0.8125rem; font-weight:600; color:var(--text); margin-bottom:0.875rem; }
    .snip-panel-row { margin-bottom:0.875rem; }
    .snip-panel-label { font-size:0.625rem; font-weight:700; color:var(--xmuted); text-transform:uppercase; letter-spacing:1px; margin-bottom:0.1875rem; }
    .snip-panel-value { font-size:0.8125rem; color:var(--text); display:flex; flex-wrap:wrap; gap:0.25rem; }
    .snip-panel-divider { height:1px; background:var(--border); margin:1rem 0; }
    .snip-changelog-title { font-size:0.6875rem; font-weight:700; color:var(--text); margin-bottom:0.625rem; text-transform:uppercase; letter-spacing:0.5px; }
    .snip-changelog-list { display:flex; flex-direction:column; gap:0.625rem; }
    .snip-changelog-entry { position:relative; padding-left:0.875rem; }
    .snip-changelog-entry::before { content:''; position:absolute; left:0; top:0.3125rem; width:0.375rem; height:0.375rem; border-radius:50%; background:var(--border-mid); }
    .snip-changelog-note { font-size:0.75rem; color:var(--text); line-height:1.4; }
    .snip-changelog-date { font-size:0.625rem; color:var(--xmuted); margin-top:2px; }
    /* Snippet modal */
    .snip-modal-overlay { position:fixed; inset:0; background:rgba(0,0,0,0.4); z-index:900; display:none; align-items:center; justify-content:center; backdrop-filter:blur(2px); }
    .snip-modal-overlay.open { display:flex; }
    .snip-modal { background:var(--surface); border-radius:var(--radius-xl); box-shadow:0 20px 60px rgba(0,0,0,0.2); width:min(680px,95vw); max-height:90vh; display:flex; flex-direction:column; overflow:hidden; }
    .snip-modal-hdr { display:flex; align-items:center; justify-content:space-between; padding:1rem 1.375rem; border-bottom:1px solid var(--border); flex-shrink:0; }
    .snip-modal-title { font-size:0.9375rem; font-weight:600; color:var(--text); }
    .snip-modal-close { background:none; border:none; font-size:1rem; cursor:pointer; color:var(--muted); padding:2px 0.375rem; border-radius:var(--radius-sm); }
    .snip-modal-close:hover { background:var(--bg); }
    .snip-modal-body { flex:1; overflow-y:auto; padding:1.25rem 1.375rem; display:flex; flex-direction:column; gap:0.875rem; }
    .snip-modal-row { display:flex; flex-direction:column; gap:0.25rem; }
    .snip-modal-row-2 { display:grid; grid-template-columns:1fr 1fr; gap:0.75rem; }
    .snip-modal-label { font-size:0.625rem; font-weight:700; color:var(--muted); text-transform:uppercase; letter-spacing:0.6px; }
    .snip-modal-input { padding:0.5rem 0.6875rem; border:1px solid var(--border); border-radius:var(--radius); font-size:0.8125rem; font-family:var(--font); color:var(--text); background:var(--surface); }
    .snip-modal-input:focus { outline:none; border-color:var(--border-mid); }
    .snip-modal-textarea { padding:0.5rem 0.6875rem; border:1px solid var(--border); border-radius:var(--radius); font-size:0.75rem; font-family:'Courier New',Courier,monospace; color:var(--text); background:var(--surface); resize:vertical; min-height:10rem; line-height:1.5; }
    .snip-modal-textarea:focus { outline:none; border-color:var(--border-mid); }
    .snip-modal-select { padding:0.5rem 0.6875rem; border:1px solid var(--border); border-radius:var(--radius); font-size:0.8125rem; font-family:var(--font); color:var(--text); background:var(--surface); }
    .snip-chips { display:flex; flex-wrap:wrap; gap:0.375rem; }
    .snip-chip { padding:0.3125rem 0.75rem; border-radius:var(--radius); border:1.5px solid var(--border); font-size:0.75rem; font-weight:500; color:var(--muted); cursor:pointer; background:var(--surface); transition:all 0.1s; user-select:none; }
    .snip-chip.on { background:var(--brand); color:var(--brand-fg); border-color:var(--brand); }
    .snip-fav-row { display:flex; align-items:center; gap:0.625rem; }
    .snip-fav-star-btn { font-size:1.375rem; background:none; border:none; cursor:pointer; line-height:1; color:var(--border); transition:color 0.1s; padding:0; }
    .snip-fav-star-btn.on { color:#f59e0b; }
    .snip-modal-foot { display:flex; justify-content:flex-end; gap:0.5rem; padding:0.75rem 1.375rem; border-top:1px solid var(--border); flex-shrink:0; }
    .snip-img-preview-thumb { max-width:100%; max-height:6.25rem; border-radius:var(--radius); border:1px solid var(--border); margin-top:0.375rem; display:none; }

    /* Newsletter sidebar — hide unscheduled panel while sidebar is open */
    .nl-panel-wrap.sidebar-open .nl-unsched-panel { display: none; }
    /* Right panel — wider for newsletter sidebar */
    .right-panel.open { width: 26rem; }


/* ── Newsletter Sidebar ──────────────────────────────────── */
.nl-sidebar                    { display:flex; flex-direction:column; height:100%; overflow:hidden; }
.nl-sidebar-header             { display:flex; align-items:center; justify-content:space-between; padding:0.875rem 1.125rem; border-bottom:1px solid var(--border); flex-shrink:0; background:var(--surface); }
.nl-sidebar-label              { font-size:0.6875rem; font-weight:700; letter-spacing:0.09em; text-transform:uppercase; color:var(--muted); }
.nl-sidebar-close              { background:none; border:none; cursor:pointer; color:var(--muted); font-size:1.125rem; line-height:1; padding:0; display:flex; }
.nl-sidebar-body               { flex:1; overflow-y:auto; overflow-x:hidden; padding:1.25rem 1.125rem; display: flex; flex-direction: column; row-gap: 0.5rem;}
.nl-sidebar-body .mti          { width:100%; box-sizing:border-box; margin-bottom:1.125rem; }
.nl-sidebar-notes  { margin-top:1rem; }
.modal-section-label { margin-bottom: 0.5rem;}
.nl-outline-divider            { height:1px; background:var(--border); margin:0 0 1.25rem; }
.nl-outline-section { margin-top: 3rem;}
.nl-outline-heading            { font-size:0.6875rem; font-weight:700; letter-spacing:0.1em; text-transform:uppercase; color:var(--text); margin-bottom:1.125rem; }
.nl-sidebar-body .outline-pills { margin-bottom:1rem; }
.nl-sidebar-body .outline-select { margin-bottom:2rem; }
.nl-sidebar-footer             { padding:0.875rem 1.125rem; border-top:1px solid var(--border); display:flex; justify-content:space-between; align-items:center; flex-shrink:0; background:var(--surface); }
.nl-sidebar-footer-actions     { display:flex; gap:0.5rem; }

.nl-nav-sep    { width:1px; height:18px; background:var(--border); margin:0 6px; flex-shrink:0; }
.nl-month-label { font-size:0.8125rem; font-weight:600; min-width:8rem; font-family:'Lora',Georgia,serif; text-align: center; }

.post-bar.nl-view { background: var(--accent); 
.pbd {display: none;}
}

.nl-sidebar-copy { background:none; border:none; cursor:pointer; color:var(--muted); padding:0; display:flex; align-items:center; transition:color 0.1s; }
.nl-sidebar-copy:hover { color:var(--brand); }
.nl-sidebar-header-actions { display:flex; align-items:center; gap:0.5rem; }
