*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg:        #0a0a0a;
    --surface:   #111111;
    --surface2:  #1c1c1c;
    --border:    #2a2a2a;
    --accent:    #f5c800;
    --accent-h:  #d4ac00;
    --text:      #f0f0f0;
    --muted:     #777;
    --danger:    #ff4444;
    --r:         10px;
    --header-h:  60px;
    --nav-h:     48px;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    color-scheme: dark;
}

/* ── HEADER ─────────────────────────────────────── */
header {
    height: var(--header-h);
    background: #000;
    border-bottom: 1px solid var(--accent);
    display: flex;
    align-items: center;
    padding: 0 1.25rem;
    gap: 1rem;
    flex-shrink: 0;
    z-index: 100;
}
.logo {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent);
    margin-right: auto;
    letter-spacing: -0.4px;
}

/* ── ACCOUNT PILL ────────────────────────────────── */
.account-wrap { position: relative; }
.account-pill {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.3rem 0.75rem 0.3rem 0.3rem;
    cursor: pointer;
    transition: border-color .15s;
}
.account-pill:hover { border-color: var(--accent); }
.av {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--accent);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.72rem; font-weight: 700; color: #000;
    flex-shrink: 0;
}
.acc-name {
    font-size: 0.85rem;
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.chevron { color: var(--muted); font-size: 0.65rem; }

.acc-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #111;
    border: 1px solid var(--border);
    border-radius: var(--r);
    min-width: 240px;
    z-index: 300;
    box-shadow: 0 10px 30px rgba(0,0,0,.75);
    overflow: hidden;
}
.acc-dropdown.open { display: block; }
.dd-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.65rem 1rem;
    cursor: pointer;
    transition: background .1s;
    font-size: 0.85rem;
}
.dd-item:hover  { background: var(--surface2); }
.dd-item.selected { color: var(--accent); }
.dd-divider { border-top: 1px solid var(--border); }
.dd-connect { color: var(--accent); font-weight: 600; }

/* ── PLATFORM DOTS ───────────────────────────────── */
.dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    display: inline-block;
}
.dot-ig     { background: var(--accent); }
.dot-fb     { background: #e0e0e0; }
.dot-x      { background: #aaaaaa; }
.dot-li     { background: #b0c4de; }
.dot-tiktok { background: #ffffff; }

/* ── WEEK NAV ────────────────────────────────────── */
.week-nav {
    height: var(--nav-h);
    background: #000;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    flex-shrink: 0;
}
.wbtn {
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.28rem 0.7rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.82rem;
    transition: background .15s, border-color .15s;
}
.wbtn:hover { background: var(--border); border-color: var(--accent); }
.wbtn.today {
    background: var(--accent);
    border-color: var(--accent);
    color: #000;
    font-weight: 700;
}
.wbtn.today:hover { background: var(--accent-h); }
.week-label {
    font-weight: 600;
    font-size: 0.88rem;
    min-width: 185px;
    text-align: center;
    color: var(--text);
}

/* ── CALENDAR WRAP ───────────────────────────────── */
.cal-wrap {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* LANDSCAPE – 7 columns */
@media (orientation: landscape) {
    .cal-grid {
        flex: 1;
        display: grid;
        grid-template-columns: repeat(7, 1fr);
        gap: 1px;
        background: var(--border);
        overflow-y: auto;
    }
    .day-cell {
        background: var(--bg);
        display: flex;
        flex-direction: column;
        overflow-y: auto;
        min-height: 0;
    }
}

/* PORTRAIT – 7 rows */
@media (orientation: portrait) {
    .cal-grid {
        flex: 1;
        display: grid;
        grid-template-rows: repeat(7, minmax(110px, auto));
        gap: 1px;
        background: var(--border);
        overflow-y: auto;
    }
    .day-cell {
        background: var(--bg);
        display: flex;
        flex-direction: row;
    }
    .day-cell .day-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        min-width: 54px;
        max-width: 54px;
        border-right: 1px solid var(--border);
        border-bottom: none;
        height: 100%;
        padding: 0.6rem 0.25rem;
        justify-content: flex-start;
        gap: 0.3rem;
    }
    .day-cell .posts-list {
        flex: 1;
        overflow-y: auto;
    }
}

/* ── DAY CELL ────────────────────────────────────── */
.day-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.6rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.day-name {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--muted);
    letter-spacing: 0.06em;
}
.day-num {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--text);
}
.day-header.is-today .day-num {
    background: var(--accent);
    color: #000;
    width: 28px; height: 28px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.88rem;
    font-weight: 800;
}
.add-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--muted);
    width: 24px; height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    display: flex; align-items: center; justify-content: center;
    transition: all .15s;
    flex-shrink: 0;
}
.add-btn:hover { background: var(--accent); border-color: var(--accent); color: #000; }

/* ── POSTS LIST ──────────────────────────────────── */
.posts-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 0.4rem 0.45rem;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

/* ── POST CARD ───────────────────────────────────── */
.post-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.42rem 0.5rem;
    display: flex;
    gap: 0.45rem;
    align-items: flex-start;
    cursor: pointer;
    transition: border-color .15s;
    position: relative;
}
.post-card:hover { border-color: var(--accent); }
.thumb {
    width: 36px; height: 36px;
    border-radius: 5px;
    background: var(--surface2);
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem;
    overflow: hidden;
    position: relative;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 5px; }
.thumb-video-ph {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.9rem;
    color: var(--muted);
}
.thumb-extra {
    position: absolute;
    bottom: 2px; right: 2px;
    background: rgba(0,0,0,.78);
    color: #fff;
    font-size: 0.55rem;
    font-weight: 700;
    padding: 1px 3px;
    border-radius: 3px;
    line-height: 1.4;
    pointer-events: none;
}
.post-meta  { flex: 1; min-width: 0; }
.post-time  { font-size: 0.68rem; font-weight: 700; color: var(--accent); margin-bottom: 1px; }
.post-cap   { font-size: 0.7rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.post-badges { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 3px; }
.del-btn {
    position: absolute;
    top: 4px; right: 4px;
    background: none; border: none;
    color: transparent;
    cursor: pointer;
    font-size: 0.68rem;
    padding: 2px 4px;
    border-radius: 3px;
    transition: all .15s;
}
.post-card:hover .del-btn { color: var(--danger); }
.del-btn:hover { background: rgba(255,68,68,.14); }

/* ── BADGES ──────────────────────────────────────── */
.badge {
    font-size: 0.58rem;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 3px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.b-acc      { background: rgba(255,255,255,.06); color: var(--text); }
.b-acc.b-ig { background: rgba(245,200,0,.13);   color: var(--accent); }
.b-acc.b-fb { background: rgba(240,240,240,.08);  color: #ddd; }
.b-acc.b-x  { background: rgba(180,180,180,.08);  color: #bbb; }
.b-acc.b-li { background: rgba(176,196,222,.1);   color: #b0c4de; }
.b-acc.b-tiktok { background: rgba(255,255,255,.07); color: #eee; }

/* ── MODAL ───────────────────────────────────────── */
.overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.82);
    z-index: 500;
    align-items: center;
    justify-content: center;
}
.overlay.open { display: flex; }
.modal {
    background: #111;
    border: 1px solid var(--accent);
    border-radius: var(--r);
    width: min(480px, 95vw);
    max-height: 92dvh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,.8);
    display: flex;
    flex-direction: column;
}
.modal-hd {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    background: #000;
    flex-shrink: 0;
}
.modal-title { font-weight: 700; font-size: 0.95rem; color: var(--accent); }
.modal-x {
    background: none; border: none;
    color: var(--muted);
    cursor: pointer;
    font-size: 1.3rem;
    line-height: 1;
    transition: color .15s;
}
.modal-x:hover { color: var(--text); }
.modal-body { padding: 1.15rem 1.25rem; display: flex; flex-direction: column; gap: 0.9rem; overflow-y: auto; }

/* ── ACCOUNT CHECKBOXES (modal) ──────────────────── */
.acc-checks { display: flex; flex-direction: column; gap: 0.35rem; }
.acc-check-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.7rem;
    border: 1px solid var(--border);
    border-radius: 7px;
    cursor: pointer;
    transition: border-color .15s, background .15s;
    user-select: none;
}
.acc-check-row:hover   { border-color: var(--accent); background: rgba(245,200,0,.04); }
.acc-check-row.checked { border-color: var(--accent); background: rgba(245,200,0,.07); }
.check-box {
    width: 17px; height: 17px;
    border: 1.5px solid var(--border);
    border-radius: 4px;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    flex-shrink: 0;
    color: transparent;
    transition: all .15s;
}
.acc-check-row.checked .check-box {
    background: var(--accent);
    border-color: var(--accent);
    color: #000;
}
.check-acc-name {
    flex: 1;
    font-size: 0.83rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.plat-label { font-size: 0.68rem; color: var(--muted); flex-shrink: 0; }

/* ── MULTI-MEDIA GRID (modal) ────────────────────── */
.media-grid { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-bottom: 0.4rem; }
.media-item {
    position: relative;
    width: 70px; height: 70px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--surface2);
    flex-shrink: 0;
}
.media-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-video-ph {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem; color: var(--muted);
}
.media-remove {
    position: absolute;
    top: 3px; right: 3px;
    background: rgba(0,0,0,.75);
    border: none; color: #fff;
    width: 18px; height: 18px;
    border-radius: 50%;
    font-size: 0.75rem;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    padding: 0;
    transition: background .15s;
}
.media-remove:hover { background: var(--danger); }

/* ── UPLOAD ZONE ─────────────────────────────────── */
.upload-zone {
    border: 2px dashed var(--border);
    border-radius: 8px;
    padding: 0.85rem 1.2rem;
    text-align: center;
    cursor: pointer;
    transition: border-color .15s, background .15s;
    position: relative;
}
.upload-zone:hover,
.upload-zone.drag { border-color: var(--accent); background: rgba(245,200,0,.04); }
.upload-zone input[type="file"] {
    position: absolute; inset: 0;
    opacity: 0; cursor: pointer;
    width: 100%; height: 100%;
}
.upload-icon { font-size: 1.4rem; margin-bottom: 0.25rem; }
.upload-hint { font-size: 0.75rem; color: var(--muted); }

/* ── FIELDS ──────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 0.28rem; }
.field label { font-size: 0.75rem; font-weight: 600; color: var(--accent); letter-spacing: 0.04em; }
.field textarea,
.field input[type="time"],
.field input[type="date"],
.field input[type="datetime-local"] {
    background: #0a0a0a;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-family: inherit;
    font-size: 0.85rem;
    padding: 0.5rem 0.65rem;
    outline: none;
    width: 100%;
    transition: border-color .15s;
    resize: vertical;
}
.field textarea { min-height: 78px; resize: vertical; }
.field textarea:focus,
.field input:focus { border-color: var(--accent); }
input[type="time"]::-webkit-calendar-picker-indicator,
input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(.6); cursor: pointer; }

/* ── MOVE DATE BUTTON ────────────────────────────── */
.btn-move {
    background: none;
    border: 1px dashed var(--border);
    color: var(--muted);
    padding: 0.42rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.78rem;
    font-family: inherit;
    transition: all .15s;
    width: 100%;
    text-align: left;
}
.btn-move:hover { border-color: var(--accent); color: var(--accent); }
.btn-move.active { border-style: solid; border-color: var(--accent); color: var(--accent); background: rgba(245,200,0,.05); }

/* ── MODAL FOOTER ────────────────────────────────── */
.modal-ft { padding: 0 1.25rem 1.25rem; display: flex; gap: 0.5rem; flex-shrink: 0; }
.btn-pri {
    flex: 1;
    background: var(--accent);
    border: none; color: #000;
    padding: 0.58rem 1rem;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    font-size: 0.88rem;
    transition: background .15s;
}
.btn-pri:hover { background: var(--accent-h); }
.btn-sec {
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.58rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.88rem;
    transition: background .15s, border-color .15s;
}
.btn-sec:hover { background: var(--border); border-color: var(--muted); }

/* ── SCROLLBAR ───────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 99px; opacity: 0.4; }