/* רשימה, שרשור, כתיבה, הגדרות */

/* ---------- כותרת הרשימה ---------- */
.list-head { flex: none; border-bottom: 1px solid var(--line); background: var(--surface); }
.list-title { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; padding: 12px 16px 4px; color: var(--ink-2); min-width: 0; }
.list-title h1 { margin: 0; font-size: 20px; color: var(--ink); }
.q-echo { color: var(--ink-2); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toolbar { display: flex; align-items: center; gap: 2px; padding: 2px 8px; min-height: 48px; flex-wrap: wrap; }
.toolbar .range { padding: 0 8px; }
.quiet-btn.on { background: var(--sel); color: var(--brand-2); font-weight: 600; }
.tabs { display: flex; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); overscroll-behavior-x: contain; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none; display: flex; align-items: center; gap: 8px; height: 50px; padding: 0 16px; text-decoration: none; color: var(--ink-2);
  border-bottom: 3px solid transparent; font-weight: 500; white-space: nowrap; font-size: 14.5px;
}
.tab:hover { background: var(--hover); }
.tab.active { color: var(--c); border-bottom-color: var(--c); font-weight: 700; }
.tab .ic { color: var(--c); }
.tab-count { font-size: 12px; font-weight: 700; color: #fff; background: var(--c); border-radius: 99px; padding: 0 7px; min-width: 22px; text-align: center; line-height: 20px; }
.cat-primary { --c: var(--cat-primary); } .cat-promotions { --c: var(--cat-promotions); } .cat-social { --c: var(--cat-social); }
.cat-updates { --c: var(--cat-updates); } .cat-forums { --c: var(--cat-forums); }
.bulkbar { display: flex; align-items: center; gap: 2px; min-height: 56px; padding: 4px 6px; background: var(--sel); }
.bulk-count { font-weight: 700; padding: 0 6px; white-space: nowrap; }

/* ---------- שורות ---------- */
.list-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding-bottom: calc(96px + var(--sb)); }
.rows { display: flex; flex-direction: column; }
.row { touch-action: pan-y; position: relative; border-bottom: 1px solid var(--line); background: var(--read-bg); cursor: pointer; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; overflow: hidden; }
.row.unread { background: var(--surface); }
.row:hover { box-shadow: inset 0 0 0 999px color-mix(in srgb, var(--hover) 55%, transparent); }
.row.selected { background: var(--sel); }
.row.current { background: var(--sel); box-shadow: inset -3px 0 0 var(--brand-2); }
.row.focused { box-shadow: inset -3px 0 0 var(--focus); }
.row:focus-visible { outline-offset: -3px; }
.row-in {
  position: relative; z-index: 1; background: inherit; display: grid; grid-template-columns: 44px minmax(0, 1fr) 40px;
  grid-template-areas: "av main star"; align-items: start; gap: 0 12px; padding: 12px 12px 12px 6px; min-height: 76px;
}
.row-check { display: none; grid-area: check; border: 0; background: none; color: var(--ink-3); width: 40px; height: 40px; border-radius: 50%; place-items: center; cursor: pointer; }
.row-check:hover { background: var(--hover); }
.row.selected .row-check { color: var(--brand-2); }
.row-av { grid-area: av; border: 0; background: none; padding: 0; cursor: pointer; border-radius: 50%; width: 44px; height: 44px; display: grid; place-items: center; }
.star-btn { grid-area: star; border: 0; background: none; color: var(--ink-3); width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; align-self: end; }
.star-btn:hover { background: var(--hover); }
.star-btn.on { color: var(--star); }
.star-btn.on svg { fill: currentColor; }
.row-main { grid-area: main; min-width: 0; }
.row-top { display: flex; align-items: center; gap: 6px; min-width: 0; }
.from { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15.5px; color: var(--ink); }
.cnt { color: var(--ink-3); font-size: 13px; font-weight: 400; }
.draft-tag { color: var(--danger); font-weight: 500; font-size: 14px; }
.att { color: var(--ink-3); display: inline-flex; }
.date { flex: none; font-size: 13px; color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.date.snz { color: var(--accent); font-weight: 600; }
.row-sub { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; min-width: 0; margin-top: 2px; overflow: hidden; }
.from, .subj, .prev, .msg-to, .q-echo { text-align: right; }
.subj { color: var(--ink); font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.prev { color: var(--ink-3); font-size: 14px; flex-basis: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prev:empty { display: none; }
.imp { color: var(--accent); display: inline-flex; align-self: center; }
.row.unread .from, .row.unread .subj { font-weight: 700; }
.row.unread .date { color: var(--ink); font-weight: 700; }
.row-labels { display: inline-flex; gap: 4px; flex-wrap: wrap; flex-basis: 100%; }
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; line-height: 20px; padding: 0 8px; border-radius: 6px; background: var(--sunken); color: var(--ink-2); white-space: nowrap; max-width: 160px; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.label-chip { background: color-mix(in srgb, var(--c) 16%, transparent); color: color-mix(in srgb, var(--c) 80%, var(--ink)); }
.cat-chip { background: color-mix(in srgb, var(--c) 16%, transparent); color: color-mix(in srgb, var(--c) 85%, var(--ink)); }
.snz-chip { background: var(--accent-soft); color: color-mix(in srgb, var(--accent) 80%, var(--ink)); }
.row-quick { display: none; }
[data-density="compact"] .row-in { padding-block: 6px; min-height: 0; grid-template-columns: 36px minmax(0, 1fr) 40px; }
[data-density="compact"] .row-av .avatar { width: 32px !important; height: 32px !important; font-size: 13px !important; }
[data-density="compact"] .row-av { width: 36px; height: 36px; }
[data-density="compact"] .prev { display: none; }

/* החלקה */
.swipe-bg { position: absolute; inset: 0; display: none; }
.row.swiping .swipe-bg { display: block; }
.row.swiping .row-in { background: var(--surface); box-shadow: 0 0 12px rgba(0,0,0,.08); }
.row[data-dir="r"] .sw-r { display: flex; justify-content: flex-end; }
.row[data-dir="l"] .sw-l { display: flex; justify-content: flex-start; }
.sw { position: absolute; inset: 0; display: none; align-items: center; gap: 8px; padding: 0 22px; color: #fff; font-weight: 700; background: var(--ink-3); }
.row.armed[data-kind="archive"] .sw { background: var(--brand-2); }
.row.armed[data-kind="trash"] .sw { background: var(--danger); }
.row.armed[data-kind="read"] .sw { background: var(--cat-forums); }
.row.armed[data-kind="snooze"] .sw { background: var(--accent); }

.row.skel { cursor: default; background: var(--surface); display: flex; gap: 12px; padding: 16px 14px; align-items: center; }
.sk-av { width: 40px; height: 40px; border-radius: 50%; flex: none; }
.sk-lines { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.sentinel { height: 1px; }
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 64px 24px; color: var(--ink-2); }
.empty-ic { width: 84px; height: 84px; border-radius: 28px; display: grid; place-items: center; background: var(--sunken); color: var(--brand-2); margin-bottom: 8px; }
.empty h3 { margin: 0; font-size: 18px; color: var(--ink); }
.empty p { margin: 0; max-width: 340px; color: var(--ink-3); }
.empty .btn { margin-top: 12px; }

/* ---------- שרשור ---------- */
.thread-bar { flex: none; display: flex; align-items: center; gap: 0; padding: calc(4px + var(--st)) 4px 4px; border-bottom: 1px solid var(--line); background: var(--surface); min-height: 52px; overflow: hidden; }
.thread-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; padding: 0 0 calc(24px + var(--sb)); }
.thread-head { padding: 16px 16px 8px; }
.thread-subj { margin: 0; font-size: 21px; line-height: 1.35; font-weight: 600; overflow-wrap: anywhere; }
.thread-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.thread-chips:empty { display: none; }
.thread-placeholder { flex: 1; display: grid; place-content: center; justify-items: center; color: var(--ink-3); gap: 8px; }
.msgs { display: flex; flex-direction: column; padding: 0 8px; gap: 8px; }
.msg { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); min-width: 0; }
.msg.collapsed { background: var(--read-bg); }
.msg-head { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 0 10px; align-items: start; padding: 12px 12px 8px; cursor: pointer; }
.msg.collapsed .msg-head { padding-bottom: 12px; }
.msg-who { min-width: 0; }
.msg-from { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; min-width: 0; }
.msg-from strong { font-size: 15.5px; overflow-wrap: anywhere; }
.msg-email { font-size: 12.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
@media (max-width: 899px) { .msg-email { flex-basis: 100%; text-align: right; } }
.msg-to { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-meta { display: flex; align-items: center; gap: 0; color: var(--ink-3); flex-wrap: wrap; justify-content: flex-end; }
.msg-meta time { padding: 0 4px; white-space: nowrap; }
.msg-details { padding: 0 12px 0 64px; padding-inline-start: 62px; padding-inline-end: 12px; font-size: 13.5px; color: var(--ink-2); }
.msg-details summary { cursor: pointer; color: var(--ink-3); width: max-content; min-height: 32px; line-height: 32px; list-style: none; }
.msg-details summary::before { content: "▾ "; }
.msg-details dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; margin: 4px 0 8px; }
.msg-details dt { color: var(--ink-3); }
.msg-details dd { margin: 0; min-width: 0; overflow-wrap: anywhere; text-align: start; }
.msg-extras { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; padding: 2px 12px 6px; padding-inline-start: 62px; }
.why { flex-basis: 100%; }
.why-btn { display: inline-flex; align-items: center; gap: 8px; background: none; border: 0; color: var(--ink-3); cursor: pointer; font-size: 13.5px; min-height: 36px; padding: 0; text-decoration: underline dotted; text-underline-offset: 3px; }
.why-text { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-top: 4px; font-size: 14px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.why-text p { margin: 0; }
.unsub-btn .ic { color: var(--accent); }
.msg-body { padding: 4px 12px 14px; min-width: 0; }
.text-body { font-size: 15px; overflow-wrap: anywhere; }
.pt { white-space: pre-wrap; }
.pt-quote summary { list-style: none; cursor: pointer; display: inline-block; background: var(--sunken); border-radius: 6px; padding: 0 8px; color: var(--ink-3); margin: 6px 0; min-height: 24px; }
.pt-quote .pt { color: var(--ink-2); border-inline-start: 3px solid var(--line-2); padding-inline-start: 10px; }
.msg-frame { display: block; width: 100%; border: 0; background: #fff; border-radius: 10px; min-height: 40px; }
.img-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; margin-bottom: 10px; font-size: 14px; color: var(--ink-2); }
.img-banner span { flex: 1 1 180px; }
.msg-skel { display: flex; flex-direction: column; gap: 12px; padding: 24px 16px; }
.more-msgs { display: flex; align-items: center; gap: 10px; border: 1px dashed var(--line-2); background: var(--surface-2); border-radius: 12px; min-height: 44px; padding: 0 14px; cursor: pointer; color: var(--ink-2); }
.more-n { background: var(--surface); border: 1px solid var(--line-2); border-radius: 50%; width: 30px; height: 30px; display: grid; place-items: center; font-weight: 700; color: var(--ink); }
.is-draft .msg-from strong { color: var(--danger); }
.atts { padding: 4px 12px 14px; border-top: 1px dashed var(--line); margin: 0 12px; padding-inline: 0; }
.atts-head { display: flex; align-items: center; gap: 6px; padding: 10px 0 8px; }
.atts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.att-card { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; background: var(--surface-2); min-width: 0; }
.att-thumb { height: 96px; display: grid; place-items: center; background: var(--sunken); overflow: hidden; color: var(--ink-3); text-decoration: none; }
.att-thumb img { width: 100%; height: 100%; object-fit: cover; }
.att-ic { position: relative; display: grid; place-items: center; }
.att-ic b { position: absolute; bottom: 4px; font-size: 9px; color: var(--ink-2); }
.att-ic.pdf { color: var(--danger); }
.att-info { display: flex; flex-direction: column; padding: 6px 10px 0; min-width: 0; }
.att-name { font-size: 13.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-acts { display: flex; justify-content: flex-end; padding: 0 4px 2px; }
.reply-bar { display: flex; flex-wrap: wrap; gap: 8px; padding: 16px 16px 8px; }
.reply-bar .btn { flex: 1 1 auto; }

/* ---------- כתיבה ---------- */
.composer {
  position: fixed; inset: 0; z-index: 60; background: var(--surface); display: flex; flex-direction: column;
  padding: var(--st) var(--sr) var(--sb) var(--sl);
}
.cmp-head { display: flex; align-items: center; gap: 2px; min-height: 56px; padding: 0 4px; border-bottom: 1px solid var(--line); flex: none; }
.cmp-title { font-weight: 700; padding: 0 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 0 1 auto; }
.cmp-head .cmp-min, .cmp-head .cmp-max, .cmp-head .cmp-x { display: none; }
.cmp-send-top { color: var(--brand-2); }
.cmp-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; display: flex; flex-direction: column; min-height: 0; }
.cmp-fields { flex: none; }
.f-row { display: flex; align-items: center; gap: 6px; border-bottom: 1px solid var(--line); padding: 0 12px; min-height: 50px; min-width: 0; }
.f-lbl { color: var(--ink-3); font-size: 14.5px; width: 48px; flex: none; }
.f-extra { display: flex; flex: none; }
.rcpt-field { flex: 1; min-width: 0; display: flex; position: relative; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; flex: 1; min-width: 0; padding: 6px 0; }
.rchip { display: inline-flex; align-items: center; gap: 2px; background: var(--sunken); border-radius: 99px; padding: 0 2px 0 0; padding-inline-start: 10px; min-height: 30px; max-width: 100%; font-size: 14px; }
.rchip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rchip.bad { background: color-mix(in srgb, var(--danger) 15%, transparent); color: var(--danger); }
.rchip-x { border: 0; background: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; color: inherit; }
.rcpt-input { flex: 1 1 120px; min-width: 100px; border: 0; background: none; font-size: 16px; min-height: 38px; padding: 0 2px; }
.sugg { position: absolute; top: 100%; inset-inline: -12px; z-index: 5; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-l); padding: 4px; }
.sugg-item { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; cursor: pointer; min-height: 44px; }
.sugg-item.on, .sugg-item:hover { background: var(--hover); }
.sugg-t { display: flex; flex-direction: column; min-width: 0; }
.sugg-t b, .sugg-t small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sugg-t small { color: var(--ink-3); }
.subj-input { flex: 1; min-width: 0; border: 0; background: none; font-size: 16px; min-height: 48px; }
.editor { display: flex; flex-direction: column; flex: 1; min-height: 200px; }
.ed-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0; padding: 2px 6px; border-bottom: 1px solid var(--line); flex: none; }
.ed-btn { width: 40px; height: 40px; }
.ed-sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }
.ed-body { flex: 1; padding: 14px 16px; font-size: 16px; line-height: 1.6; min-height: 160px; overflow-wrap: anywhere; outline: none; }
.ed-body.empty::before { content: attr(data-ph); color: var(--ink-3); position: absolute; pointer-events: none; }
.ed-body blockquote { margin: 6px 0; padding-inline-start: 12px; border-inline-start: 3px solid var(--line-2); color: var(--ink-2); }
.ed-body .quote-head { color: var(--ink-3); font-size: 14px; }
.ed-body .sig { color: var(--ink-2); }
.ed-body img { max-width: 100%; }
.editor.minimal { border: 1px solid var(--line-2); border-radius: var(--radius-s); overflow: hidden; min-height: 140px; }
.editor.minimal .ed-body { min-height: 90px; }
.cmp-atts { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 12px; }
.cmp-atts:not(:empty) { padding: 8px 12px; }
.att-chip { position: relative; overflow: hidden; display: flex; align-items: center; gap: 6px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 0 2px 0 0; padding-inline-start: 10px; min-height: 40px; max-width: 100%; }
.att-chip .att-name { max-width: 180px; }
.att-chip.err { border-color: var(--danger); color: var(--danger); }
.att-prog { position: absolute; bottom: 0; inset-inline-start: 0; height: 3px; width: calc(var(--p) * 100%); background: var(--brand-2); transition: width .2s; }
.cmp-foot { flex: none; display: flex; align-items: center; gap: 4px; padding: 8px 10px; border-top: 1px solid var(--line); }
.send-btn { padding: 0 20px; min-height: 44px; }
.cmp-status { padding: 0 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.danger-ic { color: var(--ink-3); }
.danger-ic:hover { color: var(--danger); }
.drop-hint { display: none; position: absolute; inset: 0; background: color-mix(in srgb, var(--brand-2) 14%, var(--surface)); border: 3px dashed var(--brand-2); border-radius: inherit; z-index: 3; align-items: center; justify-content: center; gap: 12px; font-weight: 700; color: var(--brand-2); pointer-events: none; }
.composer.dragging .drop-hint { display: flex; }
.composer.minimized { inset: auto; bottom: calc(12px + var(--sb)); inset-inline-end: 12px; width: min(300px, calc(100vw - 24px)); height: auto; border-radius: 14px; box-shadow: var(--shadow-l); padding: 0; }
.composer.minimized > :not(.cmp-head) { display: none; }
.composer.minimized .cmp-head { border: 0; cursor: pointer; background: var(--brand); color: var(--brand-ink); border-radius: 14px; }
.composer.minimized .cmp-head .icon-btn { color: var(--brand-ink); }
.composer.minimized .cmp-back, .composer.minimized .cmp-send-top { display: none; }
.composer.minimized .cmp-x { display: inline-grid; }

/* ---------- הגדרות ---------- */
.settings { background: var(--bg); }
.set-nav { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 12px 12px 4px; position: sticky; top: 0; background: var(--bg); z-index: 2; }
.set-nav::-webkit-scrollbar { display: none; }
.set-chip { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink); font-size: 14px; }
.set-chip.active { background: var(--sel); border-color: var(--brand-2); color: var(--brand-2); }
.set-body { display: flex; flex-direction: column; gap: 14px; padding: 12px; max-width: 860px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 16px; display: flex; flex-direction: column; gap: 14px; min-width: 0; scroll-margin-top: 70px; }
.card h2 { margin: 0; font-size: 18px; }
.card > p { margin: -6px 0 0; }
.grid2 { display: grid; grid-template-columns: 1fr; gap: 14px; }
.row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.items { display: flex; flex-direction: column; gap: 6px; }
.items > p { margin: 0; }
.item { display: flex; align-items: center; gap: 6px; padding: 8px 6px 8px 0; padding-inline-start: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); min-width: 0; flex-wrap: wrap; }
.item-main { flex: 1 1 200px; display: flex; flex-direction: column; min-width: 0; gap: 2px; overflow-wrap: anywhere; }
.item select.input { width: auto; min-width: 150px; flex: 0 1 auto; }
.clip1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sub-h { margin: 6px 0 -4px; font-size: 15px; color: var(--brand-2); }
.kvbox { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--surface-2); }
.kvbox h3 { margin: 0 0 6px; font-size: 15px; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); min-width: 0; flex-wrap: wrap; }
.kv:last-child { border: 0; }
.kv code { overflow-wrap: anywhere; user-select: all; }
.keys { display: grid; grid-template-columns: 1fr; gap: 6px; }
.key-row { display: flex; align-items: center; gap: 12px; min-height: 32px; }
.key-row kbd { min-width: 110px; text-align: center; }

/* ---------- טלפון: שרשור כמסך מלא ---------- */
@media (max-width: 899px) {
  .has-thread .thread-pane { display: flex; position: fixed; inset: 0; z-index: 35; padding: 0 var(--sr) 0 var(--sl); }
  .has-thread .thread-bar { padding-top: calc(4px + var(--st)); }
  .settings-mode .list-pane { flex: 1; }
  .thread-bar .icon-btn { width: 44px; height: 44px; }
  .msg-details, .msg-extras { padding-inline-start: 12px; }
}

/* ---------- מחשב ---------- */
@media (min-width: 900px) {
  .composer { inset: auto; bottom: 0; inset-inline-end: 24px; width: min(600px, calc(100vw - 48px)); height: min(680px, calc(100dvh - 80px)); border-radius: 16px 16px 0 0; box-shadow: var(--shadow-l); border: 1px solid var(--line); padding: 0; overflow: hidden; }
  .composer.max { inset: 4vh 8vw; width: auto; height: auto; border-radius: 16px; }
  .composer.minimized { bottom: 0; inset-inline-end: 24px; border-radius: 14px 14px 0 0; }
  .composer.minimized .cmp-head { border-radius: 14px 14px 0 0; }
  .cmp-head { min-height: 48px; background: var(--surface-2); }
  .cmp-head .cmp-min, .cmp-head .cmp-max, .cmp-head .cmp-x { display: inline-grid; }
  .cmp-back, .cmp-send-top { display: none !important; }
  .grid2 { grid-template-columns: 1fr 1fr; }
  .keys { grid-template-columns: 1fr 1fr; }
  .set-body { padding: 12px 20px 40px; }
  .list-scroll { padding-bottom: 24px; }
  .row-in { grid-template-columns: 40px 40px minmax(0, 1fr); grid-template-areas: "check star main"; gap: 0 4px; padding: 10px 14px 10px 10px; min-height: 0; align-items: center; }
  .row-check { display: grid; }
  .row-av { display: none; }
  .star-btn { align-self: center; }
  .row:hover .row-quick { display: flex; }
  .row-quick { position: absolute; inset-inline-end: 6px; top: 50%; transform: translateY(-50%); gap: 0; background: inherit; padding-inline-start: 8px; z-index: 2; }
  .row:hover .row-quick { background: color-mix(in srgb, var(--hover) 100%, transparent); border-radius: 99px; }
  .row-quick .icon-btn { width: 36px; height: 36px; }
  .thread-head { padding: 20px 24px 8px; }
  .msgs { padding: 0 16px; }
  .reply-bar { padding-inline: 24px; }
  .reply-bar .btn { flex: 0 0 auto; }
  .has-thread .list-pane { display: none; }
  .has-thread .thread-pane { display: flex; flex: 1; }
  .settings-mode .thread-pane { display: none !important; }
  .settings-mode .list-pane { display: flex !important; }
  .back-btn { display: inline-grid; }
}
/* שורה אחת ברוחב בינוני (בלי פיצול) */
@media (min-width: 900px) and (max-width: 1279px) {
  .row-in { grid-template-columns: 40px 40px minmax(110px, 200px) minmax(0, 1fr) auto auto; grid-template-areas: "check star from sub att date"; }
  .row-main, .row-top { display: contents; }
  .from { grid-area: from; }
  .att { grid-area: att; }
  .date { grid-area: date; padding-inline-start: 10px; }
  .row-sub { grid-area: sub; flex-wrap: nowrap; margin: 0; max-height: none; align-items: center; }
  .subj { flex: 0 1 auto; }
  .prev { flex: 1 1 0; flex-basis: 0; min-width: 0; }
  .prev::before { content: "— "; }
  .row-labels { flex-basis: auto; flex-wrap: nowrap; order: -1; }
}
/* פיצול: רשימה + שיחה */
@media (min-width: 1280px) {
  .list-pane { flex: 0 0 440px; }
  .thread-pane { display: flex; flex: 1; }
  .has-thread .list-pane { display: flex; }
  .back-btn { display: none; }
  .settings-mode .list-pane { flex: 1; }
  .list-pane .tab:not(.active) > span:not(.tab-count) { display: none; }
  .list-pane .tab { padding: 0 12px; }
}

/* ---------- הדפסה ---------- */
@media print {
  body { overflow: visible; background: #fff; }
  .topbar, .sidebar, .list-pane, .thread-bar, .reply-bar, .fab, #toasts, .composer, .msg-meta .icon-btn, .star-btn, .msg-extras, .img-banner, .msg-details summary { display: none !important; }
  .body, .main, .thread-pane, .thread-scroll { position: static !important; display: block !important; overflow: visible !important; border: 0 !important; box-shadow: none !important; }
  .msg { break-inside: avoid; border-color: #ccc; }
}
