/* ============================================================
 * mitbbs Webmail — Gmail-style layout + light-yellow official palette
 * (redesign 2026-10-06: clean app card, pill search, sidebar compose
 * pill, Gmail-style folder nav + message rows; desktop + mobile)
 * ============================================================ */
:root {
    --hxwm-space: 4px;
    --hxwm-radius: 8px;
    --hxwm-btn-grad: linear-gradient(180deg, #fdf6dd, #f7e9bd);
    --hxwm-btn-grad-hover: linear-gradient(180deg, #fef9e7, #faedc8);
    --hxwm-border: #d4b84a;
    --hxwm-border-soft: #e9dcab;
    --hxwm-text: #4a3f22;
    --hxwm-text-strong: #332a10;
    --hxwm-text-soft: #8a7440;
    --hxwm-header: #7a5c14;
    --hxwm-card: #fffdf5;
    --hxwm-bg: #f7f4e9;
    --hxwm-unread: #fff8e1;
    --hxwm-active-fill: #fdf3d0;
    --hxwm-row-line: #f1ead0;
    --hxwm-surface: #ffffff;
    --hxwm-surface-2: #fffdf4;
    --hxwm-search-bg: #fdf8e3;
    --hxwm-nav-hover: #faf3da;
    --hxwm-font: -apple-system, "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
}

/* ---------- app shell ---------- */
.hxwm-wrap {
    font-family: var(--hxwm-font);
    color: var(--hxwm-text);
    background: var(--hxwm-surface);
    border: 1px solid var(--hxwm-border-soft);
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(122, 92, 20, .08), 0 4px 14px rgba(122, 92, 20, .06);
    overflow: hidden;
    margin: 16px 0;
}

/* ---------- top bar (Gmail style: white, pill search) ---------- */
.hxwm-topbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--hxwm-surface);
    border-bottom: 1px solid var(--hxwm-border-soft);
}
.hxwm-topbar h1 {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    color: var(--hxwm-header);
    white-space: nowrap;
}
.hxwm-topbar .hxwm-search {
    flex: 1;
    display: flex;
    max-width: 640px;
    gap: 8px;
}
.hxwm-topbar input[type="search"] {
    flex: 1;
    padding: 10px 20px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 15px;
    font-family: inherit;
    background: var(--hxwm-search-bg);
    color: var(--hxwm-text);
    min-width: 0;
}
.hxwm-topbar input[type="search"]::placeholder { color: var(--hxwm-text-soft); }
.hxwm-topbar input[type="search"]:focus {
    outline: none;
    background: #fff;
    border-color: var(--hxwm-border);
    box-shadow: 0 1px 5px rgba(122, 92, 20, .16);
}
.hxwm-topbar .hxwm-search .hx-btn { border-radius: 999px; }
.hxwm-topbar-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
    align-items: center;
    flex: none;
}

/* ---------- buttons ---------- */
.hxwm-btn {
    display: inline-block;
    padding: calc(var(--hxwm-space) * 2) calc(var(--hxwm-space) * 4);
    background: var(--hxwm-btn-grad);
    border: 1px solid var(--hxwm-border);
    border-radius: var(--hxwm-radius);
    color: var(--hxwm-text);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
    white-space: nowrap;
}
.hxwm-btn:hover { background: var(--hxwm-btn-grad-hover); }
.hxwm-btn:focus-visible { outline: 2px solid var(--hxwm-header); outline-offset: 2px; }
.hxwm-btn-primary { font-size: 15px; padding: calc(var(--hxwm-space) * 2.5) calc(var(--hxwm-space) * 6); }
.hxwm-btn-ghost { background: #fff; }

/* ---------- 3-pane layout ---------- */
.hxwm-panes { display: flex; min-height: 560px; background: var(--hxwm-surface); }

/* sidebar: compose pill + Gmail-style folder nav */
.hxwm-folders {
    width: 236px;
    flex: 0 0 236px;
    background: var(--hxwm-surface);
    padding: 12px 16px 16px 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.hxwm-compose-pill {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 0 0 12px 16px;
    padding: 14px 18px;
    background: var(--hxwm-btn-grad);
    border: 1px solid var(--hxwm-border);
    border-radius: 999px;
    color: var(--hxwm-text);
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    font-family: inherit;
    box-shadow: 0 1px 3px rgba(122, 92, 20, .18);
    white-space: nowrap;
}
.hxwm-compose-pill:hover {
    background: var(--hxwm-btn-grad-hover);
    box-shadow: 0 2px 7px rgba(122, 92, 20, .24);
}
.hxwm-folders-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px 4px 28px;
}
.hxwm-folders h2, .hxwm-folders-head .hx-card-title {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--hxwm-text-soft);
    margin: 0;
}
.hxwm-folder {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 16px 9px 28px;
    border-radius: 0 999px 999px 0;
    color: var(--hxwm-text);
    text-decoration: none;
    font-size: 14.5px;
}
.hxwm-folder:hover { background: var(--hxwm-nav-hover); }
.hxwm-folder.hxwm-active {
    background: var(--hxwm-active-fill);
    font-weight: 700;
    color: var(--hxwm-header);
}
.hxwm-badge {
    margin-left: auto;
    background: var(--hxwm-border);
    color: #fff;
    border-radius: 999px;
    font-size: 12px;
    min-width: 22px;
    text-align: center;
    padding: 1px 6px;
    font-weight: 700;
}
.hxwm-quota { margin-top: auto; padding: 16px 16px 0 28px; font-size: 12px; color: var(--hxwm-text-soft); }
.hxwm-quota-bar { height: 6px; background: #f0e6c4; border-radius: 3px; overflow: hidden; margin-top: var(--hxwm-space); }
.hxwm-quota-bar i { display: block; height: 100%; background: var(--hxwm-border); border-radius: 3px; }

/* message list: Gmail rows */
.hxwm-list {
    width: 360px;
    flex: 0 0 360px;
    border-left: 1px solid var(--hxwm-row-line);
    border-right: 1px solid var(--hxwm-row-line);
    background: var(--hxwm-surface);
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.hxwm-list-head { padding: 14px 16px 10px; border-bottom: 1px solid var(--hxwm-row-line); }
.hxwm-list-head .hx-card-title { font-size: 16px; font-weight: 700; color: var(--hxwm-text-strong); }
.hxwm-bulkactions {
    display: none; gap: var(--hxwm-space);
    padding: calc(var(--hxwm-space) * 2) calc(var(--hxwm-space) * 3);
    background: var(--hxwm-unread); border-bottom: 1px solid var(--hxwm-row-line); font-size: 13px;
}
.hxwm-bulkactions.hxwm-show { display: flex; align-items: center; flex-wrap: wrap; }
.hxwm-bulkactions button { font-size: 13px; padding: var(--hxwm-space) calc(var(--hxwm-space) * 2); }
.hxwm-msgs { overflow-y: auto; flex: 1; }
.hxwm-msg {
    display: block;
    padding: 10px 16px 10px 12px;
    border-bottom: 1px solid var(--hxwm-row-line);
    text-decoration: none;
    color: var(--hxwm-text);
    cursor: pointer;
    background: var(--hxwm-surface);
}
.hxwm-msg:hover { background: var(--hxwm-surface-2); box-shadow: inset 0 1px 0 var(--hxwm-border-soft), inset 0 -1px 0 var(--hxwm-border-soft); position: relative; z-index: 1; }
/* message rows keep their text color on hover: no blue, no underline */
.hxwm-msg:hover, .hxwm-msg:hover .hxwm-msg-from, .hxwm-msg:hover .hxwm-msg-subj,
.hxwm-msg:hover .hxwm-msg-snippet, .hxwm-msg:hover .hxwm-msg-snip,
.hxwm-msg:hover .hxwm-msg-date, .hxwm-msg:hover .hxwm-msg-time {
    color: var(--hxwm-text); text-decoration: none;
}
.hxwm-msg.hxwm-unread:hover .hxwm-msg-from,
.hxwm-msg.hxwm-unread:hover .hxwm-msg-subj { color: var(--hxwm-text-strong); }
.hxwm-msg.hxwm-unread { background: var(--hxwm-surface); }
.hxwm-msg.hxwm-unread .hxwm-msg-from,
.hxwm-msg.hxwm-unread .hxwm-msg-subj { font-weight: 700; color: var(--hxwm-text-strong); }
.hxwm-msg.hxwm-selected { background: var(--hxwm-active-fill); box-shadow: inset 3px 0 0 var(--hxwm-border); }
.hxwm-msg-top { display: flex; align-items: center; gap: 10px; }
.hxwm-msg .hxwm-sel { flex: none; width: 16px; height: 16px; accent-color: var(--hxwm-header); }
.hxwm-msg-from { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; min-width: 0; }
.hxwm-msg-time { font-size: 12px; color: var(--hxwm-text-soft); white-space: nowrap; flex: none; }
.hxwm-msg-subj { font-size: 14px; margin: 2px 0 0 26px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hxwm-msg-snip {
    font-size: 13px; color: var(--hxwm-text-soft); margin: 2px 0 0 26px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; line-height: 1.5;
}
.hxwm-attach-ico { font-size: 13px; }

/* reader */
.hxwm-reader { flex: 1; background: var(--hxwm-surface); padding: 24px 28px; overflow-y: auto; min-width: 0; }
.hxwm-reader h2 { font-size: 22px; line-height: 1.35; margin: 0 0 12px 0; color: var(--hxwm-text-strong); font-weight: 600; }
.hxwm-reader-meta {
    font-size: 13px; color: var(--hxwm-text-soft);
    background: var(--hxwm-surface-2); border: 1px solid var(--hxwm-row-line); border-radius: var(--hxwm-radius);
    padding: 10px 14px; margin-bottom: 16px; line-height: 1.8;
    overflow-wrap: anywhere; word-break: break-word;
}
/* every text container in the reader reflows: nothing gets clipped at the edge */
.hxwm-reader h2, .hxwm-reader-meta, .hxwm-reader-body { overflow-wrap: anywhere; }
.hxwm-reader-body { font-size: 16px; line-height: 1.65; color: var(--hxwm-text); }
.hxwm-reader-actions { display: flex; gap: 8px; margin-bottom: 16px; }
.hxwm-attach-list { margin-top: 20px; border-top: 1px dashed var(--hxwm-border-soft); padding-top: 14px; font-size: 14px; }
.hxwm-attach-list ul { margin: 8px 0 0; padding-left: 20px; }
.hxwm-imgblocked {
    display: inline-block; border: 1px dashed var(--hxwm-border); border-radius: var(--hxwm-radius);
    padding: calc(var(--hxwm-space) * 2) calc(var(--hxwm-space) * 3); background: var(--hxwm-bg);
    font-size: 13px; color: var(--hxwm-text-soft); margin: var(--hxwm-space) 0;
}
.hxwm-imgnote {
    background: var(--hxwm-unread); border: 1px solid var(--hxwm-border-soft);
    border-radius: var(--hxwm-radius); padding: calc(var(--hxwm-space) * 2) calc(var(--hxwm-space) * 3);
    font-size: 13px; margin-bottom: calc(var(--hxwm-space) * 3);
}

/* ---------- states ---------- */
.hxwm-state { padding: calc(var(--hxwm-space) * 10) calc(var(--hxwm-space) * 5); text-align: center; }
.hxwm-state h3 { color: var(--hxwm-header); font-size: 18px; margin: 0 0 calc(var(--hxwm-space) * 2) 0; }
.hxwm-state p { color: var(--hxwm-text-soft); margin: 0 0 calc(var(--hxwm-space) * 4) 0; }
.hxwm-state .hxwm-ico { font-size: 44px; display: block; margin-bottom: calc(var(--hxwm-space) * 3); }
.hxwm-degraded-banner {
    background: var(--hxwm-unread); border-bottom: 1px solid var(--hxwm-border);
    padding: calc(var(--hxwm-space) * 2) calc(var(--hxwm-space) * 4); font-size: 13px; color: var(--hxwm-text);
}
.hxwm-skel { padding: calc(var(--hxwm-space) * 3); }
.hxwm-skel-line { height: 14px; border-radius: 7px; background: linear-gradient(90deg, #f0e6c4 25%, #faf3da 50%, #f0e6c4 75%); background-size: 200% 100%; animation: hxwm-shimmer 1.2s infinite; margin-bottom: calc(var(--hxwm-space) * 2); }
@keyframes hxwm-shimmer { to { background-position: -200% 0; } }
.hxwm-tech { font-size: 12px; color: var(--hxwm-text-soft); background: #faf6e8; border: 1px solid var(--hxwm-row-line); border-radius: var(--hxwm-radius); padding: calc(var(--hxwm-space) * 2); margin-top: calc(var(--hxwm-space) * 3); text-align: left; font-family: monospace; }

/* ---------- composer ---------- */
.hxwm-compose { background: var(--hxwm-surface); padding: 24px 28px; }
.hxwm-compose h2 { color: var(--hxwm-header); margin-top: 0; font-size: 20px; }
.hxwm-field { margin-bottom: calc(var(--hxwm-space) * 3); }
.hxwm-field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: var(--hxwm-space); color: var(--hxwm-text); }
.hxwm-field input[type="text"], .hxwm-field input[type="email"], .hxwm-field textarea, .hxwm-field select {
    width: 100%; box-sizing: border-box; padding: calc(var(--hxwm-space) * 2) calc(var(--hxwm-space) * 3);
    border: 1px solid var(--hxwm-border-soft); border-radius: var(--hxwm-radius);
    font-size: 15px; font-family: inherit; color: var(--hxwm-text); background: var(--hxwm-surface);
}
.hxwm-field input:focus, .hxwm-field textarea:focus, .hxwm-field select:focus { outline: none; border-color: var(--hxwm-border); box-shadow: 0 0 0 2px rgba(212, 184, 74, .25); }
.hxwm-toolbar { display: flex; gap: var(--hxwm-space); margin-bottom: var(--hxwm-space); }
.hxwm-toolbar button { background: var(--hxwm-card); border: 1px solid var(--hxwm-border-soft); border-radius: var(--hxwm-radius); padding: var(--hxwm-space) calc(var(--hxwm-space) * 2); cursor: pointer; font-size: 14px; }
.hxwm-toolbar button:hover { background: var(--hxwm-btn-grad); }
.hxwm-editable { min-height: 220px; border: 1px solid var(--hxwm-border-soft); border-radius: var(--hxwm-radius); padding: calc(var(--hxwm-space) * 3); font-size: 16px; line-height: 1.6; }
.hxwm-editable:focus { outline: none; border-color: var(--hxwm-border); box-shadow: 0 0 0 2px rgba(212, 184, 74, .25); }
.hxwm-autosave { font-size: 12px; color: var(--hxwm-text-soft); margin-top: var(--hxwm-space); }
.hxwm-compose-actions { display: flex; gap: calc(var(--hxwm-space) * 2); margin-top: calc(var(--hxwm-space) * 4); flex-wrap: wrap; }

/* ---------- search / settings / connect ---------- */
.hxwm-panel { background: var(--hxwm-surface); padding: 24px 28px; }
.hxwm-panel h2 { color: var(--hxwm-header); margin-top: 0; font-size: 20px; }
.hxwm-filters { display: flex; flex-wrap: wrap; gap: calc(var(--hxwm-space) * 3); margin: calc(var(--hxwm-space) * 4) 0; }
.hxwm-filters .hxwm-field { margin-bottom: 0; min-width: 160px; flex: 1; }
.hxwm-check { display: flex; align-items: center; gap: calc(var(--hxwm-space) * 2); font-size: 14px; }
.hxwm-check input { accent-color: var(--hxwm-header); width: 16px; height: 16px; }
.hxwm-steps { list-style: none; padding: 0; margin: calc(var(--hxwm-space) * 4) 0; }
.hxwm-steps li { display: flex; align-items: center; gap: calc(var(--hxwm-space) * 3); padding: calc(var(--hxwm-space) * 2) 0; font-size: 15px; }
.hxwm-step-num {
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--hxwm-btn-grad); border: 1px solid var(--hxwm-border);
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 13px; flex: none;
}
.hxwm-sig-preview { border: 1px dashed var(--hxwm-border); border-radius: var(--hxwm-radius); padding: calc(var(--hxwm-space) * 3); background: var(--hxwm-card); white-space: pre-wrap; font-size: 14px; }
.hxwm-demo-links { margin-top: calc(var(--hxwm-space) * 6); padding-top: calc(var(--hxwm-space) * 4); border-top: 1px dashed var(--hxwm-border-soft); font-size: 12px; color: var(--hxwm-text-soft); }
.hxwm-demo-links a { color: var(--hxwm-header); margin-right: calc(var(--hxwm-space) * 2); }

/* ---------- compact button sizing (webmail-local; shared hx-btn untouched) ---------- */
.hxwm-wrap .hx-btn {
    font-size: 13px;
    padding: 6px 13px;
}
.hxwm-wrap .hx-btn-sm {
    font-size: 12.5px;
    padding: 5px 11px;
}
.hxwm-compose-pill {
    font-size: 13px;
    padding: 8px 16px;
}
.hxwm-topbar input[type="search"] {
    padding: 8px 18px;
    font-size: 14px;
}

/* ---------- resizable list/reader splitter + full-width reader ---------- */
.hxwm-split {
    width: 16px; flex: none; cursor: col-resize; background: transparent;
    border-left: 1px solid var(--hxwm-row-line);
    position: relative;
}
.hxwm-split::after {
    content: "\22EE\22EE";
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    color: var(--hxwm-border-soft);
    font-size: 15px; line-height: 1; letter-spacing: -3px;
    pointer-events: none;
}
.hxwm-split:hover, .hxwm-split.hxwm-drag { background: var(--hxwm-border-soft); }
.hxwm-split:hover::after, .hxwm-split.hxwm-drag::after { color: var(--hxwm-header); }
.hxwm-panes.hxwm-reader-full .hxwm-list,
.hxwm-panes.hxwm-reader-full .hxwm-split { display: none; }
.hxwm-panes.hxwm-reader-full .hxwm-reader { flex: 1 1 auto; }
.hxwm-expand-btn { margin-left: auto; }

/* reader content must wrap inside the pane */
.hxwm-reader-body { overflow-wrap: anywhere; word-break: break-word; overflow-x: auto; }
/* email content reflows to the pane width: no sideways scrolling to read */
.hxwm-reader-body img, .hxwm-reader-body iframe,
.hxwm-reader-body div, .hxwm-reader-body p { max-width: 100%; }
.hxwm-reader-body img { height: auto; }
.hxwm-reader-body table { width: 100% !important; max-width: 100%; table-layout: fixed; }
.hxwm-reader-body td, .hxwm-reader-body th { overflow-wrap: anywhere; word-break: break-word; }
.hxwm-reader-body pre { white-space: pre-wrap; word-break: break-word; }

/* ---------- responsive: mobile single-column ---------- */
.hxwm-folders-head .hxwm-folders-toggle { display: none; }
@media (max-width: 900px) {
    .hxwm-wrap { border-radius: 12px; margin: 10px 0; }
    .hxwm-topbar { flex-wrap: wrap; padding: 10px 12px; gap: 10px; }
    .hxwm-topbar h1 { font-size: 17px; }
    .hxwm-topbar .hxwm-search { order: 3; flex-basis: 100%; max-width: none; }
    .hxwm-topbar-actions { margin-left: auto; }
    .hxwm-panes { flex-direction: column; min-height: 0; }
    .hxwm-folders { width: auto; flex: none; padding: 10px 12px; border-bottom: 1px solid var(--hxwm-row-line); }
    .hxwm-compose-pill { margin: 0 0 10px 0; padding: 12px 16px; }
    .hxwm-folders-head { padding: 0 4px 6px; }
    .hxwm-folders .hx-mail-folderlist {
        display: flex; gap: 8px; overflow-x: auto; -webkit-overflow-scrolling: touch;
        padding-bottom: 2px;
    }
    .hxwm-folder { border-radius: 999px; padding: 8px 14px; white-space: nowrap; flex: none; }
    .hxwm-folders.hxwm-collapsed .hx-mail-folderlist { display: none; }
    .hxwm-folders-head .hxwm-folders-toggle { display: inline-block; }
    .hxwm-quota { padding: 10px 4px 0; }
    .hxwm-list { width: auto; flex: none; border-left: 0; border-right: 0; border-bottom: 1px solid var(--hxwm-row-line); max-height: 52vh; }
    .hxwm-reader { min-height: 40vh; padding: 18px 16px; }
    .hxwm-split { display: none; }
    .hxwm-msg-subj, .hxwm-msg-snip { margin-left: 0; }
    .hxwm-compose, .hxwm-panel { padding: 18px 16px; }
    .hxwm-reader-actions { flex-wrap: wrap; }
}

/* ---------- light-blue theme (opt-in via .hxwm-theme-blue) ---------- */
.hxwm-theme-blue {
    --hxwm-btn-grad: linear-gradient(180deg, #eef4fd, #d7e7fa);
    --hxwm-btn-grad-hover: linear-gradient(180deg, #f4f9ff, #e0edfb);
    --hxwm-border: #9ec2e8;
    --hxwm-border-soft: #c3d9f0;
    --hxwm-text: #1f3a5c;
    --hxwm-text-strong: #14294a;
    --hxwm-text-soft: #5b7ba3;
    --hxwm-header: #1e4e8c;
    --hxwm-card: #f2f7fe;
    --hxwm-bg: #eef4fc;
    --hxwm-unread: #eaf2fd;
    --hxwm-active-fill: #d9e9fa;
    --hxwm-row-line: #d9e6f5;
    --hxwm-surface: #f7fbff;
    --hxwm-surface-2: #edf4fd;
    --hxwm-search-bg: #e8f0fc;
    --hxwm-nav-hover: #e3edfb;
    /* shared usercenter tokens (buttons, inputs, cards) follow the blue theme */
    --hx-primary-from: #e9f2fd;
    --hx-primary-to: #d3e6fa;
    --hx-primary-hover-from: #f3f9ff;
    --hx-primary-hover-to: #dceafa;
    --hx-border-gold: #9ec2e8;
    --hx-border-gold-hover: #74a5d8;
    --hx-text-brown: #1e3a5e;
    --hx-header-gold: #1e4e8c;
    --hx-card-bg: #f6faff;
    --hx-card-border: #c9ddf2;
    --hx-accent-soft: #e2edfb;
}

/* ---------- light-pink theme ---------- */
.hxwm-theme-pink {
    --hxwm-btn-grad: linear-gradient(180deg, #fceef3, #f6dbe4);
    --hxwm-btn-grad-hover: linear-gradient(180deg, #fdf4f7, #f9e2e9);
    --hxwm-border: #e0a4b8;
    --hxwm-border-soft: #f0c9d5;
    --hxwm-text: #6b2d3f;
    --hxwm-text-strong: #521f30;
    --hxwm-text-soft: #a06a7d;
    --hxwm-header: #9c3d5a;
    --hxwm-card: #fef7f9;
    --hxwm-bg: #fbf0f3;
    --hxwm-unread: #fdeef3;
    --hxwm-active-fill: #f8dce5;
    --hxwm-row-line: #f2d4dd;
    --hxwm-surface: #fffafc;
    --hxwm-surface-2: #fdf0f4;
    --hxwm-search-bg: #fbe9ee;
    --hxwm-nav-hover: #f9e4eb;
    --hx-primary-from: #fceef3;
    --hx-primary-to: #f6dbe4;
    --hx-primary-hover-from: #fdf4f7;
    --hx-primary-hover-to: #f9e2e9;
    --hx-border-gold: #e0a4b8;
    --hx-border-gold-hover: #c9829c;
    --hx-text-brown: #6b2d3f;
    --hx-header-gold: #9c3d5a;
    --hx-card-bg: #fef7f9;
    --hx-card-border: #f0c9d5;
    --hx-accent-soft: #f9e4eb;
}

/* ---------- light-green theme (NVIDIA green accent) ---------- */
.hxwm-theme-green {
    --hxwm-btn-grad: linear-gradient(180deg, #f0f8e2, #dcecc6);
    --hxwm-btn-grad-hover: linear-gradient(180deg, #f5fbe9, #e2f0cf);
    --hxwm-border: #a4c868;
    --hxwm-border-soft: #cbe0a8;
    --hxwm-text: #2d4a12;
    --hxwm-text-strong: #1f3510;
    --hxwm-text-soft: #5f7a3d;
    --hxwm-header: #3d6216;
    --hxwm-card: #f8fcef;
    --hxwm-bg: #f2f8e8;
    --hxwm-unread: #eef7df;
    --hxwm-active-fill: #dcebc4;
    --hxwm-row-line: #d8e6bd;
    --hxwm-surface: #fcfff7;
    --hxwm-surface-2: #f3f9e9;
    --hxwm-search-bg: #eaf4da;
    --hxwm-nav-hover: #e9f3d8;
    --hx-primary-from: #f0f8e2;
    --hx-primary-to: #dcecc6;
    --hx-primary-hover-from: #f5fbe9;
    --hx-primary-hover-to: #e2f0cf;
    --hx-border-gold: #a4c868;
    --hx-border-gold-hover: #86ad4e;
    --hx-text-brown: #2d4a12;
    --hx-header-gold: #3d6216;
    --hx-card-bg: #f8fcef;
    --hx-card-border: #cbe0a8;
    --hx-accent-soft: #e9f3d8;
}

/* ---------- theme picker (settings) ---------- */
.hxwm-theme-pick { display: flex; gap: 12px; flex-wrap: wrap; }
.hxwm-theme-opt { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.hxwm-theme-opt input { accent-color: var(--hxwm-header); width: 16px; height: 16px; }
.hxwm-swatch {
    width: 64px; height: 40px; border-radius: 8px;
    border: 2px solid var(--hxwm-border-soft); display: inline-block;
}
.hxwm-theme-opt input:checked + .hxwm-swatch { border-color: var(--hxwm-header); box-shadow: 0 0 0 2px var(--hxwm-border-soft); }
.hxwm-settings .hx-btn[name="save"] { margin-top: 20px; }
.hxwm-swatch-white { background: linear-gradient(135deg, #ffffff 60%, #fdf6dd 60%); }
.hxwm-swatch-blue { background: linear-gradient(135deg, #f7fbff 60%, #d7e7fa 60%); }
.hxwm-swatch-pink { background: linear-gradient(135deg, #fffafc 60%, #f6dbe4 60%); }
.hxwm-swatch-green { background: linear-gradient(135deg, #fcfff7 60%, #d9e9c2 60%); }
.hxwm-swatch-label { font-size: 14px; }

/* 2026-10-06: connect/sign-in form — proper stacked layout on all screens,
   comfortable tap targets on phones. 16px inputs stop iOS auto-zoom. */
.hxwm-form label {
    display: block;
    margin: 0 0 14px;
    font-weight: 600;
    font-size: 15px;
}
.hxwm-form input[type="text"],
.hxwm-form input[type="password"],
.hxwm-form input[type="email"] {
    display: block;
    width: 100%;
    max-width: 420px;
    box-sizing: border-box;
    margin-top: 6px;
    padding: 11px 12px;
    font-size: 16px;
    line-height: 1.4;
    border: 1px solid var(--hxwm-border);
    border-radius: 8px;
    background: #fff;
    color: var(--hxwm-text);
}
.hxwm-form .hx-btn {
    display: inline-block;
    margin-top: 6px;
    padding: 10px 28px;
    font-size: 16px;
}
@media (max-width: 700px) {
    .hxwm-form .hx-btn {
        display: block;
        width: 100%;
        box-sizing: border-box;
        padding: 12px;
        text-align: center;
    }
}
@media (max-width: 700px) {
    .hxwm-connect { padding: 18px 16px; }
    .hxwm-connect h3 { font-size: 19px; }
}

/* 2026-10-06: language picker in settings */
.hxwm-lang-pick { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.hxwm-lang-pick .hxwm-check { margin: 0; }

/* 2026-10-06: mobile new-page reader. When a message is open, hide the
   folder strip and message list so the email fills the screen immediately.
   The back button shows only in this state on mobile. */
.hxwm-back-btn { display: none; }
@media (max-width: 900px) {
    .hxwm-panes.hxwm-reading .hxwm-folders,
    .hxwm-panes.hxwm-reading .hxwm-list,
    .hxwm-panes.hxwm-reading .hxwm-split { display: none; }
    .hxwm-panes.hxwm-reading .hxwm-reader { min-height: 70vh; border: 0; }
    .hxwm-panes.hxwm-reading .hxwm-back-btn { display: inline-block; }
}

/* 2026-10-06: bulk action bar — even button row, no orphaned wrap. */
.hxwm-bulkactions { gap: 8px; }
@media (max-width: 900px) {
    .hxwm-bulkactions.hxwm-show { row-gap: 10px; }
    .hxwm-bulkactions #hxwm-selcount { flex-basis: 100%; }
    .hxwm-bulkactions button { flex: 1 1 0; white-space: nowrap; text-align: center;
        padding: 10px 6px; font-size: 14px; }
}

/* 2026-10-08: settings feedback + must-change-password banner. */
.hxwm-sent-ok {
    background: #e8f5e9; border: 1px solid #a5d6a7; color: #2e7d32;
    border-radius: 8px; padding: 10px 14px; margin: 0 0 12px; font-weight: 600;
}
.hxwm-sent-err {
    background: #fdecea; border: 1px solid #f5c6cb; color: #a94442;
    border-radius: 8px; padding: 10px 14px; margin: 0 0 12px; font-weight: 600;
}
.hxwm-pw-banner {
    background: linear-gradient(180deg, #fdf6dd, #f7e9bd);
    border: 1px solid #d4b84a; color: #5a4a1a;
    border-radius: 8px; padding: 10px 14px; margin: 0 0 12px; font-weight: 600;
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
