/*
 * Unique Studio Chat — stiluri.
 * Designul studioului (Desktop\design studio chat\unique-studio-chat-design): trei teme, alese din meniul contului
 * și ținute pe dispozitiv (js/theme.js, js/store.js → THEMES):
 *   A „Neon Noir” (implicită) – negru, mentă pentru acțiuni și mesajele proprii, magenta pentru necitite;
 *   B „Clean White” – alb, bară neagră în stânga, negru pentru acțiuni, linia în degrade sub antet;
 *   C „Velvet” – vișiniu închis, magenta pentru acțiuni, mentă pentru necitite, model de linii și logo în fundal.
 * Fonturi: Cinzel (titluri, numele studioului) și Inter (restul), în /fonts. Supravegherea (doar administratori)
 * are culoarea ei (--cto), ca să nu se confunde cu conversațiile la care participi.
 * Logo-ul și pictogramele se fac din build/brand/ cu `npm run icons`.
 */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 400 700;
  src: url('/fonts/inter-latin-ext-wght-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 400 700;
  src: url('/fonts/inter-latin-wght-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Cinzel';
  font-style: normal;
  font-display: swap;
  font-weight: 400 900;
  src: url('/fonts/cinzel-latin-ext-wght-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Cinzel';
  font-style: normal;
  font-display: swap;
  font-weight: 400 900;
  src: url('/fonts/cinzel-latin-wght-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* A – Neon Noir (implicită) */
:root {
  --font-text: 'Inter', 'Segoe UI', system-ui, sans-serif;
  --font-sign: 'Inter', 'Segoe UI', system-ui, sans-serif;
  --font-display: 'Cinzel', 'Times New Roman', serif;

  /* culorile logo-ului: bara „US”, de la magenta la verde-mentă */
  --brand-magenta: #e602d0;
  --brand-magenta-deep: #c400b2;
  --brand-purple: #9d83ca;
  --brand-mint: #5ef2c4;
  --brand-black: #0a090d;
  --brand-bar: linear-gradient(90deg, #e602d0, #9d83ca 50%, #5ef2c4);

  --paper: #0a090d;
  --raised: #1a1820;
  --sunken: #111015;
  --field: #1a1820;
  --card: #111015;
  --ink: #f5f4f7;
  --ink-2: #cfcbd6;
  --ink-3: #a9a5b3;
  --line: #2a2731;
  --line-2: #3a3644;

  --stage: #111015;
  --stage-2: #1a1820;
  --stage-3: #221f29;
  --stage-ink: #f5f4f7;
  --stage-strong: #ffffff;
  --stage-dim: #a9a5b3;
  --stage-line: #2a2731;

  --ctb: #5ef2c4;
  --ctb-strong: #8df6d6;
  --ctb-wash: #10332a;
  --on-ctb: #0a090d;
  --link: #f04be0;

  --bubble: #1e1c24;
  --on-bubble: #f5f4f7;
  --bubble-own: #5ef2c4;
  --on-bubble-own: #0a090d;

  --cto-lamp: #b39ddb;
  --on-cto: #0a090d;
  --cto-wash: #1f1a2b;
  --cto-line: #4a3d66;
  --cto-ink: #ddd0f5;

  --tape: #e602d0;
  --on-tape: #0a090d;
  --go: #5ef2c4;
  --stop: #ff8097;
  --stop-wash: #3a1420;
  --mark: #6b5410;
  --hover: rgba(245, 244, 247, 0.05);
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.55);
  --radius: 10px;
  --radius-field: 12px;
  --radius-card: 20px;
}

/* B – Clean White */
[data-theme='clean'] {
  --paper: #ffffff;
  --raised: #ffffff;
  --sunken: #f7f6f9;
  --field: #ffffff;
  --card: #ffffff;
  --ink: #0a090d;
  --ink-2: #3e3a47;
  --ink-3: #5d5967;
  --line: #e6e4ea;
  --line-2: #d2cfd9;

  --stage: #f7f6f9;
  --stage-2: #efedf3;
  --stage-3: #ece9f0;
  --stage-ink: #0a090d;
  --stage-strong: #0a090d;
  --stage-dim: #5d5967;
  --stage-line: #e6e4ea;

  --ctb: #0a090d;
  --ctb-strong: #2a2731;
  --ctb-wash: #f1eff4;
  --on-ctb: #ffffff;
  --link: #c400b2;

  --bubble: #f1eff4;
  --on-bubble: #0a090d;
  --bubble-own: #0a090d;
  --on-bubble-own: #ffffff;

  --cto-lamp: #0e9f72;
  --on-cto: #03251a;
  --cto-wash: #dcf8ee;
  --cto-line: #7fd9b9;
  --cto-ink: #0a4a35;

  --tape: #c400b2;
  --on-tape: #ffffff;
  --go: #0e9f72;
  --stop: #c4183c;
  --stop-wash: #fde8ed;
  --mark: #ffe08a;
  --hover: rgba(10, 9, 13, 0.04);
  --shadow: 0 18px 48px rgba(10, 9, 13, 0.18);
}

/* C – Velvet */
[data-theme='velvet'] {
  --paper: #12081a;
  --raised: #1d1026;
  --sunken: #0e0614;
  --field: #1d1026;
  --card: #1d1026;
  --ink: #f7f2fa;
  --ink-2: #dacfe2;
  --ink-3: #b7a8c2;
  --line: #2e1c3a;
  --line-2: #43295a;

  --stage: #0e0614;
  --stage-2: #1d1026;
  --stage-3: #24142f;
  --stage-ink: #f7f2fa;
  --stage-strong: #ffffff;
  --stage-dim: #b7a8c2;
  --stage-line: #2e1c3a;

  --ctb: #c400b2;
  --ctb-strong: #a3008f;
  --ctb-wash: #3a1236;
  --on-ctb: #ffffff;
  --link: #5ef2c4;

  --bubble: #24142f;
  --on-bubble: #f7f2fa;
  --bubble-own: #c400b2;
  --on-bubble-own: #ffffff;

  --cto-lamp: #b39ddb;
  --on-cto: #0a090d;
  --cto-wash: #26173a;
  --cto-line: #4d3566;
  --cto-ink: #e0d2f5;

  --tape: #5ef2c4;
  --on-tape: #0a090d;
  --go: #5ef2c4;
  --stop: #ff8097;
  --stop-wash: #3a1420;
  --mark: #6b5410;
  --hover: rgba(247, 242, 250, 0.05);
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.6);
  --velvet-lines: repeating-linear-gradient(135deg, rgba(230, 2, 208, 0.07) 0px, rgba(230, 2, 208, 0.07) 1px, transparent 1px, transparent 26px);
}

/* ------------------------------------------------------------------ bază */

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

html, body { height: 100%; overscroll-behavior: none; }

body {
  margin: 0;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

/* --app-height și --app-top: zona rămasă vizibilă când tastatura telefonului e deschisă (vezi js/viewport.js) */
#app { position: relative; top: var(--app-top, 0px); height: var(--app-height, 100%); }

h1, h2, p, ul, ol, dl, dd, fieldset { margin: 0; padding: 0; }
fieldset { border: 0; min-width: 0; }
ul, ol { list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--link); }
[hidden] { display: none !important; }

::selection { background: var(--ctb); color: var(--on-ctb); }

* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }

:focus-visible { outline: 2px solid var(--ctb); outline-offset: 2px; }

.icon { flex: none; display: block; }

.sr-only, .offscreen {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

mark { background: var(--mark); color: inherit; border-radius: 2px; padding: 0 1px; }

/* ------------------------------------------------------------------ lămpi, avatar, etichete */

.lamp {
  flex: none;
  display: inline-block;
  width: 7px;
  height: 11px;
  border-radius: 2px;
  box-shadow: inset 0 0 0 1.5px currentColor;
  opacity: 0.45;
}
.lamp.is-on { opacity: 1; }
.lamp--go.is-on { background: var(--go); box-shadow: 0 0 0 2px color-mix(in srgb, var(--go) 28%, transparent); }
.lamp--tally.is-on { background: var(--cto-lamp); box-shadow: 0 0 0 2px color-mix(in srgb, var(--cto-lamp) 30%, transparent); }

.avatar {
  flex: none;
  display: inline-grid;
  place-items: center;
  border-radius: var(--radius);
  font-family: var(--font-sign);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #0a090d;
  user-select: none;
}
.avatar--md { width: 36px; height: 36px; font-size: 16px; }
.avatar--sm { width: 26px; height: 26px; font-size: 13px; border-radius: 5px; }
.tone-1 { background: #9d83ca; }
.tone-2 { background: #5ef2c4; }
.tone-3 { background: #e602d0; }
.tone-4 { background: #c9b8ea; }
.tone-5 { background: #a6f7de; }
.tone-6 { background: #f27fe6; }
/* integrare (de exemplu „CRM”): clopoțel pe mentă, ca să nu fie confundată cu un om */
.avatar--bot { background: linear-gradient(135deg, #5ef2c4, #9d83ca); color: #0a090d; }

.tag {
  display: inline-block;
  margin-left: 8px;
  padding: 0 6px;
  border: 1px solid var(--line-2);
  border-radius: 4px;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--ink-2);
  vertical-align: 1px;
}

.badge {
  flex: none;
  min-width: 20px;
  padding: 0 6px;
  border-radius: 4px;
  background: var(--tape);
  color: var(--on-tape);
  font-size: 12px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
}
.badge--tally { background: var(--cto-lamp); color: var(--on-cto); }

/* ------------------------------------------------------------------ butoane și câmpuri */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.5; cursor: default; }
.btn--primary { background: var(--ctb); color: var(--on-ctb); }
.btn--primary:hover:not(:disabled) { background: var(--ctb-strong); }
.btn--quiet { border-color: var(--line-2); color: var(--ink); background: var(--raised); }
.btn--quiet:hover:not(:disabled) { border-color: var(--ink-3); }
.btn--danger { background: var(--stop); color: #fff; }
[data-tone='dark'] .btn--danger { color: #2a0712; }
.btn--danger-quiet { border-color: var(--line-2); color: var(--stop); background: var(--raised); }
.btn--danger-quiet:hover:not(:disabled) { border-color: var(--stop); }
.btn--sm { min-height: 30px; padding: 0 10px; font-size: 14px; }
.btn--wide { width: 100%; min-height: 44px; }
.btn--on-dark { background: transparent; border-color: var(--line-2); color: var(--stage-ink); }

.iconbtn {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink-2);
}
.iconbtn:hover { background: var(--hover); color: var(--ink); }
.iconbtn--sm { width: 26px; height: 26px; }
.iconbtn--stage { color: var(--stage-dim); }
.iconbtn--stage:hover { background: var(--stage-2); color: var(--stage-ink); }
.iconbtn--on-dark { color: #fff; }
.iconbtn--on-dark:hover { background: rgba(255, 255, 255, 0.14); color: #fff; }

.chipbtn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink-2);
  font-size: 14px;
}
.chipbtn:hover { border-color: var(--line-2); color: var(--ink); }

.linkbtn {
  padding: 0;
  border: 0;
  background: none;
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.fields { display: grid; gap: 16px; }
.fields-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
.fields-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.field { display: grid; gap: 6px; align-content: start; }
.field-label { font-weight: 600; font-size: 14px; }
.field-hint { font-size: 13px; color: var(--ink-2); max-width: 62ch; }

.input {
  width: 100%;
  height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--raised);
  color: var(--ink);
}
.input::placeholder { color: var(--ink-3); }
.input:focus-visible { outline: 2px solid var(--ctb); outline-offset: 0; border-color: var(--ctb); }
.input--area { height: auto; min-height: 132px; resize: vertical; line-height: 1.45; }
.input--short { width: 120px; }
select.input { padding-right: 28px; }

.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.check input { flex: none; width: 17px; height: 17px; margin: 3px 0 0; accent-color: var(--ctb); }
.check-text { display: grid; gap: 2px; }
.check-hint { font-size: 13px; color: var(--ink-2); }
.radios { display: grid; gap: 10px; }
.radios legend { margin-bottom: 8px; }

.form-error {
  padding: 9px 12px;
  border-radius: var(--radius);
  background: var(--stop-wash);
  color: var(--stop);
  font-weight: 600;
  font-size: 14px;
}

/* ------------------------------------------------------------------ pornire și conectare */

.boot {
  height: 100%;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  padding: 24px;
  text-align: center;
}
.boot-title { font-family: var(--font-sign); font-size: 30px; font-weight: 700; }
.boot-note { color: var(--ink-2); max-width: 46ch; }
.boot-actions { display: flex; gap: 10px; margin-top: 8px; }

.gate {
  height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  background: var(--paper);
}
.gate--blank { display: block; background: var(--stage); }
.gate-stage {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 40px;
  padding: 56px 56px 52px;
  background: var(--stage);
  color: var(--stage-ink);
  overflow: hidden;
}
.gate-brand { display: grid; justify-items: start; gap: 28px; }
.gate-logo { display: block; width: min(420px, 100%); height: auto; margin-left: -6px; }
/* bara în degrade din logo, jos pe scenă */
.gate-bar { display: block; width: 72px; height: 4px; border-radius: 2px; background: var(--brand-bar); }
.gate-studio {
  font-family: var(--font-sign);
  font-weight: 800;
  font-size: clamp(44px, 5.6vw, 80px);
  line-height: 0.94;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}
.gate-points { display: grid; gap: 14px; max-width: 46ch; }
.gate-points li { display: grid; grid-template-columns: 7px 1fr; gap: 14px; align-items: start; color: var(--stage-ink); }
.gate-points .lamp { margin-top: 5px; }
/* formularul stă la mijloc cât are loc; când e mai înalt decât ecranul (tastatura deschisă) pornește de sus și defilează */
.gate-form { display: flex; flex-direction: column; align-items: center; padding: 40px 32px; overflow-y: auto; }
.gate-form .fields { width: min(400px, 100%); }
.gate-form > .gate-card { margin-block: auto; }
.gate-title { font-family: var(--font-sign); font-size: 34px; font-weight: 700; line-height: 1.1; margin-bottom: 4px; }
.gate-help { font-size: 14px; color: var(--ink-2); }
.gate-note { color: var(--ink-2); }
.gate-note b { color: var(--ink); font-weight: 700; overflow-wrap: anywhere; }
/* pe „Prima pornire”, în aplicația de calculator: ieșirea pentru angajații ajunși aici din greșeală */
.gate-leave { display: grid; gap: 10px; padding: 12px 14px; border: 1px solid color-mix(in srgb, var(--cto-lamp) 65%, var(--line-2)); border-radius: var(--radius); background: color-mix(in srgb, var(--cto-lamp) 12%, var(--raised)); }
.gate-leave .gate-note { color: var(--ink); }
/* „sau”, între conectare și cererea de cont */
.gate-or { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--ink-3); }
.gate-or::before, .gate-or::after { content: ''; flex: 1; border-top: 1px solid var(--line-2); }

/* ------------------------------------------------------------------ cadru */

.frame { height: 100%; display: grid; grid-template-columns: 268px minmax(0, 1fr); }
.main { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--paper); }

.side {
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--stage);
  color: var(--stage-ink);
}
.side :focus-visible { outline-color: var(--stage-ink); }
.side-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid transparent;
  border-image: var(--brand-bar) 1;
}
.side-mark { flex: none; width: auto; height: 42px; margin-top: 1px; }
.side-brand { display: grid; flex: 1; min-width: 0; }
.side-studio {
  font-family: var(--font-sign);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.side-app { font-size: 13px; color: var(--stage-dim); }
.side-top .lamp { margin-top: 8px; }
.side-offline { margin: 0 12px 8px; padding: 7px 10px; border-radius: var(--radius); background: var(--cto-lamp); color: var(--on-cto); font-size: 14px; font-weight: 600; }
/* îndemn afișat o singură dată (notificări pe acest dispozitiv) */
.side-nudge { margin: 0 12px 10px; padding: 10px 12px 12px; border: 1px solid var(--stage-line); border-radius: var(--radius); background: var(--stage-2); }
.side-nudge-text { color: var(--stage-ink); font-size: 14px; line-height: 1.4; }
.side-nudge-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.side-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 10px 12px; scrollbar-color: var(--stage-3) transparent; }
.side-section { margin-top: 14px; }
.side-heading-row { display: flex; align-items: center; justify-content: space-between; padding-right: 2px; }
.side-heading { padding: 0 8px 4px; font-family: var(--font-sign); font-size: 16px; font-weight: 600; color: var(--stage-dim); }
.side-empty { padding: 4px 8px; font-size: 14px; color: var(--stage-dim); }
.side-cta {
  margin: 2px 8px 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--stage-dim);
  font-size: 14px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.side-cta:hover { color: var(--stage-ink); }
.side-admin { padding: 8px 10px; border-top: 1px solid var(--stage-line); }

.navitem {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  padding: 4px 8px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--stage-dim);
  text-align: left;
}
.navitem:hover { background: var(--stage-2); color: var(--stage-ink); }
.navitem.is-active { background: var(--stage-3); color: var(--stage-strong); font-weight: 600; }
.navitem.has-unread { color: var(--stage-strong); font-weight: 600; }
.navitem.is-dim .navitem-name { opacity: 0.6; }
.navitem-icon { flex: none; width: 18px; display: grid; place-items: center; }
.navitem-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.navitem--tally.is-active { background: var(--cto-lamp); color: var(--on-cto); font-weight: 700; }
.navitem--tally.is-active .badge--tally { background: var(--on-cto); color: var(--cto-lamp); }

.side-me {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 0;
  border-top: 1px solid var(--stage-line);
  background: transparent;
  color: var(--stage-ink);
  text-align: left;
}
.side-me:hover { background: var(--stage-2); }
.side-me-text { flex: 1; min-width: 0; display: grid; }
.side-me-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-me-role { font-size: 13px; color: var(--stage-dim); }

.placeholder {
  flex: 1;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 6px;
  padding: 32px;
  text-align: center;
}
.placeholder-title { font-family: var(--font-sign); font-size: 28px; font-weight: 700; }
.placeholder-text { color: var(--ink-2); max-width: 40ch; }

/* ------------------------------------------------------------------ conversație */

.thread { flex: 1; min-height: 0; min-width: 0; display: flex; flex-direction: column; position: relative; }
.thread-head {
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  padding: 8px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--raised);
}
.thread-back { display: none; margin-left: -8px; }
.thread-mark { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: var(--radius); background: var(--sunken); color: var(--ink-2); }
.thread-id { flex: 1; min-width: 0; }
.thread-title { font-family: var(--font-sign); font-size: 23px; font-weight: 700; line-height: 1.15; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-sub { font-size: 13px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-tools { flex: none; display: flex; align-items: center; gap: 8px; }

.tally-strip {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 20px;
  background: var(--cto-wash);
  border-bottom: 1px solid var(--cto-line);
  color: var(--cto-ink);
  font-size: 14px;
}

.msgs-wrap { flex: 1; min-height: 0; position: relative; display: flex; }
.msgs { flex: 1; min-width: 0; overflow-y: auto; overflow-anchor: none; overscroll-behavior: contain; }
.msgs:focus-visible { outline-offset: -2px; }
.msgs-inner { display: flex; flex-direction: column; min-height: 100%; padding: 12px 0 10px; }
.msgs-inner > :first-child { margin-top: auto; }
.msgs-more, .msgs-start { padding: 10px 20px 4px 68px; font-size: 13px; color: var(--ink-3); }
.msgs-empty { padding: 24px 20px 20px 68px; color: var(--ink-2); display: grid; gap: 10px; justify-items: start; }

.day { padding: 16px 20px 4px 68px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.unread-rule { display: flex; align-items: center; gap: 10px; margin: 8px 20px 2px; color: var(--tape); font-size: 13px; font-weight: 700; }
.unread-rule::after { content: ''; flex: 1; height: 1px; background: var(--tape); opacity: 0.6; }

.msg { position: relative; display: grid; grid-template-columns: 36px minmax(0, 1fr); column-gap: 12px; padding: 7px 20px 2px; }
.msg--cont { padding-top: 1px; }
.msg:hover { background: var(--hover); }
.msg--hl { background: color-mix(in srgb, var(--cto-lamp) 18%, transparent); box-shadow: inset 3px 0 0 var(--cto-lamp); }
/* buzz în conversație: un rând scurt, în mijloc */
.msg-buzz { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 6px 20px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.msg-buzz .icon { color: var(--cto-lamp); }
/* buzz primit: tot chatul tremură scurt */
.buzzing { animation: buzz-shake 0.75s ease-in-out; }
@keyframes buzz-shake {
  0%, 100% { transform: translate(0, 0); }
  10%, 50%, 90% { transform: translate(-7px, 1px); }
  30%, 70% { transform: translate(7px, -1px); }
  20%, 60% { transform: translate(-4px, -1px); }
  40%, 80% { transform: translate(4px, 1px); }
}
/* fără animații (setarea sistemului): în locul tremuratului, o ramă colorată peste tot chatul, sub ferestrele de dialog */
@media (prefers-reduced-motion: reduce) {
  .buzzing { animation: none; }
  .buzzing::after { content: ''; position: fixed; inset: 0; z-index: 45; pointer-events: none; box-shadow: inset 0 0 0 5px var(--cto-lamp); }
}
.msg-gutter { display: flex; justify-content: center; }
.msg-hovertime { visibility: hidden; padding-top: 3px; font-size: 11px; color: var(--ink-3); white-space: nowrap; }
.msg:hover .msg-hovertime { visibility: visible; }
.msg-body { min-width: 0; }
.msg-head { display: flex; align-items: baseline; flex-wrap: wrap; column-gap: 8px; }
.msg-author { font-weight: 700; }
.msg-head .tag { margin-left: 0; }
.msg-time { font-size: 12px; color: var(--ink-3); }
.msg-text { max-width: 78ch; white-space: pre-wrap; word-break: break-word; overflow-wrap: anywhere; }
.msg-text--emoji { font-size: 34px; line-height: 1.25; }
.msg-gone { color: var(--ink-3); font-style: italic; }
.msg-files { display: flex; flex-wrap: wrap; gap: 8px; margin: 5px 0 4px; }
.msg-tools { position: absolute; top: 2px; right: 16px; display: none; border: 1px solid var(--line); border-radius: var(--radius); background: var(--raised); }
.msg:hover .msg-tools, .msg:focus-within .msg-tools { display: block; }

/* „Văzut”: sub ultimul mesaj al omului (și unde se schimbă ceva); la apăsare, cine a văzut și când */
.msg-seen { display: inline-flex; align-items: center; gap: 5px; margin-top: 3px; padding: 1px 0; border: 0; background: none; font: inherit; font-size: 12px; line-height: 1.4; color: var(--ink-3); cursor: pointer; text-align: left; }
.msg-seen:hover { color: var(--ink-2); text-decoration: underline; }
.msg-seen--all { color: var(--link); }
.msg-seen .icon { flex: none; }
.seen-msg { display: grid; gap: 3px; margin: 0 0 4px; padding: 10px 12px; border-radius: var(--radius); background: var(--sunken); }
.seen-msg-text { white-space: pre-wrap; word-break: break-word; overflow-wrap: anywhere; color: var(--ink); }
.seen-msg-time { font-size: 12px; color: var(--ink-3); }
.seen-head { margin: 14px 0 4px; font-size: 13px; font-weight: 700; color: var(--ink-2); }

.shot { display: block; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--sunken); overflow: hidden; line-height: 0; cursor: zoom-in; }
.shot-img { display: block; max-width: 100%; height: auto; }
.shot-img:not([width]) { max-width: min(360px, 100%); max-height: 300px; }
/* videoclipurile se văd direct în conversație, cu butoanele browserului; sub ele, descărcarea originalului */
.vid { display: grid; gap: 4px; justify-items: start; max-width: 100%; }
.shot-video { display: block; max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #000; }
.shot-video:not([width]) { width: min(360px, 100%); max-height: 300px; }
.vid-actions { display: flex; flex-wrap: wrap; column-gap: 14px; row-gap: 4px; }
.vid-dl { display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; background: none; font: inherit; font-size: 13px; color: var(--ink-2); text-decoration: none; cursor: pointer; }
.vid-dl:hover { color: var(--ink); text-decoration: underline; }
.vid-note { max-width: min(360px, 100%); margin: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--sunken); font-size: 13px; color: var(--ink-2); }
.lightbox-video { background: #000; }

.filechip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--raised);
  color: var(--ink);
  text-decoration: none;
}
.filechip:hover { border-color: var(--ctb); }
.filechip .icon { color: var(--ink-2); }
.filechip-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.filechip-size { flex: none; font-size: 13px; color: var(--ink-3); }

.jump {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 14px;
  border: 0;
  border-radius: 16px;
  background: var(--tape);
  color: var(--on-tape);
  font-size: 14px;
  font-weight: 700;
  box-shadow: var(--shadow);
}

.drop-hint {
  position: absolute;
  inset: 10px;
  display: none;
  place-content: center;
  justify-items: center;
  gap: 8px;
  border: 2px dashed var(--ctb);
  border-radius: 10px;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  color: var(--link);
  font-weight: 700;
  pointer-events: none;
}
.thread.is-dropping .drop-hint { display: grid; }

.typing { flex: none; min-height: 20px; padding: 0 20px 0 68px; font-size: 13px; color: var(--ink-3); }
.thread-foot { flex: none; padding: 0 16px 14px; }
.foot-note { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border: 1px dashed var(--line-2); border-radius: var(--radius); color: var(--ink-2); font-size: 14px; }

.composer { border: 1px solid var(--line-2); border-radius: 8px; background: var(--raised); }
.composer:focus-within { border-color: var(--ctb); box-shadow: 0 0 0 1px var(--ctb); }
.composer-row { display: flex; align-items: flex-end; gap: 4px; padding: 6px; }
.composer-input {
  flex: 1;
  min-width: 0;
  height: 36px;
  max-height: 180px;
  padding: 7px 6px;
  border: 0;
  background: transparent;
  color: var(--ink);
  line-height: 1.45;
  resize: none;
  outline: none;
}
.composer-input::placeholder { color: var(--ink-3); }
.composer-send { min-height: 36px; padding: 0 14px; margin-left: 4px; }
/* buzz, lângă „Trimite” (conversații private); cât așteaptă, arată secundele rămase */
.composer-buzz { min-height: 36px; padding: 0 12px; gap: 6px; }
.composer-buzz .icon { color: var(--cto-lamp); }
.composer-buzz:disabled { opacity: 0.65; cursor: default; }
.composer-buzz-count { font-size: 13px; font-variant-numeric: tabular-nums; color: var(--ink-2); }

.uploads { display: grid; gap: 6px; padding: 8px 8px 0; }
.upload { display: flex; align-items: center; gap: 8px; padding: 5px 6px 5px 10px; border-radius: var(--radius); background: var(--sunken); font-size: 14px; }
.upload-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.upload-meta { flex: none; color: var(--ink-3); font-size: 13px; }
.upload--error .upload-meta { color: var(--stop); flex: 0 1 auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upload-bar { flex: 1; min-width: 40px; height: 4px; margin-left: auto; accent-color: var(--ctb); }
.upload .iconbtn { margin-left: auto; }
.upload-bar + .iconbtn { margin-left: 0; }
.upload-note { margin: 0; padding: 0 4px 2px; font-size: 12.5px; line-height: 1.4; color: var(--ink-2); }

.emoji-pop {
  position: fixed;
  z-index: 60;
  display: grid;
  grid-template-columns: repeat(8, 36px);
  gap: 2px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--raised);
  box-shadow: var(--shadow);
}
.emoji { width: 36px; height: 36px; padding: 0; border: 0; border-radius: var(--radius); background: transparent; font-size: 21px; line-height: 1; }
.emoji:hover { background: var(--hover); }

/* ------------------------------------------------------------------ supraveghere */

.ov, .admin { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.ov { box-shadow: inset 0 3px 0 var(--cto-lamp); }
.ov-head {
  flex: none;
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  column-gap: 28px;
  padding: 16px 20px 0;
  border-bottom: 1px solid var(--line);
  background: var(--raised);
}
.ov .ov-head { background: var(--cto-wash); border-bottom-color: var(--cto-line); }
.ov-heading { display: flex; align-items: center; gap: 12px; padding-bottom: 10px; }
.ov-heading .lamp { width: 9px; height: 14px; }
.view-title { font-family: var(--font-sign); font-size: 28px; font-weight: 700; line-height: 1.1; }
.ov .view-title { color: var(--cto-ink); }

.tabs { display: flex; gap: 4px; overflow-x: auto; }
.tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px 10px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--ink-2);
  font-weight: 600;
  white-space: nowrap;
}
.tab:hover { color: var(--ink); }
.tab.is-on { color: var(--ink); border-bottom-color: var(--ctb); }
.ov .tab { color: var(--cto-ink); opacity: 0.75; }
.ov .tab:hover { opacity: 1; }
.ov .tab.is-on { opacity: 1; border-bottom-color: var(--cto-lamp); }

.ov-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.lead { color: var(--ink-2); max-width: 70ch; }

.wall-wrap { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 20px 24px; display: grid; align-content: start; gap: 14px; }
.wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.wall-note { grid-column: 1 / -1; color: var(--ink-2); display: grid; gap: 10px; justify-items: start; }

.tile {
  display: flex;
  flex-direction: column;
  height: 232px;
  padding: 0;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--raised);
  color: var(--ink);
  text-align: left;
  overflow: hidden;
}
.tile:hover { border-color: var(--cto-lamp); }
.tile.is-lit { border-color: var(--cto-line); }
.tile-head { flex: none; display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.tile.is-lit .tile-head { background: var(--cto-wash); border-bottom-color: var(--cto-line); color: var(--cto-ink); }
.tile-title {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-sign);
  font-size: 18px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tile-time { flex: none; font-size: 12px; color: var(--ink-3); }
.tile.is-lit .tile-time { color: var(--cto-ink); }
.tile-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 5px;
  padding: 8px 12px 10px;
  overflow: hidden;
  /* rândurile mai vechi se sting spre marginea de sus, ca pe un monitor */
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 22px);
  mask-image: linear-gradient(to bottom, transparent 0, #000 22px);
}
.tile-line {
  flex: none;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.tile-line.is-gone { color: var(--ink-3); font-style: italic; }
.tile-who { font-weight: 700; }
.tile.is-fresh { animation: tile-fresh 1.4s ease-out; }
@keyframes tile-fresh {
  0% { box-shadow: 0 0 0 3px var(--cto-lamp); }
  100% { box-shadow: 0 0 0 3px transparent; }
}

.ov-split { flex: 1; min-height: 0; display: grid; grid-template-columns: 320px minmax(0, 1fr); }
.ov-side { min-height: 0; display: flex; flex-direction: column; border-right: 1px solid var(--line); background: var(--raised); }
.ov-filter { flex: none; display: grid; gap: 10px; padding: 12px; border-bottom: 1px solid var(--line); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { height: 28px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 14px; background: transparent; color: var(--ink-2); font-size: 14px; }
.chip.is-on { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.ov-items { flex: 1; min-height: 0; overflow-y: auto; }
.ov-note { padding: 16px; color: var(--ink-2); max-width: 60ch; }
.ov-note--error { color: var(--stop); }
.ov-item {
  width: 100%;
  display: grid;
  grid-template-columns: 7px minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  text-align: left;
}
.ov-item .lamp { margin-top: 5px; }
.ov-item:hover { background: var(--hover); }
.ov-item.is-active { background: var(--cto-wash); color: var(--cto-ink); }
.ov-item.is-dim .ov-item-title { color: var(--ink-3); }
.ov-item-main { min-width: 0; display: grid; gap: 1px; }
.ov-item-title { display: flex; align-items: center; gap: 5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ov-item.is-lit .ov-item-snip { color: inherit; }
.ov-item-snip { font-size: 14px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ov-item-side { display: grid; justify-items: end; gap: 4px; }
.ov-item-time { font-size: 12px; color: var(--ink-3); }
.ov-detail { min-width: 0; min-height: 0; display: flex; flex-direction: column; }

.search-wrap { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 20px 28px; display: grid; align-content: start; gap: 16px; }
.searchbar { display: grid; grid-template-columns: minmax(180px, 2fr) minmax(140px, 1fr) 150px 150px auto; gap: 12px; align-items: end; }
.results { display: grid; gap: 8px; max-width: 900px; }
.results .ov-note { padding: 4px 0; }
.results-count { font-size: 14px; color: var(--ink-2); }
.result {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--raised);
  color: var(--ink);
  text-align: left;
}
.result:hover { border-color: var(--cto-lamp); }
.result-head { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--ink-2); }
.result-where { display: inline-flex; align-items: center; gap: 5px; font-weight: 700; color: var(--ink); min-width: 0; }
.result-when { flex: none; }
.result-text { overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.results-more { justify-self: start; }

/* ------------------------------------------------------------------ administrare */

.sheet { flex: 1; min-height: 0; overflow-y: auto; padding: 20px 20px 32px; }
.pane { display: grid; gap: 16px; max-width: 1040px; }
.pane--narrow { max-width: 680px; }
.pane-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.pane-title { font-family: var(--font-sign); font-size: 22px; font-weight: 700; margin-top: 8px; }
.note { font-size: 14px; color: var(--ink-2); max-width: 75ch; }

/* position: relative ține înăuntru și textele ascunse („Acțiuni”); altfel lățesc pagina pe telefon */
.table-wrap { position: relative; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--raised); }
.table { width: 100%; border-collapse: collapse; }
.table th { padding: 10px 14px; text-align: left; font-size: 13px; font-weight: 700; color: var(--ink-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tr.is-dim td { color: var(--ink-3); }
.cell-user { display: flex; align-items: center; gap: 10px; }
.cell-icon { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 5px; background: var(--sunken); color: var(--ink-2); }
.cell-name { font-weight: 700; }
.cell-meta { font-size: 13px; color: var(--ink-3); }
.cell-status { display: inline-flex; align-items: center; gap: 8px; }
.cell-actions { text-align: right; white-space: nowrap; }
.cell-buttons { display: inline-flex; gap: 8px; }
.requests { display: grid; gap: 10px; }
.requests .pane-title { margin-top: 0; }

.steps { list-style: decimal; padding-left: 22px; display: grid; gap: 6px; max-width: 70ch; }
.bullets { list-style: disc; padding-left: 20px; display: grid; gap: 8px; max-width: 70ch; color: var(--ink-2); }
.addresses { display: grid; gap: 8px; }
.address { display: flex; align-items: center; gap: 12px; }
.address-text { padding: 7px 12px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--raised); font-family: var(--font-text); font-size: 18px; font-weight: 700; letter-spacing: 0.02em; }
/* linkul secret al unei integrări: lung, se rupe oriunde și se selectează dintr-un clic */
.address--secret { flex-wrap: wrap; margin: 12px 0; }
.address--secret .address-text { flex: 1 1 100%; font-size: 13px; font-weight: 400; letter-spacing: 0; word-break: break-all; user-select: all; }
.tag--bot { border-color: color-mix(in srgb, #5ef2c4 60%, transparent); }
/* membrii unui canal făcut de CRM: doar de văzut (îi alege CRM-ul) */
.crm-members { display: grid; gap: 6px; max-height: 260px; overflow-y: auto; margin: 6px 0 0; padding: 0; list-style: none; }
.crm-members li { display: flex; align-items: center; gap: 10px; }

.creds { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 14px 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--sunken); }
.creds dt { color: var(--ink-2); }
.creds dd { font-weight: 700; user-select: all; overflow-wrap: anywhere; }

/* ------------------------------------------------------------------ straturi: dialog, meniu, toast, imagine */

.dialog-backdrop {
  position: fixed;
  top: var(--app-top, 0px);
  left: 0;
  right: 0;
  height: var(--app-height, 100%);
  z-index: 50;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  place-items: center;
  padding: 16px;
  background: rgba(8, 7, 11, 0.6);
  animation: fade-in 120ms ease-out;
}
.dialog {
  width: min(480px, 100%);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  border-radius: 10px;
  background: var(--raised);
  color: var(--ink);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.dialog--wide { width: min(640px, 100%); }
.dialog--tally { border-top: 4px solid var(--cto-lamp); }
.dialog-head { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 12px 4px 20px; }
.dialog-title { font-family: var(--font-sign); font-size: 25px; font-weight: 700; line-height: 1.15; }
.dialog-form { min-height: 0; display: flex; flex-direction: column; }
.dialog-body { min-height: 0; overflow-y: auto; padding: 10px 20px 18px; display: grid; gap: 14px; }
.dialog-foot { flex: none; display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; padding: 12px 20px 16px; border-top: 1px solid var(--line); }
.dialog-text { color: var(--ink-2); max-width: 62ch; }
.ack { display: grid; gap: 12px; }
.ack .dialog-text { color: var(--ink); font-size: 16px; white-space: pre-wrap; }
.dialog.is-busy { cursor: progress; }

.picker { display: grid; gap: 10px; }
/* rândurile cu persoane încap în lățimea dialogului: „@utilizator” ia doar locul rămas liber și se scurtează
   primul, numele lungi se scurtează cu „…” abia după el, iar eticheta cu rolul rămâne întreagă */
.picklist { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; max-height: 320px; overflow-y: auto; }
.picklist-empty { padding: 10px 4px; color: var(--ink-2); }
.pick { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border: 0; border-radius: var(--radius); background: transparent; color: var(--ink); text-align: left; }
button.pick:hover { background: var(--hover); }
.pick-name { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-meta { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; text-align: right; font-size: 13px; color: var(--ink-3); white-space: nowrap; }
.pick .tag { flex: none; margin-left: 0; }
.checklist { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; max-height: 220px; overflow-y: auto; padding: 6px; border: 1px solid var(--line-2); border-radius: var(--radius); }
.checklist-item { display: flex; align-items: center; gap: 10px; padding: 5px 6px; border-radius: 4px; cursor: pointer; }
.checklist-item:hover { background: var(--hover); }
.checklist-item input { flex: none; width: 17px; height: 17px; margin: 0; accent-color: var(--ctb); }
.checklist-item .tag { flex: none; margin-left: auto; }

.menu {
  position: fixed;
  z-index: 60;
  min-width: 230px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--raised);
  color: var(--ink);
  box-shadow: var(--shadow);
}
.menu-item { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 0; border-radius: 5px; background: transparent; color: inherit; text-align: left; }
.menu-item:hover, .menu-item:focus-visible { background: var(--hover); outline: none; }
.menu-item--danger { color: var(--stop); }
.menu-label { flex: 1; }
.menu-gap { width: 16px; }
.menu-sep { height: 1px; margin: 6px 4px; background: var(--line); }

.toasts { position: fixed; z-index: 70; left: 50%; bottom: calc(100% - var(--app-top, 0px) - var(--app-height, 100%) + 22px); transform: translateX(-50%); display: grid; gap: 8px; justify-items: center; width: min(520px, calc(100vw - 32px)); pointer-events: none; }
.toast { padding: 10px 16px; border-radius: var(--radius); background: var(--ink); color: var(--paper); font-weight: 600; box-shadow: var(--shadow); animation: fade-in 120ms ease-out; }
.toast--error { background: var(--stop); color: #fff; }
[data-tone='dark'] .toast--error { color: #2a0712; }

.lightbox { position: fixed; inset: 0; z-index: 49; display: flex; flex-direction: column; background: rgba(8, 7, 11, 0.94); animation: fade-in 120ms ease-out; }
.lightbox-bar { flex: none; display: flex; align-items: center; gap: 10px; padding: 10px 14px; color: #fff; }
.lightbox-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.lightbox-stage { flex: 1; min-height: 0; display: grid; place-items: center; padding: 0 20px 20px; cursor: zoom-out; }
.lightbox-img { max-width: 100%; max-height: 100%; object-fit: contain; cursor: default; }

.phone { display: grid; gap: 14px; }
.outside { display: grid; gap: 14px; }
.outside-step { display: grid; gap: 10px; padding: 14px 16px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--raised); max-width: 75ch; }
.outside-state { display: flex; align-items: baseline; gap: 10px; font-weight: 600; }
.outside-state .lamp { flex: none; position: relative; top: 1px; }
.outside-state strong { overflow-wrap: anywhere; }
.outside-approve { display: grid; gap: 10px; justify-items: start; }
.outside-error { display: grid; gap: 6px; color: var(--stop); }
.outside-error pre { margin: 0; padding: 8px 10px; border-radius: var(--radius); background: var(--sunken); color: var(--ink); font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 180px; overflow: auto; }
.outside-manual { max-width: 75ch; }
.outside-manual > summary { cursor: pointer; color: var(--ink-2); font-weight: 600; padding: 4px 0; }
.outside-manual[open] { display: grid; gap: 12px; }
.public-url { display: grid; gap: 10px; max-width: 520px; }
.public-url-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.command { margin-top: 8px; flex-wrap: wrap; }
.qr-list { display: flex; flex-wrap: wrap; gap: 14px; }
.qr-hint { flex-basis: 100%; }
.qr-card {
  margin: 0;
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 10px 10px 8px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: #ffffff;
}
.qr { display: block; width: 190px; height: 190px; }
.qr-address { font-weight: 700; font-size: 15px; color: #16141c; letter-spacing: 0.01em; }

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* ------------------------------------------------------------------ ecrane înguste */

@media (max-width: 900px) {
  .gate { grid-template-columns: 1fr; grid-template-rows: auto 1fr; overflow-y: auto; }
  /* fără overflow: hidden, banda de sus nu se mai strânge sub un formular înalt: pagina defilează */
  .gate-stage { padding: 28px 24px; gap: 20px; overflow: visible; }
  .gate-studio { font-size: clamp(36px, 10vw, 56px); }
  .gate-brand { gap: 16px; }
  .gate-logo { width: min(240px, 70vw); margin-left: -4px; }
  .gate-bar { display: none; }
  .gate-form { padding: 28px 24px 40px; overflow: visible; }
  .gate-form > .gate-card { margin-block: 0; }
  .searchbar { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  .frame { grid-template-columns: 1fr; }
  .frame > .main { display: none; }
  .frame.is-main > .main { display: flex; }
  .frame.is-main > .side { display: none; }
  .thread-back { display: inline-grid; }
  .thread-head { padding: 8px 12px; }
  .msg { padding-left: 12px; padding-right: 12px; }
  .composer-send-label { display: none; }
  .composer-buzz-name { display: none; }
  .composer-buzz { padding: 0 10px; }
  .ov-split { grid-template-columns: 1fr; }
  .ov-split > .ov-detail { display: none; }
  .ov-split.is-detail > .ov-detail { display: flex; }
  .ov-split.is-detail > .ov-side { display: none; }
  .fields-pair { grid-template-columns: 1fr; }
  .searchbar { grid-template-columns: 1fr; }
  .day, .msgs-more, .msgs-start, .msgs-empty, .typing { padding-left: 60px; padding-right: 12px; }
  .unread-rule { margin-left: 12px; margin-right: 12px; }
  .thread-foot { padding: 0 8px 8px; }
  .tally-strip { padding-left: 12px; padding-right: 12px; }
  .ov-head { padding-left: 12px; padding-right: 12px; column-gap: 12px; }
  .wall-wrap, .search-wrap, .sheet { padding-left: 12px; padding-right: 12px; }
  .pane-bar .btn { width: 100%; }
  .dialog-backdrop { padding: 10px; }
  /* cererile de cont, pe telefon: numele, momentul și butoanele unele sub altele, toate pe ecran */
  .requests .table, .requests .table tbody, .requests .table tr, .requests .table td { display: block; }
  .requests .table thead { display: none; }
  .requests .table tr { padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .requests .table tbody tr:last-child { border-bottom: 0; }
  .requests .table td { padding: 0; border: 0; }
  .requests .table td + td { margin-top: 6px; }
  .requests .table td:nth-child(2)::before { content: 'Cerută '; color: var(--ink-3); font-size: 13px; }
  .requests .cell-actions { text-align: left; }
}

/* Dispozitive folosite prin atingere: ținte mai mari și text care nu declanșează mărirea paginii pe iPhone */
@media (pointer: coarse) {
  .input, .composer-input { font-size: 16px; }
  .input { height: 44px; }
  .input--area { height: auto; }
  .navitem { min-height: 44px; }
  .iconbtn { width: 44px; height: 44px; }
  .iconbtn--sm { width: 36px; height: 36px; }
  .btn { min-height: 44px; }
  .btn--sm { min-height: 38px; }
  .chipbtn { height: 38px; }
  .chip { height: 36px; padding: 0 14px; border-radius: 18px; }
  .tab { padding-top: 12px; padding-bottom: 13px; }
  .menu-item { padding: 12px 10px; }
  .pick { padding: 10px 8px; }
  .checklist-item { padding: 9px 6px; }
  .side-cta { padding: 8px 0; }
  .composer-emoji { display: none; }
  .composer-input { height: 44px; padding-top: 10px; padding-bottom: 10px; }
  .composer-send { min-height: 44px; min-width: 48px; }
  .composer-buzz { min-height: 44px; min-width: 44px; }
  .msg-tools { display: block; top: 0; right: 6px; border: 0; background: transparent; opacity: 0.6; }
  /* pe telefon, cine a văzut se deschide din rândul „Văzut” (o iconiță la fiecare mesaj ar încărca ecranul) */
  .msg-tool-seen { display: none; }
  .msg-seen { min-height: 32px; }
  .ov-item { padding-top: 13px; padding-bottom: 13px; }
}

@media (hover: none) {
  .msg:hover { background: transparent; }
  .msg--hl:hover { background: color-mix(in srgb, var(--cto-lamp) 18%, transparent); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ================================================================== designul studioului (teme A, B, C)
 * Vine după restul stilurilor, deci le înlocuiește unde e cazul. Valorile sunt cele din pachetul de design
 * (design-tokens.json și ecranele HTML). Decorurile nu primesc clicuri (pointer-events: none).
 */

/* ------------------------------------------------ butoane, câmpuri, avatar */
.btn { border-radius: var(--radius-field); }
.btn--wide { min-height: 48px; }
.input { height: 44px; border-radius: var(--radius-field); background: var(--field); border-color: var(--line-2); }
.avatar { border-radius: 50%; }
.avatar--md { width: 40px; height: 40px; font-size: 14px; }
.avatar--sm { width: 30px; height: 30px; font-size: 11.5px; border-radius: 50%; }
.badge { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; line-height: 22px; }
.boot-title, .placeholder-title, .gate-title, .gate-studio, .view-title, .dialog-title { font-family: var(--font-display); font-weight: 600; letter-spacing: 0.03em; }
.placeholder-title { font-size: 26px; }
.view-title { font-size: 26px; }

/* ------------------------------------------------ cadrul: bara neagră (B), lista, zona principală */
.frame { grid-template-columns: 300px minmax(0, 1fr); }
.rail { display: none; }
[data-theme='clean'] .frame { grid-template-columns: 76px 300px minmax(0, 1fr); }
[data-theme='clean'] .rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px 0 18px;
  background: var(--brand-black);
}
.rail :focus-visible { outline-color: #ffffff; }
.rail-mark { display: block; width: auto; height: 40px; margin-bottom: 22px; }
.rail-item {
  position: relative;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: #a9a5b3;
}
.rail-item:hover { background: #1a1820; color: #ffffff; }
.rail-item.is-on { background: #221f29; color: #ffffff; }
.rail-badge {
  position: absolute;
  top: 3px;
  right: 1px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--brand-magenta-deep);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
}
.rail-space { flex: 1; }
/* în tema B, Supravegherea și Administrarea sunt în bara neagră */
[data-theme='clean'] .side-admin { display: none; }

.side { position: relative; border-right: 1px solid var(--stage-line); }
.side-top {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 20px 18px;
  border-bottom: 1px solid var(--stage-line);
  border-image: none;
}
.side-top > .lamp { position: absolute; top: 14px; right: 14px; margin: 0; }
.side-logo, .side-mark { display: none; }
.side-studio {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.side-app { font-size: 13px; color: var(--stage-dim); }
/* A: logo întreg, 150 px, centrat sus, cu separator dedesubt */
[data-theme='neon'] .side-top { justify-content: center; padding: 30px 20px 26px; }
[data-theme='neon'] .side-logo { display: block; width: 150px; height: auto; }
[data-theme='neon'] .side-brand { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
/* C: monogramă + numele studioului */
[data-theme='velvet'] .side-mark { display: block; width: auto; height: 46px; }
/* B: doar numele (monograma e în bara neagră), fără separator */
[data-theme='clean'] .side-top { padding: 26px 24px 14px; border-bottom: 0; }

.side-search {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 46px;
  margin: 18px 16px 2px;
  padding: 0 14px;
  border: 1px solid var(--stage-line);
  border-radius: var(--radius-field);
  background: var(--stage-2);
  color: var(--stage-dim);
  cursor: text;
}
[data-theme='clean'] .side-search { background: #ffffff; border-color: var(--line); }
.side-search:focus-within { border-color: var(--ctb); }
.side-search-input { flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; background: transparent; color: var(--stage-ink); outline: none; }
.side-search-input::placeholder { color: var(--stage-dim); }
.side-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.side-section.is-filtered-out { display: none; }
.side-scroll { padding: 4px 12px 14px; }
.side-section { margin-top: 20px; }
.side-heading {
  padding: 0 10px 8px;
  font-family: var(--font-text);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--stage-dim);
}
.side-offline { margin: 12px 16px 0; }
.side-nudge { margin: 14px 16px 0; }

.navitem { min-height: 44px; gap: 12px; padding: 6px 10px; border-radius: var(--radius); color: var(--stage-ink); font-size: 15.5px; }
.navitem + .navitem { margin-top: 2px; }
.navitem-icon { color: var(--stage-dim); }
.navitem-icon--person { width: 30px; }
.navitem-text { flex: 1; min-width: 0; display: grid; }
.navitem-preview, .navitem-time { display: none; }
.navitem-side { flex: none; display: flex; align-items: center; gap: 8px; }
.online-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--brand-mint); margin-right: 6px; }
.side-me { padding: 14px 18px; }

/* ------------------------------------------------ conversația */
.main { position: relative; }
[data-theme='velvet'] .main { background-image: var(--velvet-lines); }
.thread-deco { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.thread > :not(.thread-deco) { position: relative; z-index: 1; }
/* C: logo-ul întreg în fundal, centrat, abia vizibil */
[data-theme='velvet'] .thread-deco::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(520px, 80%);
  aspect-ratio: 571 / 360;
  transform: translate(-50%, -50%);
  background: url('/img/logo.png') center / contain no-repeat;
  opacity: 0.06;
}

.thread-head { min-height: 68px; padding: 10px 24px; background: transparent; }
[data-theme='clean'] .thread-head { border-bottom: 0; }
[data-theme='clean'] .thread-head::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--brand-bar); }
.thread-mark { width: auto; height: auto; background: none; color: var(--ink); }
.thread-title { font-family: var(--font-text); font-size: 19px; font-weight: 600; }
.thread-sub { font-size: 13.5px; color: var(--ink-3); }
.thread-brand { display: none; }
.tally-strip { background: var(--cto-wash); }

.msgs-inner { padding: 16px 0 12px; }
.msgs-more, .msgs-start { padding: 10px 24px 4px 78px; }
.msgs-empty { padding: 24px 24px 20px 78px; }
.day { display: flex; align-items: center; gap: 16px; padding: 22px 24px 8px; font-weight: 500; color: var(--ink-3); }
.day::before, .day::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.unread-rule { margin: 10px 24px 4px; }
.typing { padding: 0 24px 0 78px; }

.msg { grid-template-columns: 40px minmax(0, 1fr); column-gap: 14px; align-items: end; padding: 10px 24px 2px; }
.msg--cont { padding-top: 4px; }
.msg:hover { background: transparent; }
.msg-gutter { align-self: end; }
.msg-body { display: flex; flex-direction: column; align-items: flex-start; }
.msg-head { margin: 0 0 6px 2px; font-size: 13px; column-gap: 6px; }
.msg-author { font-weight: 600; }
.msg-time { font-size: 13px; }
.msg-head .msg-time::before { content: '· '; }
.msg-text {
  max-width: min(72ch, 100%);
  padding: 10px 16px;
  border-radius: 16px 16px 16px 4px;
  background: var(--bubble);
  color: var(--on-bubble);
  line-height: 1.45;
}
.msg-text a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.msg--emoji .msg-text { padding: 0; background: none; }
.msg-gone { padding: 8px 14px; border: 1px dashed var(--line-2); border-radius: 16px; }
.msg-files { margin: 6px 0 2px; }
.msg-tools { top: -4px; right: 20px; border-radius: var(--radius); }
/* mesajele proprii: în dreapta, fără avatar, în culoarea temei */
.msg--own { grid-template-columns: minmax(0, 1fr); }
.msg--own .msg-gutter { display: none; }
.msg--own .msg-body { align-items: flex-end; }
.msg--own .msg-head { justify-content: flex-end; margin-right: 2px; }
.msg--own .msg-author { font-weight: 400; color: var(--ink-3); }
.msg--own .msg-text { border-radius: 16px 16px 4px 16px; background: var(--bubble-own); color: var(--on-bubble-own); }
.msg--own.msg--emoji .msg-text { background: none; }
.msg--own .msg-tools { right: auto; left: 20px; }

.thread-foot { padding: 6px 24px 20px; }
.composer { border: 0; background: transparent; }
.composer:focus-within { border-color: transparent; box-shadow: none; }
.composer-row { align-items: center; gap: 10px; padding: 0; }
.composer-input {
  height: 50px;
  padding: 13px 52px 13px 18px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-field);
  background: var(--field);
}
.composer-input:focus { border-color: var(--ctb); }
/* emoji stă în câmp, la dreapta */
.composer-emoji { margin-left: -56px; position: relative; }
.composer-row > .iconbtn:first-child { color: var(--ink-3); }
.composer-send { width: 50px; min-width: 50px; height: 50px; min-height: 50px; margin-left: 0; padding: 0; border-radius: var(--radius-field); }
.composer-send .icon { width: 22px; height: 22px; }
.composer-send-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.composer-buzz { height: 50px; min-height: 50px; border-radius: var(--radius-field); }
.uploads { padding: 0 0 8px; }

/* ------------------------------------------------ conectare și prima pornire */
/* A și C: logo (sau monogramă) și un card centrat; B: ecran împărțit, negru cu logo în stânga */
.gate {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 30px;
  min-height: 100%;
  height: 100%;
  padding: 40px 20px;
  overflow-y: auto;
  background: var(--paper);
}
.gate--blank { display: block; }
.gate > * { position: relative; z-index: 1; flex: none; }
/* centrat cât încape; mai înalt decât ecranul, pornește de sus și defilează (nu se taie logo-ul) */
.gate > .gate-stage { margin-top: auto; }
.gate > .gate-form { margin-bottom: auto; }
.gate::before { content: none; position: fixed; z-index: 0; pointer-events: none; }
.gate-stage { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 0; background: transparent; color: var(--ink); overflow: visible; }
.gate-brand { justify-items: center; gap: 20px; }
.gate-logo { width: clamp(170px, 28vh, 280px); max-width: 70vw; margin: 0; }
.gate-bar { display: none; }
.gate-studio { font-size: clamp(28px, 4vw, 40px); line-height: 1.1; text-align: center; }
.gate-form { display: block; width: min(460px, 100%); padding: 0; overflow: visible; }
.gate-form > .gate-card { margin: 0; }
.gate-card { width: 100%; padding: 38px 40px 34px; border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--card); }
.gate-card .fields { width: 100%; }
.gate-card-mark { display: none; }
.gate-title { font-size: 30px; line-height: 1.15; }
[data-theme='velvet'] .gate { background-image: var(--velvet-lines); }
[data-theme='velvet'] .gate-logo { display: none; }
[data-theme='velvet'] .gate-card-mark { display: block; width: auto; height: 66px; margin: 0 auto 26px; }
[data-theme='velvet'] .gate::before {
  content: '';
  left: 8vw;
  bottom: -5vh;
  width: min(380px, 40vw);
  aspect-ratio: 100 / 128;
  background: url('/img/mark.png') left bottom / contain no-repeat;
  opacity: 0.07;
}
[data-theme='clean'] .gate {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 0;
  padding: 0;
  align-items: stretch;
  justify-content: stretch;
}
[data-theme='clean'] .gate > * { margin: 0; }
[data-theme='clean'] .gate-stage { justify-content: center; gap: 30px; padding: 56px; background: var(--brand-black); color: #ffffff; }
[data-theme='clean'] .gate-logo { width: min(420px, 100%); max-width: none; }
[data-theme='clean'] .gate-bar { display: block; width: 180px; height: 3px; }
[data-theme='clean'] .gate-form { display: flex; flex-direction: column; align-items: center; width: auto; padding: 40px 32px; overflow-y: auto; }
[data-theme='clean'] .gate-form > .gate-card { margin-block: auto; }
[data-theme='clean'] .gate-card { width: min(400px, 100%); padding: 0; border: 0; background: transparent; }

/* ------------------------------------------------ valurile animate (tema A; designul: screens/A-*.html)
 * Trei unde într-un dreptunghi de 1600×240, rotit la -58° (direcția barei din logo); se mișcă doar transform.
 * La „reducerea mișcării” stau pe loc (regula generală de la sfârșitul fișierului).
 */
.waves {
  display: none;
  position: absolute;
  z-index: 0;
  left: 62%;
  top: 50%;
  width: 1600px;
  height: 240px;
  margin: -120px 0 0 -800px;
  opacity: 0.5;
  transform: rotate(-58deg);
  pointer-events: none;
}
/* desenate de js/decor.js (canvas, culori pe loc, cel mult 24 de cadre pe secundă) */
.waves-canvas { display: block; width: 100%; height: 100%; }
[data-theme='neon'] .waves--chat, [data-theme='neon'] .waves--login { display: block; }
/* la conectare, față de ecran (nu se defilează odată cu formularul și nu lărgește pagina) */
.waves--login { position: fixed; left: 66%; opacity: 0.45; }
.waves--list { left: 60%; opacity: 0.4; }
.side-deco { display: none; position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.side > :not(.side-deco) { position: relative; z-index: 1; }
.side { isolation: isolate; }

/* ------------------------------------------------ bara de jos (telefon) */
.tabbar { display: none; }

@media (max-width: 900px) {
  .gate { gap: 24px; padding: 32px 16px; }
  .gate-logo { width: 220px; }
  .gate-card { padding: 28px 22px 26px; }
  .gate-title { font-size: 26px; }
  [data-theme='clean'] .gate { grid-template-columns: 1fr; grid-template-rows: auto 1fr; padding: 0; }
  [data-theme='clean'] .gate-stage { padding: 30px 24px; gap: 16px; }
  [data-theme='clean'] .gate-logo { width: min(220px, 70vw); }
  [data-theme='clean'] .gate-bar { display: none; }
  [data-theme='clean'] .gate-form { padding: 28px 24px 40px; overflow: visible; }
  [data-theme='clean'] .gate-form > .gate-card { margin-block: 0; }
}

@media (max-width: 760px) {
  [data-theme='clean'] .frame, .frame { grid-template-columns: 1fr; }
  [data-theme='clean'] .rail { display: none; }
  [data-theme='clean'] .side-admin { display: block; }
  [data-theme='clean'] .side-mark--dark { display: block; width: auto; height: 34px; }
  .side { border-right: 0; }
  [data-theme='neon'] .side-top { padding: 22px 20px 16px; border-bottom: 0; }
  [data-theme='neon'] .side-logo { width: 120px; }
  .side-search { margin: 12px 16px 4px; height: 48px; }
  .side-scroll { padding: 0 0 8px; }
  .side-section { margin-top: 12px; }
  .side-heading { padding: 6px 20px 6px; }
  .side-cta { margin: 6px 20px 0; }
  .navitem { min-height: 76px; gap: 14px; padding: 12px 20px; border-radius: 0; border-bottom: 1px solid var(--stage-line); font-size: 16.5px; }
  .navitem + .navitem { margin-top: 0; }
  .navitem.is-active { background: transparent; }
  .navitem-icon { width: 50px; height: 50px; border-radius: 14px; background: var(--stage-2); color: var(--stage-ink); }
  .navitem-icon .icon { width: 22px; height: 22px; }
  .navitem-icon--person { background: none; }
  .navitem-icon--person .avatar { width: 50px; height: 50px; font-size: 17px; }
  .navitem-name { font-weight: 500; }
  .navitem-preview { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; font-weight: 400; color: var(--stage-dim); }
  .navitem-side { flex-direction: column; align-items: flex-end; gap: 6px; }
  .navitem-time { display: block; font-size: 13.5px; font-weight: 400; color: var(--stage-dim); }
  [data-theme='neon'] .side-deco { display: block; }
  [data-theme='neon'] .waves--list { display: block; }
  [data-theme='neon'] .side-search { background: color-mix(in srgb, var(--stage-2) 88%, transparent); }
  .tabbar { display: flex; flex: none; border-top: 1px solid var(--stage-line); background: var(--stage); padding: 4px 0 calc(4px + env(safe-area-inset-bottom)); }
  .tab-item { flex: 1; display: grid; justify-items: center; align-content: center; gap: 3px; min-height: 56px; padding: 4px 0; border: 0; background: none; color: var(--stage-dim); font-size: 12.5px; font-weight: 500; }
  .tab-item.is-on { color: var(--stage-strong); font-weight: 600; }
  .side-admin { padding: 6px 8px; }
  .side-admin .navitem { min-height: 50px; padding: 6px 12px; border-bottom: 0; border-radius: var(--radius); font-size: 16px; }
  .side-admin .navitem-icon { width: 36px; height: 36px; border-radius: 10px; }
  .thread-head { padding: 8px 12px; }
  [data-theme='velvet'] .thread-brand { display: block; flex: none; width: auto; height: 38px; }
  .msg { grid-template-columns: 32px minmax(0, 1fr); column-gap: 10px; padding: 8px 14px 2px; }
  .msg--own { grid-template-columns: minmax(0, 1fr); }
  .msg .avatar--md { width: 32px; height: 32px; font-size: 12px; }
  .msg-text { max-width: 100%; }
  .msg--own .msg-body { padding-left: 48px; }
  .msg:not(.msg--own) .msg-body { padding-right: 36px; }
  .day, .msgs-more, .msgs-start, .msgs-empty, .typing { padding-left: 14px; padding-right: 14px; }
  .thread-foot { padding: 4px 10px 10px; }
  .composer-row { gap: 6px; }
}

/* ------------------------------------------------ actualizarea aplicației de calculator (bandă sus, cu progres) */
.update-banner {
  position: fixed;
  z-index: 90;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100vw - 32px);
  padding: 10px 18px 12px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-field);
  background: linear-gradient(90deg, color-mix(in srgb, var(--ctb) 22%, var(--raised)) var(--progress, 0%), var(--raised) var(--progress, 0%));
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow);
  pointer-events: none;
}

/* ================================================================== D – Aurora Glass (tema implicită de la 1.3.5)
 * Designul: Desktop\design studio chat\unique-studio-chat-varianta-D (README, design-tokens.json, screens/D-*.html).
 * Două panouri de sticlă (blur 24px) peste un fundal cu lumini aurora și valuri. Dialogurile și meniurile rămân
 * opace (--raised), ca textul să se citească oricum s-ar mișca luminile din spate.
 */
[data-theme='aurora'] {
  --paper: #08070b;
  --raised: #17151d;
  --sunken: rgba(255, 255, 255, 0.05);
  --field: rgba(255, 255, 255, 0.06);
  --card: rgba(18, 16, 24, 0.62);
  --ink: #f5f4f7;
  --ink-2: #d6d3dc;
  --ink-3: #b3afbd;
  --line: rgba(255, 255, 255, 0.10);
  --line-2: rgba(255, 255, 255, 0.16);

  --stage: rgba(18, 16, 24, 0.62);
  --stage-2: rgba(255, 255, 255, 0.06);
  --stage-3: rgba(255, 255, 255, 0.09);
  --stage-ink: #f5f4f7;
  --stage-strong: #ffffff;
  --stage-dim: #b3afbd;
  --stage-line: rgba(255, 255, 255, 0.10);

  --ctb: #f5f4f7;
  --ctb-strong: #dedbe4;
  --ctb-wash: rgba(255, 255, 255, 0.08);
  --on-ctb: #0a090d;
  --link: #f04be0;

  --bubble: rgba(255, 255, 255, 0.09);
  --on-bubble: #f5f4f7;
  --bubble-own: #f5f4f7;
  --on-bubble-own: #0a090d;

  --cto-lamp: #b39ddb;
  --on-cto: #0a090d;
  --cto-wash: rgba(157, 131, 202, 0.16);
  --cto-line: rgba(157, 131, 202, 0.40);
  --cto-ink: #e0d4f7;

  --tape: #e602d0;
  --on-tape: #0a090d;
  --go: #5ef2c4;
  --stop: #ff8097;
  --stop-wash: rgba(255, 128, 151, 0.14);
  --mark: #6b5410;
  --hover: rgba(255, 255, 255, 0.05);
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.55);
  --glass: rgba(18, 16, 24, 0.62);
  --glass-chat: rgba(14, 12, 20, 0.45);
  --glass-blur: blur(24px);
}

/* ------------------------------------------------ fundalul: lumini aurora + valuri (js/aurora.js) */
#app { z-index: 1; }
.aurora-bg { display: none; }
[data-theme='aurora'] .aurora-bg { display: block; position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; background: #08070b; }
.aurora-lights { position: absolute; inset: 0; }
/* luminile: gradienți radiali (în locul unui blur de 110 px, mult mai greu de desenat), aceleași culori și trasee */
.aurora-light { position: absolute; border-radius: 50%; will-change: transform; }
.aurora-light--1 { left: 18%; top: 25%; width: 740px; height: 740px; margin: -370px 0 0 -370px; background: radial-gradient(closest-side, rgba(230, 2, 208, 0.5), rgba(230, 2, 208, 0.42) 38%, rgba(230, 2, 208, 0.16) 68%, rgba(230, 2, 208, 0) 100%); }
.aurora-light--2 { left: 82%; top: 75%; width: 780px; height: 780px; margin: -390px 0 0 -390px; background: radial-gradient(closest-side, rgba(94, 242, 196, 0.36), rgba(94, 242, 196, 0.3) 38%, rgba(94, 242, 196, 0.11) 68%, rgba(94, 242, 196, 0) 100%); }
.aurora-light--3 { left: 60%; top: 20%; width: 620px; height: 620px; margin: -310px 0 0 -310px; background: radial-gradient(closest-side, rgba(157, 131, 202, 0.42), rgba(157, 131, 202, 0.34) 34%, rgba(157, 131, 202, 0.13) 64%, rgba(157, 131, 202, 0) 100%); }
.aurora-light--4 { left: 30%; top: 85%; width: 560px; height: 560px; margin: -280px 0 0 -280px; background: radial-gradient(closest-side, rgba(94, 242, 196, 0.3), rgba(94, 242, 196, 0.24) 32%, rgba(94, 242, 196, 0.09) 62%, rgba(94, 242, 196, 0) 100%); }

/* al doilea strat: aceleași lumini în nuanța mutată cu -35° (cât ar da hue-rotate(-35deg)); js/decor.js le topește
   încet una în alta (16 s), ca schimbarea de nuanță din design, doar prin opacitate */
.aurora-lights { will-change: opacity; }
.aurora-lights--shift { opacity: 0; }
.aurora-lights--shift .aurora-light--1 { background: radial-gradient(closest-side, rgba(118, 28, 255, 0.5), rgba(118, 28, 255, 0.42) 38%, rgba(118, 28, 255, 0.16) 68%, rgba(118, 28, 255, 0) 100%); }
.aurora-lights--shift .aurora-light--2 { background: radial-gradient(closest-side, rgba(121, 240, 133, 0.36), rgba(121, 240, 133, 0.3) 38%, rgba(121, 240, 133, 0.11) 68%, rgba(121, 240, 133, 0) 100%); }
.aurora-lights--shift .aurora-light--3 { background: radial-gradient(closest-side, rgba(120, 142, 200, 0.42), rgba(120, 142, 200, 0.34) 34%, rgba(120, 142, 200, 0.13) 64%, rgba(120, 142, 200, 0) 100%); }
.aurora-lights--shift .aurora-light--4 { background: radial-gradient(closest-side, rgba(121, 240, 133, 0.3), rgba(121, 240, 133, 0.24) 32%, rgba(121, 240, 133, 0.09) 62%, rgba(121, 240, 133, 0) 100%); }
[data-theme='aurora'] .waves--aurora { display: block; position: absolute; left: 58%; top: 52%; width: 1700px; margin: -120px 0 0 -850px; opacity: 0.35; }

/* ------------------------------------------------ cadrul: două panouri de sticlă cu 16 px între ele */
[data-theme='aurora'] .frame { padding: 16px; gap: 16px; grid-template-columns: 300px minmax(0, 1fr); }
[data-theme='aurora'] .side,
[data-theme='aurora'] .main {
  border: 1px solid var(--line);
  border-radius: 22px;
  overflow: hidden;
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
}
[data-theme='aurora'] .side { background: var(--glass); }
[data-theme='aurora'] .main { background: var(--glass-chat); }
[data-theme='aurora'] .side-top { justify-content: center; padding: 26px 20px 18px; border-bottom: 0; }
[data-theme='aurora'] .side-logo { display: block; width: 132px; height: auto; }
[data-theme='aurora'] .side-brand { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
[data-theme='aurora'] .side-search { height: 42px; margin: 0 16px 4px; border-radius: 10px; background: var(--field); }
[data-theme='aurora'] .side-heading { letter-spacing: 0.08em; }
[data-theme='aurora'] .navitem { border-radius: 10px; }
[data-theme='aurora'] .side-me, [data-theme='aurora'] .side-admin { border-top-color: var(--line); }
[data-theme='aurora'] .btn--quiet, [data-theme='aurora'] .btn--danger-quiet { background: var(--field); }
/* în zona principală: suprafețele vechi (antet, liste, tabele) devin sticlă ușoară, nu dreptunghiuri opace */
[data-theme='aurora'] .ov-head, [data-theme='aurora'] .ov-side, [data-theme='aurora'] .tile,
[data-theme='aurora'] .table-wrap, [data-theme='aurora'] .outside-step, [data-theme='aurora'] .address-text { background: rgba(255, 255, 255, 0.04); }
[data-theme='aurora'] .ov .ov-head { background: var(--cto-wash); }
[data-theme='aurora'] .thread-head { min-height: 68px; }
[data-theme='aurora'] .thread-title { font-size: 17px; }
[data-theme='aurora'] .msg-text { padding: 10px 14px; }
[data-theme='aurora'] .composer-input { background: var(--field); border-color: var(--line); }
[data-theme='aurora'] .composer-input:focus { border-color: rgba(255, 255, 255, 0.4); }
[data-theme='aurora'] .input:focus-visible { outline-color: rgba(255, 255, 255, 0.6); border-color: rgba(255, 255, 255, 0.4); }

/* ------------------------------------------------ conectare: card de sticlă centrat, cu logo-ul înăuntru */
[data-theme='aurora'] .gate { background: transparent; }
[data-theme='aurora'] .gate-logo { display: none; }
[data-theme='aurora'] .gate-card {
  width: min(440px, 100%);
  padding: 40px 36px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--glass);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
}
[data-theme='aurora'] .gate-form { width: min(440px, 100%); }
[data-theme='aurora'] .gate-card-logo { display: block; width: 190px; height: auto; margin: 0 auto 30px; }
[data-theme='aurora'] .gate-title { font-size: 26px; letter-spacing: 0.06em; }
[data-theme='aurora'] .gate-card .input { height: 48px; }
[data-theme='aurora'] .gate-card .btn--primary.btn--wide { min-height: 50px; font-size: 16px; }
.gate-card-logo { display: none; }

/* ------------------------------------------------ telefon: listă în panou de sticlă, meniu jos ca o pastilă plutitoare */
@media (max-width: 760px) {
  .aurora-light--1 { width: 444px; height: 444px; margin: -222px 0 0 -222px; }
  .aurora-light--2 { width: 468px; height: 468px; margin: -234px 0 0 -234px; }
  .aurora-light--3 { width: 372px; height: 372px; margin: -186px 0 0 -186px; }
  .aurora-light--4 { width: 336px; height: 336px; margin: -168px 0 0 -168px; }
  [data-theme='aurora'] .waves--aurora { transform: rotate(-58deg) scale(0.6); }
  [data-theme='aurora'] .frame { padding: 0; gap: 0; grid-template-columns: 1fr; }
  [data-theme='aurora'] .side { border: 0; border-radius: 0; background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; overflow: visible; }
  [data-theme='aurora'] .main { border: 0; border-radius: 0; }
  [data-theme='aurora'] .side-top { padding: 30px 20px 12px; }
  [data-theme='aurora'] .side-logo { width: 104px; }
  [data-theme='aurora'] .side-search { height: 46px; margin: 4px 20px 14px; background: var(--glass); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); }
  [data-theme='aurora'] .side-scroll {
    margin: 0 12px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: var(--glass);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
  }
  [data-theme='aurora'] .navitem { border-radius: 0; border-bottom-color: var(--line); }
  [data-theme='aurora'] .navitem-icon { border-radius: 14px; background: rgba(255, 255, 255, 0.09); }
  [data-theme='aurora'] .navitem-icon--person { background: none; }
  [data-theme='aurora'] .side-admin,
  [data-theme='aurora'] .side-me {
    margin: 10px 12px 0;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--glass);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
  }
  [data-theme='aurora'] .tabbar {
    margin: 12px 40px calc(14px + env(safe-area-inset-bottom));
    padding: 6px;
    gap: 6px;
    border: 1px solid var(--line);
    border-radius: 26px;
    background: var(--glass);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
  }
  [data-theme='aurora'] .tab-item { min-height: 52px; border-radius: 20px; }
  [data-theme='aurora'] .tab-item.is-on { background: rgba(255, 255, 255, 0.12); }
  [data-theme='aurora'] .tab-item > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  [data-theme='aurora'] .gate-card { padding: 30px 22px 26px; border-radius: 24px; }
  [data-theme='aurora'] .gate-card-logo { width: 150px; margin-bottom: 22px; }
}



/* textul ferestrei „A apărut o versiune nouă” primește focusul (nu butonul), fără chenar */
.dialog-text:focus { outline: none; }

/* ------------------------------------------ răspuns la un mesaj, funcția lângă nume, mesaj nou în altă conversație */

/* citatul de deasupra unui răspuns: apăsat, duce la mesajul citat */
.msg-quote {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-width: min(60ch, 100%);
  margin: 0 0 4px;
  padding: 6px 12px;
  border: 0;
  border-left: 3px solid var(--ctb);
  border-radius: 10px;
  background: var(--sunken);
  color: var(--ink-2);
  font: inherit;
  font-size: 13px;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
}
.msg-quote:hover { color: var(--ink); }
.msg-quote:disabled { cursor: default; color: var(--ink-3); }
.msg-quote-author { font-weight: 600; color: var(--ink); }
.msg-quote-text { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; white-space: pre-wrap; overflow-wrap: anywhere; }

/* mesajul la care duce un citat sclipește scurt */
.msg--flash { animation: msg-flash 1.6s ease-out; }
@keyframes msg-flash { from { background: color-mix(in srgb, var(--cto-lamp) 30%, transparent); } to { background: transparent; } }

/* pe telefon, mesajul se trage spre dreapta ca să răspunzi (butonul „Răspunde” e doar pentru mouse) */
.msg { touch-action: pan-y pinch-zoom; transition: transform 160ms ease-out; }
.msg.is-swiping { transition: none; }
@media (pointer: coarse) {
  .msg-tool-reply { display: none; }
}

/* bara „Răspunzi lui …” de deasupra zonei de scris */
.reply-bar { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; padding: 6px 6px 6px 12px; border-left: 3px solid var(--ctb); border-radius: var(--radius); background: var(--sunken); color: var(--ink-2); }
.reply-bar[hidden] { display: none; }
.reply-bar-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.reply-bar-title { font-size: 13px; font-weight: 600; color: var(--ink); }
.reply-bar-quote { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* funcția în studio, lângă nume; administratorul se deosebește puțin */
.tag--admin { border-color: color-mix(in srgb, var(--cto-lamp) 60%, transparent); }

/* fereastra mică pentru un mesaj nou în altă conversație (sus; pe telefon, la mijloc) */
.popups {
  position: fixed;
  z-index: 48;
  top: calc(var(--app-top, 0px) + env(safe-area-inset-top, 0px) + 12px);
  right: 16px;
  display: grid;
  gap: 8px;
  width: min(380px, calc(100vw - 32px));
  pointer-events: none;
}
.popup { display: flex; align-items: center; gap: 2px; border: 1px solid var(--line-2); border-radius: 14px; background: var(--raised); color: var(--ink); box-shadow: var(--shadow); pointer-events: auto; animation: popup-in 160ms ease-out; }
@keyframes popup-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.popup-open { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 10px 4px 10px 12px; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.popup-text { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.popup-title { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.popup-body { color: var(--ink-2); font-size: 14px; line-height: 1.35; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; }
.popup-close { flex: none; margin-right: 6px; }
@media (max-width: 760px) {
  .popups { left: 50%; right: auto; transform: translateX(-50%); }
}

/* ------------------------------------------------------------------ reacții și tag-uri */

/* reacțiile de sub un mesaj: emoji și câți le-au pus; a ta, evidențiată */
.reactions { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 0; }
.reactions[hidden] { display: none; }
.reaction { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 8px; border: 1px solid var(--line-2); border-radius: 13px; background: var(--raised); color: var(--ink); font: inherit; font-size: 13px; line-height: 1; cursor: pointer; }
.reaction:disabled { cursor: default; opacity: 1; }
.reaction.is-mine { border-color: var(--ctb); background: color-mix(in srgb, var(--ctb) 16%, var(--raised)); }
.reaction-emoji { font-size: 15px; }
.reaction-count { font-weight: 600; }
.reaction-big { flex: none; font-size: 22px; line-height: 1; }

/* fereastra mică de reacții (calculator) și meniul mesajului (telefon, apăsare lungă): mici, semitransparente,
   ca sticla mată (cerința proprietarului), lângă mesaj; restul conversației rămâne la vedere */
.react-pop, .msg-menu-react, .msg-menu-actions, .sticker-pop {
  border: 1px solid color-mix(in srgb, var(--ink) 14%, transparent);
  background: color-mix(in srgb, var(--raised) 56%, transparent);
  -webkit-backdrop-filter: blur(12px) saturate(150%);
  backdrop-filter: blur(12px) saturate(150%);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
}
.react-pop { position: fixed; z-index: 60; padding: 4px; border-radius: 22px; animation: fade-in 120ms ease-out; }
.react-quick { display: flex; align-items: center; gap: 2px; }
.react-quick .emoji { border-radius: 50%; }
.react-more { display: inline-grid; place-items: center; color: var(--ink-2); }
.react-more-grid { display: grid; grid-template-columns: repeat(8, 36px); gap: 2px; max-height: 200px; margin-top: 4px; overflow-y: auto; }
.react-more-grid[hidden] { display: none; }
.emoji.is-mine { background: color-mix(in srgb, var(--ctb) 22%, transparent); }

.msg-menu-layer { position: fixed; inset: 0; z-index: 52; }
.msg-menu { position: fixed; display: grid; justify-items: start; gap: 6px; max-width: calc(100vw - 16px); animation: msg-menu-in 130ms ease-out; }
.msg-menu--own { justify-items: end; }
@keyframes msg-menu-in { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: none; } }
.msg-menu-react { padding: 3px; border-radius: 24px; }
.msg-menu-react .emoji { width: 40px; height: 40px; font-size: 24px; }
.msg-menu-react .react-more-grid { grid-template-columns: repeat(7, 40px); max-height: 170px; }
.msg-menu-actions { display: grid; min-width: 180px; padding: 4px; border-radius: 14px; }
.msg-menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border: 0; border-radius: 10px; background: transparent; color: var(--ink); font: inherit; font-size: 15px; text-align: left; }
.msg-menu-item:active, .msg-menu-item:hover { background: var(--hover); }
.msg-menu-item--danger { color: var(--stop); }
/* mesajul apăsat rămâne evidențiat cât e deschis meniul */
.msg.is-pressed { background: color-mix(in srgb, var(--cto-lamp) 14%, transparent); }

/* ------------------------------------------------------------------ poza de profil și încadrarea pozelor */

.avatar { position: relative; overflow: hidden; }
.avatar-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.avatar--xl { width: 96px; height: 96px; font-size: 34px; }
.profile-photo { display: grid; justify-items: center; gap: 12px; text-align: center; }
.crop { display: grid; justify-items: center; gap: 12px; }
.crop-stage { position: relative; overflow: hidden; border-radius: 12px; background: var(--sunken); touch-action: none; }
.crop-canvas { display: block; touch-action: none; cursor: grab; }
.crop-canvas:active { cursor: grabbing; }
/* poza de profil: cercul care va rămâne, restul umbrit */
.crop-stage--round::after { content: ''; position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 999px rgba(8, 7, 11, 0.5); pointer-events: none; }
.crop-zoom { width: min(300px, 100%); accent-color: var(--ctb); }
.crop-hint { margin: 0; font-size: 13px; color: var(--ink-3); }

/* ------------------------------------------------------------------ sondaje */

.poll { display: grid; gap: 8px; width: min(380px, 100%); padding: 12px 14px; border-radius: 16px; background: var(--bubble); color: var(--on-bubble); }
.poll-head { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-3); }
.poll-question { margin: 0; font-size: 16px; font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
.poll-hint { margin: -4px 0 0; font-size: 13px; color: var(--ink-3); }
.poll-options { display: grid; gap: 6px; }
.poll-option { position: relative; display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 8px 12px; overflow: hidden; border: 1px solid var(--line-2); border-radius: 10px; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.poll-option:disabled { cursor: default; }
.poll-option.is-mine { border-color: var(--ctb); }
/* bara din spatele variantei: cât la sută dintre cei care au votat au ales-o */
.poll-bar { position: absolute; top: 0; bottom: 0; left: 0; background: color-mix(in srgb, var(--ctb) 16%, transparent); transition: width 200ms ease-out; pointer-events: none; }
.poll-check { position: relative; flex: none; display: inline-grid; place-items: center; width: 18px; height: 18px; border: 2px solid var(--line-2); border-radius: 50%; }
.poll-check--multi { border-radius: 4px; }
.poll-option.is-mine .poll-check { border-color: var(--ctb); background: var(--ctb); color: var(--paper); }
.poll-text { position: relative; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.poll-count { position: relative; flex: none; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.poll-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 13px; color: var(--ink-3); }
.poll-total { margin-right: auto; }
.poll-edit-options { display: grid; gap: 6px; margin-bottom: 6px; }
.poll-edit-option { display: flex; align-items: center; gap: 6px; }
.poll-edit-option .input { flex: 1; min-width: 0; }
.poll-votes { display: grid; gap: 14px; }
.poll-votes-title { display: flex; justify-content: space-between; gap: 10px; margin: 0 0 4px; font-size: 15px; }
.composer-poll { color: var(--ink-3); }

/* ------------------------------------------------------------------ stickere */

.msg-sticker { display: block; width: 150px; height: 150px; margin: 2px 0; object-fit: contain; }
@media (max-width: 760px) {
  .msg-sticker { width: 128px; height: 128px; }
}
.sticker-pop { position: fixed; z-index: 60; display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 8px; width: min(360px, calc(100vw - 16px)); max-height: min(380px, 60vh); padding: 10px; border-radius: 16px; animation: fade-in 120ms ease-out; }
.sticker-pop-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sticker-pop-title { font-weight: 700; }
.sticker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 6px; min-height: 80px; overflow-y: auto; }
.sticker-item { position: relative; }
.sticker-pick { display: block; width: 100%; aspect-ratio: 1; padding: 4px; border: 0; border-radius: 10px; background: transparent; cursor: pointer; }
.sticker-pick:hover { background: var(--hover); }
.sticker-pick img { display: block; width: 100%; height: 100%; object-fit: contain; }
.sticker-remove { position: absolute; top: 2px; right: 2px; display: none; place-items: center; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; background: rgba(8, 7, 11, 0.72); color: #fff; }
.sticker-item:hover .sticker-remove, .sticker-remove:focus-visible { display: grid; }
@media (pointer: coarse) {
  .sticker-remove { display: grid; }
}
.sticker-empty { grid-column: 1 / -1; margin: 8px 0; font-size: 14px; color: var(--ink-2); }
/* încadrarea unui sticker: carouri în spate, ca să se vadă unde rămâne transparent */
.crop-stage--clear { background-color: #ffffff; background-image: conic-gradient(#e4e4e4 25%, transparent 0 50%, #e4e4e4 0 75%, transparent 0); background-size: 16px 16px; }
.composer-sticker { color: var(--ink-3); }
@media (pointer: coarse) {
  /* pe telefon, reacțiile se pun din apăsarea lungă pe mesaj; textul nu se mai selectează la ea („Copiază textul”) */
  .msg-tool-react { display: none; }
  .msg-text { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
}

/* tag-urile din text (@Nume, @toți); cele care te privesc, evidențiate, și mesajul la fel */
.mention { font-weight: 600; color: var(--ctb); }
.msg--own .mention { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.mention--me { padding: 0 3px; border-radius: 4px; background: color-mix(in srgb, var(--cto-lamp) 30%, transparent); color: inherit; }
.msg--mentioned .msg-text { box-shadow: 0 0 0 2px color-mix(in srgb, var(--cto-lamp) 55%, transparent); }

/* lista „@” de deasupra zonei de scris */
.composer { position: relative; }
.mention-pop { position: absolute; z-index: 5; left: 0; right: 0; bottom: calc(100% + 6px); max-height: 260px; padding: 6px; overflow-y: auto; border: 1px solid var(--line-2); border-radius: 12px; background: var(--raised); box-shadow: var(--shadow); }
.mention-pop[hidden] { display: none; }
.mention-option { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 8px; border: 0; border-radius: var(--radius); background: transparent; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.mention-option.is-on, .mention-option:hover { background: var(--hover); }
.mention-all { border: 1px solid var(--line-2); background: var(--sunken); color: var(--ink); }
