/* =========================================================
   Mail · Atelierul De Roti — webmail găzduit pe serverul nostru
   Același limbaj vizual ca site-ul public (styles.css):
   roșu #e11414 + antracit #16181d + alb, Poppins/Inter.
   Fișier separat de styles.css ca site-ul public să poată
   evolua fără să atingă aplicația de mail.
   ========================================================= */

:root {
  --red: #e11414;
  --red-dark: #b00d0d;
  --red-soft: #fff5f5;
  --ink: #16181d;
  --ink-soft: #23262e;
  --text: #1a1d23;
  --muted: #5b6470;
  --line: #e6e8ec;
  --bg: #ffffff;
  --bg-alt: #f5f6f8;
  --card: #ffffff;
  --ok: #1da851;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(20, 24, 31, 0.08);
  --shadow-lg: 0 20px 50px rgba(20, 24, 31, 0.16);
  --ff-head: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ff-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* ---------- modul întunecat ----------
   Trei stări: automat (după telefon/PC), luminos, întunecat — alese din
   meniul contului; alegerea stă în localStorage și ajunge ca data-tema pe
   <html>. Fără data-tema, decide sistemul (media query). */
@media (prefers-color-scheme: dark) {
  :root:not([data-tema="luminos"]) {
    --red: #f03e3e;
    --red-dark: #ff6b6b;
    --red-soft: rgba(240, 62, 62, .14);
    --ink: #eef1f6;
    --ink-soft: #dfe3ea;
    --text: #d7dbe2;
    --muted: #8f99a6;
    --line: #2b303b;
    --bg: #12141a;
    --bg-alt: #0d0f13;
    --card: #181b22;
    --logo-fundal: #ffffff;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.6);
  }
}
:root[data-tema="intunecat"] {
  --red: #f03e3e;
  --red-dark: #ff6b6b;
  --red-soft: rgba(240, 62, 62, .14);
  --ink: #eef1f6;
  --ink-soft: #dfe3ea;
  --text: #d7dbe2;
  --muted: #8f99a6;
  --line: #2b303b;
  --bg: #12141a;
  --bg-alt: #0d0f13;
  --card: #181b22;
  --logo-fundal: #ffffff;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.6);
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--ff-body);
  color: var(--text);
  background: var(--bg-alt);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--ff-head); line-height: 1.15; margin: 0 0 .5em; color: var(--ink); }

.is-hidden { display: none !important; }

/* ---------- Butoane (stilul .btn de pe site) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  font-family: var(--ff-head); font-weight: 600; font-size: .95rem;
  padding: .7em 1.3em; border-radius: 999px; border: 2px solid transparent;
  cursor: pointer; transition: transform .15s ease, background .2s ease, color .2s ease, box-shadow .2s ease;
  white-space: nowrap; text-align: center;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: default; }
.btn--sm { font-size: .85rem; padding: .5em 1em; }
.btn--primary { background: var(--red); color: #fff; }
.btn--primary:hover:not(:disabled) { background: var(--red-dark); box-shadow: 0 8px 20px rgba(225, 20, 20, .3); }
.btn--outline { background: var(--card); color: var(--ink); border-color: var(--line); }
.btn--outline:hover:not(:disabled) { border-color: var(--ink); }
.btn--danger { background: var(--card); color: var(--red-dark); border-color: #f3c2c2; }
.btn--danger:hover:not(:disabled) { background: var(--red-soft); border-color: var(--red); }
.btn--full { width: 100%; margin-top: .4rem; }

/* ---------- Câmpuri, mesaje, linkuri discrete ---------- */
.fld { display: block; text-align: left; margin-bottom: .9rem; }
.fld > span {
  display: block; font-family: var(--ff-head); font-weight: 600; font-size: .88rem;
  color: var(--ink); margin-bottom: .35rem;
}
.fld > span em { color: var(--muted); font-style: normal; font-weight: 500; }

.inp {
  width: 100%; font-family: var(--ff-body); font-size: 1rem;
  padding: .7em .9em; border: 2px solid var(--line); border-radius: var(--radius-sm);
  background: var(--card); color: var(--text); transition: border-color .2s ease;
}
.inp:focus { outline: none; border-color: var(--red); }
.inp--code {
  text-align: center; letter-spacing: .22em; font-size: 1.25rem;
  text-transform: uppercase; font-weight: 600; font-family: var(--ff-head);
}
textarea.inp { resize: vertical; min-height: 9rem; }

.msg { min-height: 1.2rem; margin: .8rem 0 0; font-size: .92rem; }
.msg--err { color: var(--red-dark); }
.msg--ok { color: var(--ok); }

.linkish {
  background: none; border: 0; cursor: pointer; padding: 0;
  color: var(--muted); font-size: .85rem; text-decoration: underline;
  font-family: var(--ff-body);
}
.linkish:hover { color: var(--red); }

/* ---------- Porți (activare / parolă) ---------- */
.gate { min-height: 100dvh; display: grid; place-items: center; padding: 1.2rem; background: var(--bg-alt); }
.gate__card {
  width: 100%; max-width: 27rem; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 2rem 1.75rem 1.6rem; text-align: center;
}
.gate__logo { width: 84px; height: auto; margin-bottom: .3rem; }
.gate__brand {
  margin: 0 0 .8rem; font-family: var(--ff-head); font-weight: 800;
  font-size: 1.02rem; letter-spacing: -.005em; color: var(--ink);
}
.gate__brand span { color: var(--red); }
.gate h1 { font-size: 1.4rem; margin: .2rem 0 .5rem; }
.gate__hint { margin: 0 0 1.25rem; color: var(--muted); font-size: .95rem; line-height: 1.55; }
.gate .linkish { margin-top: 1.1rem; }

/* alegerea contului (segmente pe verticală) */
.conturi { display: grid; gap: .5rem; }
.cont { position: relative; cursor: pointer; display: block; }
.cont input { position: absolute; opacity: 0; pointer-events: none; }
.cont__body {
  display: flex; align-items: center; border: 2px solid var(--line);
  border-radius: var(--radius-sm); padding: .6rem .9rem;
  font-family: var(--ff-head); font-weight: 600; font-size: .9rem; color: var(--ink);
  transition: border-color .15s ease, background .15s ease;
}
.cont input:checked + .cont__body { border-color: var(--red); background: var(--red-soft); }
.cont input:focus-visible + .cont__body { box-shadow: 0 0 0 3px rgba(225, 20, 20, .25); }

/* ---------- Bara de sus ---------- */
.app { min-height: 100dvh; display: flex; flex-direction: column; }
.bar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: .8rem; flex-wrap: wrap;
  padding: .6rem clamp(1rem, 3vw, 1.6rem);
  background: var(--card); border-bottom: 1px solid var(--line);
}
.bar__brand { display: flex; align-items: center; gap: .6rem; }
/* logo-ul e desenat închis la culoare — în tema întunecată primește o pastilă
   albă (--logo-fundal), altfel s-ar topi în fundal */
.bar__brand img {
  height: 38px; width: auto;
  background: var(--logo-fundal, transparent); border-radius: 9px; padding: 2px;
}
.gate__logo, .brand__logo {
  background: var(--logo-fundal, transparent); border-radius: 12px;
}
.brand__word {
  font-family: var(--ff-head); font-weight: 800; font-size: 1.15rem;
  letter-spacing: -.005em; color: var(--ink); line-height: 1; white-space: nowrap;
}
.brand__tld { color: var(--red); }
.bar__actions { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; background: var(--bg-alt);
  border: 1px solid var(--line); border-radius: 999px; padding: .35em .9em;
  font-family: var(--ff-head); font-weight: 600; font-size: .82rem; color: var(--ink);
}

/* ---------- Corpul aplicației ---------- */
.shell {
  display: flex; align-items: flex-start; gap: 1.2rem;
  width: 100%; max-width: 1240px; margin: 0 auto; flex: 1;
  padding: 1.2rem clamp(1rem, 3vw, 1.6rem) 3rem;
}

.side { width: 220px; flex: 0 0 auto; }
.btn--scrie { width: 100%; font-size: 1rem; padding: .75em 1.3em; margin-bottom: 1rem; }
.foldere { display: block; }
.folder {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: .6rem;
  width: 100%; border: 0; background: none; text-align: left; cursor: pointer;
  padding: .55rem .8rem .55rem 1rem; margin-bottom: 2px; border-radius: var(--radius-sm);
  font-family: var(--ff-head); font-weight: 600; font-size: .92rem; color: var(--muted);
  transition: background .15s ease, color .15s ease;
}
.folder:hover { background: var(--card); color: var(--ink); }
.folder.is-active { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.folder.is-active::before {
  content: ""; position: absolute; left: 0; top: 22%; bottom: 22%;
  width: 4px; border-radius: 4px; background: var(--red);
}
.folder__badge {
  flex: 0 0 auto; background: var(--red); color: #fff; border-radius: 999px;
  font-size: .72rem; font-weight: 700; line-height: 1.5; padding: .05em .55em;
}
.side__refresh { display: block; margin: 1rem 0 0 1rem; }

.pane {
  flex: 1; min-width: 0; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}

/* ---------- Lista de mesaje ---------- */
.pane__cap {
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
  padding: .95rem 1.2rem; border-bottom: 1px solid var(--line);
}
.pane__titlu { font-size: 1.05rem; margin: 0; }
.pane__total { color: var(--muted); font-size: .85rem; white-space: nowrap; }

/* rând ca la Gmail: avatar rotund cu inițiala + expeditor/dată pe primul
   rând, subiect + previzualizare gri pe al doilea */
.rand {
  display: grid; grid-template-columns: auto 1fr auto;
  grid-template-rows: auto auto; column-gap: .8rem; row-gap: .05rem;
  align-items: center;
  width: 100%; text-align: left; background: var(--card); border: 0; cursor: pointer;
  border-bottom: 1px solid var(--line); padding: .7rem 1.2rem;
  font-family: var(--ff-body); font-size: .93rem; color: var(--text);
  transition: background .15s ease;
}
.rand:hover { background: var(--bg-alt); }
.rand.is-cursor { background: var(--bg-alt); box-shadow: inset 3px 0 0 var(--red); }
.rand__avatar {
  grid-row: 1 / span 2; align-self: center;
  width: 40px; height: 40px; border-radius: 50%; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-family: var(--ff-head); font-weight: 700; font-size: 1.05rem;
}
.rand__avatar--bifa { background: var(--muted); }
.rand__avatar--bifat { background: var(--red); }
.rand__cine {
  grid-column: 2; grid-row: 1;
  display: flex; align-items: center; gap: .5rem; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted);
}
.rand__dot { flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
.rand__chip {
  flex: 0 0 auto; background: var(--bg-alt); border: 1px solid var(--line);
  border-radius: 999px; font-size: .68rem; font-weight: 600; padding: .05em .55em;
  color: var(--muted); font-family: var(--ff-head);
}
.rand__subiect {
  grid-column: 2 / 4; grid-row: 2;
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted);
}
.rand__previz { color: var(--muted); font-weight: 400; }
.rand__data { grid-column: 3; grid-row: 1; color: var(--muted); font-size: .82rem; white-space: nowrap; }
.rand--necitit .rand__cine { font-weight: 700; color: var(--ink); }
.rand--necitit .rand__subiect { font-weight: 600; color: var(--ink); }
.rand--necitit .rand__data { color: var(--ink); font-weight: 600; }
.rand--necitit .rand__previz { font-weight: 400; color: var(--muted); }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem 1.2rem; }
.pager__info { color: var(--muted); font-size: .85rem; }

/* stare goală / se încarcă / neconfigurat */
.gol { text-align: center; padding: 3.2rem 1.2rem; color: var(--muted); }
.gol .icobadge { margin-bottom: 1rem; }
.gol p { font-family: var(--ff-head); font-weight: 600; color: var(--ink); margin: .2rem 0 .3rem; }
.gol small { font-size: .88rem; }

/* ---------- Un mesaj deschis ---------- */
.pane__view--mesaj { padding: 1.2rem clamp(1rem, 3vw, 1.6rem) 1.6rem; }
/* butonul „Înapoi" de deasupra mesajului deschis — buton adevărat, nu doar o
   săgeată de text care se pierdea */
.inapoi { margin-bottom: 1rem; }
.inapoi:hover:not(:disabled) { border-color: var(--red); color: var(--red); }
.mesaj__subiect { font-size: 1.3rem; margin-bottom: .6rem; overflow-wrap: break-word; }

.meta {
  background: var(--bg-alt); border-radius: var(--radius-sm);
  padding: .85rem 1.1rem; margin-bottom: 1rem; font-size: .9rem;
}
.meta__rand { display: grid; grid-template-columns: 4.4em 1fr; gap: .6rem; }
.meta__rand + .meta__rand { margin-top: .15rem; }
.meta__rand b { font-family: var(--ff-head); font-weight: 600; color: var(--muted); }
.meta__rand span { overflow-wrap: break-word; min-width: 0; }

.mesaj__actiuni { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: 1.1rem; }

.atasamente { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
.atasamente:empty { display: none; }
.atas {
  display: inline-flex; align-items: center; gap: .45rem;
  border: 1px solid var(--line); border-radius: 999px; background: var(--card); cursor: pointer;
  padding: .45em 1em; font-family: var(--ff-head); font-weight: 600; font-size: .84rem; color: var(--ink);
  transition: border-color .15s ease, color .15s ease;
}
.atas small { color: var(--muted); font-weight: 500; font-size: .78rem; }
.atas:hover:not(:disabled) { border-color: var(--red); color: var(--red); }
.atas:disabled { opacity: .55; cursor: default; }

.corp {
  margin: 0; white-space: pre-wrap; overflow-wrap: break-word;
  font-family: var(--ff-body); font-size: .95rem; line-height: 1.65; color: var(--text);
}
.corp-frame {
  /* mesajele HTML sunt gândite pe fundal alb — rămâne alb și în modul întunecat */
  width: 100%; min-height: 320px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: #fff; display: block;
}

/* ---------- Compunere (modal) ---------- */
.modal {
  position: fixed; inset: 0; z-index: 200; display: grid; place-items: center;
  padding: 1rem; background: rgba(15, 17, 21, .55);
}
.modal__box {
  width: 100%; max-width: 560px; background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 1.6rem;
  max-height: calc(100dvh - 2rem); overflow: auto; animation: fade .2s ease;
}
.modal__box h3 { margin-bottom: 1rem; }
/* rândul de butoane se rupe pe două linii când nu încape (telefon) */
.modal__actiuni {
  display: flex; justify-content: flex-end; flex-wrap: wrap;
  gap: .7rem; margin-top: .4rem;
}
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Toast ---------- */
.toast {
  /* mereu închis la culoare, în ambele teme — plutește peste orice fundal */
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 300;
  background: #16181d; color: #fff; font-family: var(--ff-head); font-weight: 600;
  font-size: .9rem; padding: .65em 1.3em; border-radius: 999px; box-shadow: var(--shadow-lg);
  max-width: calc(100vw - 2rem); text-align: center;
}

/* ---------- „Anulează trimiterea" ---------- */
.anuleaza-bara {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 310;
  display: flex; align-items: center; gap: .9em;
  background: #16181d; color: #fff; font-family: var(--ff-head); font-weight: 600;
  font-size: .9rem; padding: .5em .5em .5em 1.3em; border-radius: 999px;
  box-shadow: var(--shadow-lg); max-width: calc(100vw - 2rem);
}
.anuleaza-bara button {
  border: 0; background: #e11414; color: #fff; border-radius: 999px;
  padding: .5em 1.2em; font-family: var(--ff-head); font-weight: 700;
  font-size: .9rem; cursor: pointer; white-space: nowrap;
}
.anuleaza-bara button:hover { background: #b00d0d; }

/* =========================================================
   Responsive
   ========================================================= */
/* butonul „Unelte" există doar pe telefon */
.unelte-btn { display: none; }

@media (max-width: 900px) {
  .shell { flex-direction: column; gap: .7rem; }
  .side { width: 100%; display: flex; align-items: center; flex-wrap: nowrap; gap: .5rem; }

  /* 1) bara de sus compactă: „Schimbă parola" și „Ieși" se mută în meniul
     contului (apeși pe adresă) — sus rămân doar logo-ul și căsuța */
  #parolaBtn2, #iesiBtn { display: none; }
  /* căsuța nu are voie să iasă din ecran: brandul stă pe loc, chip-ul se
     strânge cu „…" cât e nevoie */
  .bar { flex-wrap: nowrap; justify-content: space-between; min-width: 0; }
  .bar__brand { flex: 0 0 auto; }
  .bar__actions { flex: 1 1 auto; min-width: 0; justify-content: flex-end; flex-wrap: nowrap; }
  .cont-comutator { min-width: 0; max-width: 100%; }
  .chip--btn {
    max-width: 100%; overflow: hidden; text-overflow: ellipsis;
    white-space: nowrap; display: inline-block;
  }

  /* 2) folderele pe UN singur rând, derulabil lateral (ca filele de la Gmail);
     capătul se stinge într-un degrade, ca să se vadă că mai e ceva acolo */
  .foldere {
    display: flex; flex-wrap: nowrap; gap: .4rem; flex: 1 1 auto; min-width: 0;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none; padding: 2px 0;
    -webkit-mask-image: linear-gradient(90deg, #000 90%, transparent);
    mask-image: linear-gradient(90deg, #000 90%, transparent);
  }
  .foldere::-webkit-scrollbar { display: none; }
  .folder {
    flex: 0 0 auto; width: auto; margin: 0; padding: .45rem .95rem;
    background: var(--card); border: 1px solid var(--line); border-radius: 999px;
    font-size: .85rem; white-space: nowrap;
  }
  .folder.is-active { box-shadow: none; border-color: var(--red); color: var(--red); }
  .folder.is-active::before { display: none; }

  /* 3) uneltele stau într-un singur buton — legăturile individuale dispar */
  .side__refresh { display: none; }
  .unelte-btn {
    display: inline-flex; align-items: center; flex: 0 0 auto;
    margin: 0; font-size: .85rem; cursor: pointer;
    background: var(--card); border: 1px dashed var(--line); border-radius: 999px;
    padding: .45rem .95rem; font-family: var(--ff-head); font-weight: 600;
    color: var(--muted);
  }
  .unelte-btn:hover { color: var(--red); border-color: var(--red); }

  /* 4) „Scrie" devine buton rotund plutitor, jos-dreapta (ca la Gmail) */
  .btn--scrie {
    position: fixed; right: 18px; bottom: 18px; z-index: 150;
    width: 60px; height: 60px; padding: 0; margin: 0; border-radius: 50%;
    font-size: 0;                               /* rămâne doar iconița */
    box-shadow: 0 10px 26px rgba(225, 20, 20, .45);
  }
  .btn--scrie .icoinline { width: 26px; height: 26px; vertical-align: middle; }
  /* butonul plutitor să nu acopere ultimul mesaj din listă */
  .shell { padding-bottom: 96px; }

  /* scurtăturile de tastatură nu au sens pe telefon */
  .doar-pc { display: none; }
}

@media (max-width: 600px) {
  /* pe telefon fiecare pixel contează: cardul listei se lipește de margini
     (ca la Gmail), scrisul și spațiile se strâng puțin peste tot */
  .rand { padding: .6rem .8rem; column-gap: .55rem; }
  .rand__avatar { width: 36px; height: 36px; font-size: .95rem; }
  .rand__cine { font-size: .95rem; }
  .rand__subiect { font-size: .9rem; }
  .rand__data { font-size: .76rem; }
  /* logo + căsuță pe UN rând și pe ecrane înguste */
  .bar { padding: .45rem .7rem; gap: .4rem; }
  .bar__brand { gap: .4rem; }
  .bar__brand img { height: 30px; }
  .brand__word { font-size: .92rem; }
  .chip { font-size: .78rem; padding: .35em .7em; }
  .shell { padding: .55rem 0 96px; gap: .55rem; }
  .side { padding: 0 .7rem; }
  .pane { border-radius: 0; border-left: 0; border-right: 0; box-shadow: none; }
  .pane__cap { padding: .65rem .8rem .35rem; border-bottom: 0; }
  .pane__titlu { font-size: 1rem; }
  .push-bara { margin: 0 .8rem .6rem; }
  /* căutarea: câmpul + „Caută" pe un rând, filtrele dedesubt, totul mărunt */
  .cauta { padding: 0 .8rem .55rem; gap: .4rem; }
  .cauta__inp { flex: 1 1 9rem; font-size: .95rem; padding: .5em .8em; }
  .cauta .btn { font-size: .78rem; padding: .5em .85em; }
  .bulk-bara { padding-left: .8rem; padding-right: .8rem; }
  .mesaj__actiuni .btn { flex: 1 1 auto; }
  /* compunerea devine foaie pe tot ecranul, ca aplicațiile adevărate */
  #composeModal { padding: 0; place-items: stretch; }
  #composeModal .modal__box {
    max-width: none; height: 100dvh; max-height: 100dvh;
    border-radius: 0; padding: 1.1rem 1rem;
  }
  .modal__box { padding: 1.2rem; }
  .modal__actiuni .btn { flex: 1 1 auto; padding-left: .6em; padding-right: .6em; }
  .ciorna-stare { flex: 1 1 100%; text-align: left; }
  .meta__rand { grid-template-columns: 1fr; gap: 0; }
}

/* =========================================================
   Iconite SVG (desenele sunt în js/iconite.js) — copiate din styles.css
   ========================================================= */
.ico { display: block; fill: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-width: 2.4; }
.ico .s { stroke: var(--ink); }
.ico .a { stroke: var(--red); }
.ico .f { fill: var(--red); stroke: none; }
.icobadge { display: inline-flex; align-items: center; justify-content: center; width: 60px; height: 60px; position: relative; }
.icobadge::before, .icobadge::after { content: ""; position: absolute; width: 12px; height: 12px; border: 2.2px solid var(--red); }
.icobadge::before { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.icobadge::after { bottom: 0; right: 0; border-left: 0; border-top: 0; }
.icobadge .ico { width: 38px; height: 38px; }
.icoinline { display: inline-block; width: 1.05em; height: 1.05em; vertical-align: -0.15em; }
.icoinline .ico { width: 100%; height: 100%; }
/* când iconița stă înaintea unui cuvânt (butoane, meniuri), primește aer */
.btn .icoinline, .linkish .icoinline, .unelte-btn .icoinline,
.meniu-cont .icoinline, .muta-tinta .icoinline, .toast .icoinline {
  margin-right: .32em;
}
/* iconițele din butonul roșu "Scrie" trebuie desenate în alb */
.btn--primary .ico .s, .btn--primary .ico .a { stroke: #fff; }
.btn--primary .ico .f { fill: #fff; }
/* toast-ul e mereu închis la culoare, indiferent de temă — conturul
   iconițelor trebuie să fie alb, altfel dispare pe tema luminoasă */
.toast .ico .s { stroke: #fff; }

/* Modal îngust pentru schimbarea parolei */
.modal__box--ingust { max-width: 420px; }
.modal__nota {
  margin: -.2rem 0 1rem; font-size: .84rem; color: var(--muted); line-height: 1.55;
}

/* ---------- căutare ---------- */
.cauta {
  display: flex; gap: .5rem; align-items: center; flex-wrap: wrap;
  padding: 0 1.1rem 1rem;
}
.cauta__inp { flex: 1 1 15rem; min-width: 0; }

/* ---------- fișiere atașate ---------- */
.atas-buton {
  display: inline-block; border: 1.5px solid var(--line); background: var(--card);
  border-radius: 999px; padding: .45rem 1rem; font-size: .86rem; font-weight: 600;
  cursor: pointer; transition: border-color .15s, color .15s;
}
.atas-buton:hover { border-color: var(--red); color: var(--red); }
.atas-info { font-size: .78rem; color: var(--muted); margin-left: .6rem; }
.atas-lista { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .6rem; }
.atas-chip {
  display: inline-flex; align-items: center; gap: .4rem;
  background: var(--bg-alt); border: 1px solid var(--line); border-radius: 8px;
  padding: .3rem .5rem .3rem .65rem; font-size: .82rem; max-width: 100%;
}
.atas-chip small { color: var(--muted); }
.atas-x {
  border: 0; background: none; cursor: pointer; font-size: 1.1rem; line-height: 1;
  color: var(--muted); padding: 0 .15rem;
}
.atas-x:hover { color: var(--red); }

/* starea ciornei, în bara de acțiuni a ferestrei de scris */
.ciorna-stare { margin-right: auto; font-size: .8rem; color: var(--muted); }

/* ---------- grupuri (foldere proprii) în bara laterală ---------- */
.side__titlu {
  margin: 1.1rem 0 .3rem; padding-left: 1rem;
  font-family: var(--ff-head); font-weight: 700; font-size: .72rem;
  letter-spacing: .09em; text-transform: uppercase; color: var(--muted);
}
.side__gol { margin: 0 0 .2rem; padding-left: 1rem; font-size: .82rem; color: var(--muted); }
.folder--nou { color: var(--muted); }
.folder--nou:hover { color: var(--red); background: var(--card); }

/* ---------- mutarea unui mesaj într-un grup ---------- */
.muta-lista { display: grid; gap: .45rem; margin-bottom: 1rem; }
.muta-tinta {
  display: flex; align-items: center; width: 100%; cursor: pointer;
  border: 2px solid var(--line); border-radius: var(--radius-sm);
  background: var(--card); padding: .6rem .9rem; text-align: left;
  font-family: var(--ff-head); font-weight: 600; font-size: .9rem; color: var(--ink);
  transition: border-color .15s ease, background .15s ease;
}
.muta-tinta:hover:not(:disabled) { border-color: var(--red); background: var(--red-soft); }
.muta-tinta:disabled { opacity: .55; cursor: default; }

.bifa {
  display: flex; align-items: flex-start; gap: .55rem; cursor: pointer;
  margin-bottom: .4rem; font-size: .86rem; color: var(--text); line-height: 1.5;
}
.bifa input { margin-top: .25em; accent-color: var(--red); flex: 0 0 auto; }

/* ---------- fereastra „Grupuri și reguli" ---------- */
.gest-sect + .gest-sect { margin-top: 1.4rem; }
.gest-sect h4 { font-size: .98rem; margin-bottom: .55rem; }
.gest-lista { display: grid; gap: .35rem; margin-bottom: .65rem; }
.gest-rand {
  display: flex; align-items: center; justify-content: space-between; gap: .6rem;
  background: var(--bg-alt); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: .45rem .5rem .45rem .75rem; font-size: .88rem;
}
.gest-rand span { min-width: 0; overflow-wrap: anywhere; }
.gest-rand b { color: var(--muted); font-weight: 600; }
.gest-x {
  flex: 0 0 auto; border: 0; background: none; cursor: pointer;
  font-size: 1.2rem; line-height: 1; color: var(--muted); padding: .1rem .35rem;
}
.gest-x:hover { color: var(--red); }
.gest-gol { margin: 0; font-size: .85rem; color: var(--muted); }
.bifa--gest { margin: .15rem 0 .8rem; }
.bifa--gest em { color: var(--muted); font-style: normal; font-size: .8rem; }
.gest-add { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.gest-add .inp { flex: 1 1 11rem; width: auto; }
.gest-add select.inp { flex: 0 1 12rem; }

@media (max-width: 900px) {
  /* pe mobil folderele sunt bumbi pe orizontală — titlul de secțiune ar rupe rândul */
  .side__titlu, .side__gol { display: none; }
}

/* ---------- bara „vrei notificări?" ---------- */
.push-bara {
  display: flex; align-items: center; gap: .7rem; flex-wrap: wrap;
  margin: .9rem 1.1rem 0; padding: .6rem .9rem;
  background: var(--bg-alt); border: 1px solid var(--line);
  border-radius: var(--radius-sm); font-size: .88rem; color: var(--text);
}
.push-bara span { flex: 1 1 14rem; }
.push-bara .linkish { font-size: .82rem; }

/* ---------- importul din alt cont ---------- */
.import-stare {
  margin: .2rem 0 .8rem; padding: .6rem .9rem;
  background: var(--bg-alt); border: 1px solid var(--line);
  border-radius: var(--radius-sm); font-size: .88rem; line-height: 1.55;
}

/* ---------- CC/BCC + șabloane la compunere ---------- */
.fld--cc { display: flex; gap: .8rem; }
.fld--jum { flex: 1 1 0; min-width: 0; margin-bottom: 0; }
.inp--sablon { margin-bottom: .5rem; }

/* ---------- filtrul „doar necitite" + selecția în masă ---------- */
#necititeBtn.is-activ, #selecteazaBtn.is-activ {
  background: var(--red); color: #fff; border-color: var(--red);
}
.bulk-bara {
  display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
  padding: .55rem 1.1rem; border-bottom: 1px solid var(--line);
  background: var(--bg-alt); font-size: .87rem;
}
.bulk-bara span { font-family: var(--ff-head); font-weight: 600; margin-right: auto; }
.rand__stea { color: #e8a013; }

/* ---------- previzualizarea atașamentelor ---------- */
.modal__box--previz { max-width: min(92vw, 900px); }
.previz-cap {
  display: flex; align-items: center; gap: .6rem; margin-bottom: .8rem;
}
.previz-cap span {
  margin-right: auto; font-family: var(--ff-head); font-weight: 600;
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.previz-corp img { max-width: 100%; max-height: 70vh; display: block; margin: 0 auto; }
.previz-corp iframe {
  width: 100%; height: 70vh; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: #fff;
}

/* clopoțelul de notificări al unui grup */
.gest-clopotel {
  flex: 0 0 auto; border: 0; background: none; cursor: pointer;
  font-size: 1rem; padding: 0 .15rem;
}
.bifa--sub { margin-left: 1.6rem; }

/* ---------- anunțul „am adresă nouă" ---------- */
.anunt-lista {
  max-height: 15rem; overflow: auto; margin: .8rem 0 1rem;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: .35rem .6rem; display: block;
}
.anunt-rand {
  display: flex; align-items: center; gap: .55rem; cursor: pointer;
  padding: .3rem .1rem; font-size: .87rem; border-bottom: 1px solid var(--bg-alt);
}
.anunt-rand:last-child { border-bottom: 0; }
.anunt-rand input { accent-color: var(--red); flex: 0 0 auto; }
.anunt-rand__cine {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.anunt-rand small { margin-left: auto; color: var(--muted); white-space: nowrap; }
.anunt-nota { font-weight: 600; }

/* ---------- comutatorul de conturi (ca la Gmail) ---------- */
.cont-comutator { position: relative; }
.chip--btn { border: 1px solid var(--line); cursor: pointer; transition: border-color .15s ease; }
.chip--btn:hover { border-color: var(--ink); }
.chip__sageata { margin-left: .35em; font-size: .72em; color: var(--muted); }
.meniu-conturi {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 120;
  min-width: 270px; max-width: min(92vw, 340px);
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg); padding: .4rem; animation: fade .15s ease;
}
.meniu-cont {
  display: flex; align-items: center; gap: .6rem; width: 100%;
  border: 0; background: none; cursor: pointer; text-align: left;
  padding: .5rem .6rem; border-radius: 8px;
  font-family: var(--ff-body); font-size: .9rem; color: var(--text);
}
.meniu-cont:hover { background: var(--bg-alt); }
.meniu-cont.is-activ { font-weight: 600; color: var(--ink); }
.meniu-cont__avatar {
  flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--ink); color: var(--bg);
  font-family: var(--ff-head); font-weight: 700; font-size: .85rem;
}
.meniu-cont.is-activ .meniu-cont__avatar { background: var(--red); }
.meniu-cont__email { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meniu-cont__bifa { margin-left: auto; color: var(--red); font-weight: 700; }
.meniu-cont--actiune { color: var(--muted); font-size: .86rem; }
.meniu-cont--actiune:hover { color: var(--ink); }
.meniu-sep { height: 1px; background: var(--line); margin: .35rem .2rem; }

/* alte conturi activate, direct pe poarta de parolă */
.gate-conturi { margin-top: .9rem; }
.gate-conturi:empty { margin: 0; }
.gate-conturi__titlu { margin: 0 0 .45rem; font-size: .82rem; color: var(--muted); }
.gate-cont {
  display: flex; align-items: center; width: 100%; cursor: pointer;
  border: 2px solid var(--line); border-radius: var(--radius-sm); background: var(--card);
  padding: .5rem .8rem; margin-bottom: .4rem; text-align: left;
  font-family: var(--ff-head); font-weight: 600; font-size: .88rem; color: var(--ink);
  transition: border-color .15s ease, background .15s ease;
}
.gate-cont:hover { border-color: var(--red); background: var(--red-soft); }

/* ---------- editorul cu formatare (compunere) ---------- */
.editor-bara { display: flex; gap: .3rem; margin-bottom: .35rem; flex-wrap: wrap; }
.editor-btn {
  border: 1px solid var(--line); background: var(--card); color: var(--text);
  border-radius: 8px; min-width: 2.1em; padding: .25em .55em; cursor: pointer;
  font-family: var(--ff-body); font-size: .9rem; line-height: 1.3;
}
.editor-btn:hover { border-color: var(--red); color: var(--red); }
.editor {
  min-height: 11rem; max-height: 45vh; overflow: auto;
  white-space: pre-wrap; overflow-wrap: break-word; line-height: 1.55;
}
.editor:focus { outline: none; border-color: var(--red); }
.editor img { max-width: 100%; }
.editor a { color: var(--red); }

/* ---------- firul conversației (sub mesajul deschis) ---------- */
.fir:empty { display: none; }
.fir { margin-top: 1.3rem; border-top: 1px solid var(--line); padding-top: .9rem; }
.fir__titlu {
  font-family: var(--ff-head); font-weight: 700; font-size: .72rem;
  letter-spacing: .09em; text-transform: uppercase; color: var(--muted);
  margin-bottom: .5rem;
}
.fir-rand {
  display: flex; align-items: baseline; gap: .6rem; width: 100%;
  text-align: left; cursor: pointer; margin-bottom: .35rem;
  background: var(--bg-alt); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: .5rem .8rem;
  font-family: var(--ff-body); font-size: .88rem; color: var(--text);
  transition: border-color .15s ease;
}
.fir-rand:hover { border-color: var(--red); }
.fir-rand b { flex: 0 0 auto; font-family: var(--ff-head); font-weight: 600; color: var(--ink); }
.fir-rand--eu b { color: var(--red); }
.fir-rand span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.fir-rand small { margin-left: auto; flex: 0 0 auto; color: var(--muted); white-space: nowrap; }

/* ---------- ghidul aplicației (Ajutor / Help) ---------- */
.ghid { margin: 0 0 1rem; padding-left: 1.15rem; }
.ghid li { margin-bottom: .55rem; font-size: .92rem; line-height: 1.55; }
.ghid b { color: var(--ink); }

/* ---------- scurtăturile de tastatură ---------- */
.scurt {
  display: grid; grid-template-columns: auto 1fr; gap: .4rem 1rem;
  align-items: baseline; font-size: .92rem; margin-bottom: 1rem;
}
.scurt kbd {
  display: inline-block; background: var(--bg-alt); border: 1px solid var(--line);
  border-bottom-width: 2px; border-radius: 6px; padding: .05em .5em;
  font-family: var(--ff-head); font-weight: 600; font-size: .8rem; color: var(--ink);
}

/* ---------- tragi în jos → reîmprospătare (ca la Gmail) ---------- */
/* browserul nu mai are voie să facă propriul refresh de pagină la tras —
   îl facem noi, frumos, doar pe lista de mesaje / conversații */
html, body { overscroll-behavior-y: none; }
.ptr {
  position: fixed; left: 50%; top: 0; z-index: 95;
  width: 44px; height: 44px; margin-left: -22px; border-radius: 50%;
  background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem; color: var(--muted);
  transform: translateY(-64px); pointer-events: none;
}
.ptr span { display: inline-block; transition: transform .18s ease; }
.ptr--gata { color: var(--red); border-color: var(--red); }
.ptr--gata span { transform: rotate(180deg); }
.ptr--merge span { animation: ptr-rot .7s linear infinite; transform: none; }
.ptr--pleaca { transition: transform .25s ease; transform: translateY(-64px) !important; }
@keyframes ptr-rot { to { transform: rotate(360deg); } }
