/* New look (html.pie-premium) — Email module: MessagesDrawer.vue and its lists / composers.
   Owned by one session at a time; see .claude/skills/pie-new-ui/SKILL.md.
   The base drawer and composer rules live in pie-premium.css ("main_message_wrapper", "compose-css");
   this file holds the fixes on top of them. Every selector starts with html.pie-premium. */

/* ==========================================================================
   Message times (Inbox / Sent / Drafts / Scheduled). template1.css paints every
   `.message-view .threads time` magenta with !important, which beat pie-premium.css's
   ink colour (and the Scheduled tab's inline orange), so the time stayed the classic colour.
   ========================================================================== */
html.pie-premium .pp-shell .main_message_wrapper .message-view .threads time {
    color: var(--pp-ink-3) !important;
}

/* Unread inbox rows: the time reads darker instead of the classic magenta */
html.pie-premium .pp-shell .main_message_wrapper .message-view .threads .thread.unread time {
    color: var(--pp-ink) !important;
}

/* Scheduled tab: the send time is the row's key fact, so it keeps an accent */
html.pie-premium .pp-shell .main_message_wrapper .message-view .threads .scheduled-time time {
    color: var(--pp-acc) !important;
}

/* Scheduled tab row tools (Send now · delete · time · tag): one aligned line. The time had an
   inline width of 110px that clipped "Nov 12 10:15 AM", and Bootstrap's mt-2 / my-2 / p-0
   utilities (all !important) pushed the pieces out of line */
html.pie-premium .pp-shell .main_message_wrapper .message-view .threads .scheduled-time {
    display: flex;
    align-items: center;
    gap: 12px;
}

html.pie-premium .pp-shell .main_message_wrapper .message-view .threads .scheduled-time > * {
    float: none !important;
    margin: 0 !important;
}

html.pie-premium .pp-shell .main_message_wrapper .message-view .threads .scheduled-time time {
    width: auto !important;
    min-width: 150px;
    text-align: right;
    white-space: nowrap;
}

html.pie-premium .pp-shell .main_message_wrapper .message-view .threads .scheduled-time .send-now-schedule-btn {
    width: auto;
    height: 30px;
    padding: 0 14px !important;
    border: 0;
    border-radius: 999px;
    background: var(--pp-acc);
    color: #fff;
    font: 12.5px/30px var(--pp-bold);
    letter-spacing: 0;
    text-transform: none;
}

html.pie-premium .pp-shell .main_message_wrapper .message-view .threads .scheduled-time .send-now-schedule-btn:hover {
    filter: brightness(1.08);
}

html.pie-premium .pp-shell .main_message_wrapper .message-view .threads .scheduled-time i {
    color: var(--pp-ink-3);
    font-size: 16px;
}

html.pie-premium .pp-shell .main_message_wrapper .message-view .threads .scheduled-time i:hover {
    color: var(--pp-acc);
}

/* Drafts tab: the "Draft" label was Bootstrap's red (.text-danger, !important) */
html.pie-premium .pp-shell .main_message_wrapper .message-view .threads .name.text-danger {
    color: var(--pp-acc) !important;
}

/* ==========================================================================
   Templates tab
   ========================================================================== */
/* "+ New template": the same button as "+ Compose" (that one sits in .btn-groups, this one does not) */
html.pie-premium .pp-shell .main_message_wrapper .email-messages-section > .btn.btn-primary {
    height: 40px;
    min-width: 0;
    padding: 0 16px;
    border: 1px solid var(--pp-acc);
    border-radius: 10px;
    background: var(--pp-acc);
    color: #fff;
    font: 13.5px var(--pp-bold);
    letter-spacing: 0;
    text-transform: none;
}

html.pie-premium .pp-shell .main_message_wrapper .email-messages-section > .btn.btn-primary::after {
    content: none;
}

/* Template rows: name and the edit / delete buttons on one centred line */
html.pie-premium .pp-shell .main_message_wrapper .message-view-templates .threads li.thread {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 52px;
    padding: 0 12px 0 16px;
}

html.pie-premium .pp-shell .main_message_wrapper .message-view-templates .threads li.thread:hover {
    background: var(--pp-hover);
}

html.pie-premium .pp-shell .main_message_wrapper .message-view-templates .threads .people {
    float: none;
    width: auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

html.pie-premium .pp-shell .main_message_wrapper .message-view-templates .threads li.thread > .pull-right {
    display: flex;
    flex: none;
    gap: 4px;
    float: none !important;
}

html.pie-premium .pp-shell .main_message_wrapper .message-view-templates .gray_light_pills {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    margin: 0 !important;
    padding: 0;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
}

html.pie-premium .pp-shell .main_message_wrapper .message-view-templates .gray_light_pills i {
    color: var(--pp-ink-3) !important;
    font-size: 16px;
}

html.pie-premium .pp-shell .main_message_wrapper .message-view-templates .gray_light_pills:hover {
    background: var(--pp-panel-2);
}

html.pie-premium .pp-shell .main_message_wrapper .message-view-templates .gray_light_pills:hover i {
    color: var(--pp-acc) !important;
}

/* ==========================================================================
   Phones (≤640px)
   ========================================================================== */
@media (max-width: 640px) {
    /* The empty reset-filter column (it only fills when a date is picked) stacked as a 58px gap */
    html.pie-premium .pp-shell .main_message_wrapper .filter-message .reset-filter-col:not(:has(> *)) {
        display: none !important;
    }

    /* Inbox / Sent rows: name and time/status on one line, the subject on its own full-width line
       below (it was squeezed between the two floats and broke mid-word) */
    html.pie-premium .pp-shell .main_message_wrapper .message-view .threads li.thread > a {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 4px 8px;
    }

    html.pie-premium .pp-shell .main_message_wrapper .message-view .threads li.thread > a > .people {
        flex: 1 1 0;
        order: 1;
        min-width: 0;
        float: none;
        width: auto;
    }

    html.pie-premium .pp-shell .main_message_wrapper .message-view .threads li.thread > a > .people .people {
        float: none;
        width: auto !important;
    }

    html.pie-premium .pp-shell .main_message_wrapper .message-view .threads li.thread > a > .time-with-tag {
        order: 2;
        float: none !important;
    }

    html.pie-premium .pp-shell .main_message_wrapper .message-view .threads li.thread > a > :is(.subject-line, .subject, .body) {
        flex: 0 0 100%;
        order: 3;
        word-break: normal;
        overflow-wrap: anywhere;
    }

    html.pie-premium .pp-shell .main_message_wrapper .message-view .threads li.thread > a > .subject-line > * {
        word-break: normal;
    }

    /* Scheduled rows: the tools wrap above the recipient instead of running off the left edge */
    html.pie-premium .pp-shell .main_message_wrapper .message-view .threads .scheduled-time {
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 8px 12px;
        float: none !important;
        padding: 12px 16px 0;
    }

    html.pie-premium .pp-shell .main_message_wrapper .message-view .threads .scheduled-time time {
        min-width: 0;
        text-align: left;
    }
}
