* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0b0d12;
  --bg2: #12151d;
  --bg3: #1a1e28;
  --border: #262b38;
  --text: #e8eaf0;
  --muted: #8b93a7;
  --accent: #6d8dff;
  --accent2: #9d6dff;
  --user-bubble: linear-gradient(135deg, #3b5bdb, #7048e8);
}

/* ---------- tema deschisa ---------- */
[data-theme="light"] {
  --bg: #f2f4f8;
  --bg2: #ffffff;
  --bg3: #e9ecf2;
  --border: #d5dae4;
  --text: #1b1f27;
  --muted: #6b7280;
  --accent: #4a63d8;
  --accent2: #7c4de8;
}
[data-theme="light"] .field { background: rgba(0,0,0,.03); }
[data-theme="light"] .msg.devin .bubble { background: #fff; }
[data-theme="light"] .bubble pre { background: #f6f7fa; }
[data-theme="light"] .bubble code:not(pre code) { background: rgba(0,0,0,.07); }
[data-theme="light"] #auth-overlay {
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(74,99,216,.12), transparent 60%),
    radial-gradient(ellipse 60% 50% at 85% 90%, rgba(124,77,232,.10), transparent 60%),
    rgba(240,242,246,.85);
}
[data-theme="light"] .chat { background: linear-gradient(180deg, #f7f8fb, var(--bg)); }
[data-theme="light"] .settings-modal, [data-theme="light"] .picker { box-shadow: 0 20px 60px rgba(0,0,0,.18); }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100vh;
  overflow: hidden;
}

.layout { display: flex; height: 100vh; }

/* ---------- autentificare ---------- */
#auth-overlay {
  position: fixed; inset: 0; z-index: 300;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(109,141,255,.16), transparent 60%),
    radial-gradient(ellipse 60% 50% at 85% 90%, rgba(157,109,255,.14), transparent 60%),
    rgba(5,6,10,.78);
  backdrop-filter: blur(10px);
}
#auth-overlay.hidden { display: none; }
#auth-box {
  background: linear-gradient(160deg, rgba(26,30,40,.94), rgba(14,16,22,.97));
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 22px;
  padding: 36px 34px 28px; width: 380px; max-width: 92vw;
  box-shadow: 0 24px 80px rgba(0,0,0,.6), 0 0 60px rgba(109,141,255,.08) inset;
  animation: auth-in .35s cubic-bezier(.2,.9,.3,1.2);
}
@keyframes auth-in {
  from { opacity: 0; transform: translateY(18px) scale(.97); }
  to { opacity: 1; transform: none; }
}
.auth-logo { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.auth-logo-icon {
  font-size: 30px; width: 58px; height: 58px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 16px; color: #fff;
  box-shadow: 0 8px 24px rgba(109,141,255,.4);
}
.auth-logo-title { font-size: 21px; font-weight: 800; letter-spacing: -.3px; }
.auth-logo-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.auth-form { display: flex; flex-direction: column; gap: 12px; }
.field {
  position: relative; display: flex; align-items: center;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border); border-radius: 12px;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.field:focus-within {
  border-color: var(--accent); background: rgba(109,141,255,.06);
  box-shadow: 0 0 0 3px rgba(109,141,255,.18);
}
.field-icon {
  position: absolute; left: 14px; font-size: 15px; opacity: .65;
  pointer-events: none;
}
.field input {
  width: 100%; background: none; border: none; outline: none;
  color: var(--text); font-size: 15px; padding: 13px 14px 13px 42px;
}
.field input::placeholder { color: var(--muted); opacity: .8; }
.field-eye {
  position: absolute; right: 10px; background: none; border: none;
  color: var(--muted); font-size: 15px; cursor: pointer; padding: 4px;
}
.field-eye:hover { color: var(--text); }
.field input.has-eye { padding-right: 42px; }
.pw-match { font-size: 12px; text-align: center; min-height: 16px; margin-top: 6px; color: var(--muted); }
.pw-match.ok { color: #4ade80; }
.pw-match.bad { color: #f87171; }
.gh-status { font-size: 13px; color: var(--muted); }
.gh-status.ok { color: #4ade80; }
.gh-hint { font-size: 11px; color: var(--muted); margin-top: 8px; line-height: 1.5; }
.auth-submit {
  background: linear-gradient(135deg, var(--accent), var(--accent2)); border: none;
  border-radius: 12px; color: #fff; padding: 14px;
  font-size: 15px; font-weight: 700; letter-spacing: .2px; cursor: pointer;
  margin-top: 4px;
  box-shadow: 0 8px 24px rgba(109,141,255,.35);
  transition: transform .12s, filter .15s;
}
.auth-submit:hover { filter: brightness(1.12); transform: translateY(-1px); }
.auth-submit:active { transform: translateY(0); }
#auth-msg { margin-top: 16px; text-align: center; font-size: 13px; min-height: 18px; font-weight: 500; color: var(--muted); }
#auth-msg.err { color: #f87171; }
#auth-form.hidden, #reg-box.hidden, .auth-switch a.hidden { display: none; }
.auth-switch { margin-top: 14px; text-align: center; font-size: 13px; }
.auth-switch a { color: var(--accent, #6ea8fe); text-decoration: none; }
.auth-switch a:hover { text-decoration: underline; }
.logout-btn { margin-top: 18px; background: var(--bg3); box-shadow: none; }
.logout-btn:hover { filter: none; background: #262b38; }

/* ---------- sidebar ---------- */
.sidebar {
  width: 260px;
  min-width: 260px;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.brand {
  display: flex; align-items: center; gap: 6px;
  padding: 18px 16px 12px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: .3px;
}
.brand .logo { color: var(--accent); margin-right: 6px; }

.node-select {
  margin: 4px 12px 6px;
  width: calc(100% - 24px);
  background: var(--bg3); color: var(--text);
  border: 1px solid var(--border); border-radius: 9px;
  padding: 8px 10px; font-size: 13px;
}

.new-session {
  margin: 4px 12px 10px;
  padding: 9px;
  border-radius: 10px;
  border: 1px dashed var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  transition: all .15s;
}
.new-session:hover { border-color: var(--accent); color: var(--accent); }

.session-list { flex: 1; overflow-y: auto; padding: 0 8px; }

.session-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 10px;
  border-radius: 9px;
  cursor: pointer;
  font-size: 14px;
  color: var(--muted);
  transition: background .12s;
}
.session-item:hover { background: var(--bg3); }
.session-item.active { background: var(--bg3); color: var(--text); }

.session-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.session-actions { display: none; gap: 2px; }
.session-item:hover .session-actions { display: flex; }

.s-btn {
  background: none; border: none; color: var(--muted);
  cursor: pointer; font-size: 12px; padding: 2px 5px; border-radius: 5px;
}
.s-btn:hover { color: var(--text); background: rgba(255,255,255,.06); }
.s-btn.del:hover { color: #ff6b6b; }

.rename-input {
  flex: 1; background: var(--bg); border: 1px solid var(--accent);
  border-radius: 6px; color: var(--text); padding: 3px 6px; font-size: 13px;
  outline: none;
}

.sidebar-footer {
  padding: 12px 16px; font-size: 11px; color: var(--muted);
  border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.sidebar-footer .icon-btn { font-size: 13px; padding: 4px 6px; }

.side-section { padding: 4px 8px 10px; }
.side-section.grow { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.side-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: .8px;
  color: var(--muted); padding: 10px 8px 4px;
  display: flex; align-items: center; justify-content: space-between;
}
.proj-toggle { font-size: 11px; padding: 0 4px; opacity: .6; }
.proj-toggle:hover { opacity: 1; }
.item-list { overflow-y: auto; padding: 0 4px; }
/* proiectele au max 35% din sidebar — restul ramane pentru sesiuni */
#projectList { max-height: 35vh; }
/* sesiunile ocup ocupa tot spatiul ramas si scroll-uiesc in interior */
.side-section.grow .item-list { flex: 1; min-height: 0; }

.item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: 9px; cursor: pointer;
  font-size: 14px; color: var(--muted); transition: background .12s;
}
.item:hover { background: var(--bg3); }
.item.active { background: var(--bg3); color: var(--text); }
.item-icon { font-size: 13px; flex-shrink: 0; }
.item-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-actions { display: none; gap: 2px; }
.item:hover .item-actions { display: flex; }

.group-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .4px; color: #5a6172;
  padding: 12px 10px 4px;
}
.group-label:first-child { padding-top: 6px; }

.empty-hint { font-size: 12px; color: #5a6172; padding: 10px; font-style: italic; }

.rename-input {
  flex: 1; background: var(--bg); border: 1px solid var(--accent);
  border-radius: 6px; color: var(--text); padding: 3px 6px; font-size: 13px;
  outline: none;
}
.new-session.scan { font-size: 13px; }

/* ---------- main ---------- */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.chat-area { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.chat { min-height: 0; }

/* ---------- files panel ---------- */
.files-panel {
  width: 300px; min-width: 300px;
  background: var(--bg2); border-left: 1px solid var(--border);
  display: flex; flex-direction: column;
}
.files-panel.hidden { display: none; }

.files-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-bottom: 1px solid var(--border);
}
.files-title { font-weight: 600; font-size: 14px; }

.fs-breadcrumb {
  padding: 8px 14px; font-size: 12px; color: var(--muted);
  border-bottom: 1px solid var(--border);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.fs-toolbar {
  display: flex; gap: 6px; padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.fs-btn {
  flex: 1; padding: 6px 4px; font-size: 12px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--bg3);
  color: var(--muted); cursor: pointer; transition: all .12s;
}
.fs-btn:hover { color: var(--text); border-color: var(--accent); }

.fs-list { flex: 1; overflow-y: auto; padding: 6px; }

.fs-entry {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 9px; border-radius: 8px; cursor: pointer;
  font-size: 13px; color: var(--muted); transition: background .12s;
}
.fs-entry:hover { background: var(--bg3); }
.fs-icon { font-size: 13px; flex-shrink: 0; width: 18px; text-align: center; }
.fs-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fs-size { font-size: 11px; color: #5a6172; flex-shrink: 0; }
.fs-actions { display: none; gap: 2px; }
.fs-entry:hover .fs-actions { display: flex; }

.chat-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; border-bottom: 1px solid var(--border); background: var(--bg2);
}
.header-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.chat-title-wrap { display: flex; align-items: center; gap: 8px; min-width: 0; }
.chat-title { font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.proj-badge {
  font-size: 12px; font-weight: 600; color: var(--accent);
  background: rgba(109,141,255,.12); border: 1px solid rgba(109,141,255,.3);
  padding: 4px 10px; border-radius: 20px; white-space: nowrap;
  max-width: 180px; overflow: hidden; text-overflow: ellipsis;
}

.icon-btn {
  background: none; border: none; color: var(--muted); cursor: pointer;
  font-size: 15px; padding: 5px 8px; border-radius: 7px; transition: all .12s;
}
.icon-btn:hover { color: var(--text); background: var(--bg3); }
.icon-btn.active { color: var(--accent); background: var(--bg3); }
#clearBtn:hover { color: #ff6b6b; }

.chat {
  flex: 1; overflow-y: auto; padding: 24px 20px;
  display: flex; flex-direction: column; gap: 16px;
  background:
    radial-gradient(ellipse at top, rgba(109,141,255,.04), transparent 50%),
    var(--bg);
}

.msg { display: flex; flex-direction: column; max-width: 78%; }
.msg.user { align-self: flex-end; align-items: flex-end; }
.msg.devin { align-self: flex-start; }

.bubble {
  padding: 11px 15px; border-radius: 16px; line-height: 1.55;
  font-size: 15px; word-break: break-word;
}
.msg.user .bubble {
  background: var(--user-bubble); color: #fff;
  border-bottom-right-radius: 5px;
  box-shadow: 0 4px 14px rgba(109,141,255,.18);
}
.msg.devin .bubble {
  background: var(--bg3); border: 1px solid var(--border);
  border-bottom-left-radius: 5px;
}
.bubble.streaming::after {
  content: '▍'; color: var(--accent); animation: blink 1s infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.bubble pre {
  background: #0d1017; border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 12px; overflow-x: auto; margin: 8px 0; font-size: 13px;
}
.bubble code {
  font-family: 'Cascadia Code', Consolas, monospace; font-size: .9em;
}
.bubble p { margin: 6px 0; }
.bubble pre code { background: none; padding: 0; }
.bubble code:not(pre code) {
  background: rgba(255,255,255,.08); padding: 1px 6px; border-radius: 5px;
}

.time { font-size: 11px; color: var(--muted); margin-top: 4px; padding: 0 4px; }
.msg.user .time { text-align: right; }

/* ---------- actiuni pe mesaje ---------- */
.msg-actions {
  display: flex; gap: 4px; margin-top: 3px; opacity: 0; transition: opacity .15s;
}
.msg:hover .msg-actions, .msg-actions.always { opacity: 1; }
.msg-action {
  background: none; border: none; color: var(--muted); font-size: 12px;
  cursor: pointer; padding: 2px 6px; border-radius: 6px;
}
.msg-action:hover { background: var(--bg3); color: var(--text); }

/* buton copiere in blocuri de cod */
.code-wrap { position: relative; }
.code-copy {
  position: absolute; top: 6px; right: 6px;
  background: var(--bg3); border: 1px solid var(--border); color: var(--muted);
  font-size: 11px; padding: 3px 8px; border-radius: 6px; cursor: pointer;
}
.code-copy:hover { color: var(--text); }

/* indicator typing */
.typing-dots { display: inline-flex; gap: 5px; padding: 4px 2px; }
.typing-dots i {
  width: 7px; height: 7px; border-radius: 50%; background: var(--muted);
  animation: tblink 1.2s infinite;
}
.typing-dots i:nth-child(2) { animation-delay: .18s; }
.typing-dots i:nth-child(3) { animation-delay: .36s; }
@keyframes tblink { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

/* stea pin pe sesiuni */
.s-btn.pin { color: var(--muted); }
.s-btn.pin.on { color: #fbbf24; }

/* miniatura imagine in mesaje */
.msg-img {
  max-width: 260px; max-height: 200px; border-radius: 10px; margin-top: 6px;
  display: block; cursor: pointer; border: 1px solid var(--border);
}
.msg-img:hover { opacity: .9; }

/* previzualizare atasamente inainte de trimitere */
.attach-preview {
  display: flex; gap: 8px; padding: 8px 12px 0; flex-wrap: wrap;
}
.attach-thumb { position: relative; }
.attach-thumb img {
  width: 56px; height: 56px; object-fit: cover; border-radius: 8px;
  border: 1px solid var(--border); display: block;
}
.attach-thumb button {
  position: absolute; top: -6px; right: -6px; width: 18px; height: 18px;
  border-radius: 50%; border: none; background: #e5484d; color: #fff;
  font-size: 11px; line-height: 1; cursor: pointer;
}

/* bara de actiuni in zona inputului */
.composer-side { display: flex; flex-direction: column; gap: 6px; }
.composer-side .icon-btn { font-size: 17px; }

/* overlay de cautare in mesaje */
.search-overlay {
  position: fixed; inset: 0; z-index: 250; display: flex;
  align-items: flex-start; justify-content: center; padding-top: 12vh;
  background: rgba(0,0,0,.5); backdrop-filter: blur(4px);
}
.search-overlay.hidden { display: none; }
.search-box {
  width: 520px; max-width: 92vw; background: var(--bg2);
  border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,.5); overflow: hidden;
}
.search-input {
  width: 100%; padding: 14px 16px; background: none; border: none; outline: none;
  color: var(--text); font-size: 15px; border-bottom: 1px solid var(--border);
}
.search-results { max-height: 50vh; overflow-y: auto; }
.search-hit {
  padding: 10px 16px; cursor: pointer; border-bottom: 1px solid var(--border);
}
.search-hit:hover { background: var(--bg3); }
.search-hit .sh-role { font-size: 11px; color: var(--muted); text-transform: uppercase; }
.search-hit .sh-text { font-size: 13px; margin-top: 2px; }
.search-hit mark { background: rgba(251,191,36,.3); color: inherit; border-radius: 3px; padding: 0 2px; }
.search-empty { padding: 20px; text-align: center; color: var(--muted); font-size: 13px; }

/* ---------- composer ---------- */
.composer {
  display: flex; gap: 10px; align-items: flex-end;
  padding: 14px 20px 18px;
  background: var(--bg2); border-top: 1px solid var(--border);
}

#input {
  flex: 1; resize: none;
  background: var(--bg3); border: 1px solid var(--border); border-radius: 12px;
  color: var(--text); padding: 12px 14px; font-size: 15px;
  font-family: inherit; line-height: 1.4; max-height: 160px;
  transition: border-color .15s;
}
#input:focus { outline: none; border-color: var(--accent); }
#input::placeholder { color: #5a6172; }

#send {
  width: 44px; height: 44px; border-radius: 12px; border: none;
  background: linear-gradient(135deg, #3b5bdb, #7048e8);
  color: #fff; font-size: 17px; cursor: pointer;
  transition: transform .12s, opacity .12s;
}
#send:hover { transform: translateY(-1px); }
#send:disabled { opacity: .45; cursor: default; transform: none; }
#send.stop {
  background: linear-gradient(135deg, #e03131, #c2255c);
  font-size: 15px;
}

#micBtn {
  width: 44px; height: 44px; border-radius: 12px; border: none;
  background: #1f232e; color: #c8cdd8; font-size: 18px; cursor: pointer;
  transition: transform .12s, background .15s;
  flex-shrink: 0;
}
#micBtn:hover { transform: translateY(-1px); background: #262b38; }
#micBtn:disabled { opacity: .45; cursor: default; transform: none; }
#micBtn.recording {
  background: linear-gradient(135deg, #e03131, #c2255c);
  color: #fff;
  animation: micPulse 1s ease-in-out infinite;
}
@keyframes micPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(224, 49, 49, .5); }
  50% { box-shadow: 0 0 0 8px rgba(224, 49, 49, 0); }
}

.icon-btn.active { color: var(--accent); }
.icon-btn.speaking { animation: ttsBlink 1s ease-in-out infinite; }
@keyframes ttsBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: .45; }
}

/* ---------- folder picker modal ---------- */
.picker-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.6);
  display: flex; align-items: center; justify-content: center; z-index: 100;
}
.picker-overlay.hidden { display: none; }

.picker {
  width: 480px; max-width: 92vw; max-height: 80vh;
  background: var(--bg2); border: 1px solid var(--border); border-radius: 14px;
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
}

.picker-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; font-weight: 600; border-bottom: 1px solid var(--border);
}

.picker-path {
  padding: 8px 16px; font-size: 12px; color: var(--accent);
  font-family: Consolas, monospace;
  border-bottom: 1px solid var(--border);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.picker-list { flex: 1; overflow-y: auto; padding: 8px; min-height: 200px; }

.picker-entry {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 8px; cursor: pointer;
  font-size: 14px; color: var(--muted); transition: background .12s;
}
.picker-entry:hover { background: var(--bg3); color: var(--text); }

.picker-foot {
  display: flex; gap: 8px; align-items: center;
  padding: 12px 16px; border-top: 1px solid var(--border);
}
.picker-spacer { flex: 1; }
.fs-btn.primary {
  background: linear-gradient(135deg, #3b5bdb, #7048e8);
  color: #fff; border: none; font-weight: 600;
}
.fs-btn.primary:disabled { opacity: .45; cursor: default; }
.fs-btn:disabled { opacity: .45; cursor: default; }


/* settings modal — alegere voce TTS */
.settings-modal { width: 400px; }
.settings-body { padding: 14px 16px; flex: 1; min-height: 0; overflow-y: auto; }
.settings-label { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.voice-list { display: flex; flex-direction: column; gap: 6px; max-height: 50vh; overflow-y: auto; }
.voice-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--border); background: var(--bg);
  font-size: 14px; transition: border-color .12s, background .12s;
}
.voice-item:hover { border-color: var(--accent); }
.voice-item.selected { border-color: var(--accent); background: var(--bg3); }
.voice-name { flex: 1; }
.voice-loading { color: var(--muted); font-size: 13px; padding: 12px; text-align: center; }

/* scrollbars */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #333a4a; }

/* ================= MOBILE / TABLET ================= */
.hamburger { display: none; }
.sidebar-close { display: none; margin-left: auto; }

@media (max-width: 860px) {
  .hamburger { display: inline-block; font-size: 18px; }
  .sidebar-close { display: inline-block; }

  /* sidebar devine drawer */
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 90;
    width: 280px; transform: translateX(-105%);
    transition: transform .22s ease;
    box-shadow: 4px 0 24px rgba(0,0,0,.5);
  }
  body.sidebar-open .sidebar { transform: translateX(0); }
  body.sidebar-open::after {
    content: ''; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 80;
  }

  /* explorerul de fisiere = fullscreen overlay */
  .files-panel {
    position: fixed; top: 0; right: 0; bottom: 0; z-index: 85;
    width: 100vw; min-width: 0; border-left: none;
  }

  .chat-header { padding: 10px 12px; gap: 8px; }
  .proj-badge { max-width: 110px; font-size: 11px; padding: 3px 8px; }
  .chat-title { font-size: 14px; }

  .chat { padding: 14px 12px; gap: 12px; }
  .msg { max-width: 88%; }
  .bubble { font-size: 16px; padding: 10px 13px; } /* 16px = fara zoom automat pe iOS/Android */

  .composer { padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); gap: 8px; }
  #input { font-size: 16px; padding: 11px 13px; }
  #send { width: 46px; height: 46px; flex-shrink: 0; }

  .picker { width: 96vw; }
  .brand { font-size: 16px; padding: 14px 14px 10px; }
}

/* ecrane foarte mici (5", sub ~400px latime CSS) */
@media (max-width: 480px) {
  .sidebar { width: 86vw; }
  .chat { padding: 10px 8px; gap: 10px; }
  .msg { max-width: 92%; }
  .bubble { font-size: 15px; padding: 9px 12px; }
  .chat-header { padding: 8px 8px; }
  .chat-title { font-size: 13px; }
  .proj-badge { display: none; }
  .icon-btn { padding: 6px 7px; font-size: 16px; }
  .composer { padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); }
  .brand { font-size: 15px; padding: 12px 12px 8px; }
  .new-session { font-size: 13px; padding: 8px; }
  .picker { width: 97vw; max-height: 88vh; }
  .picker-list { min-height: 150px; }
  .time { font-size: 10px; }
}

/* evidentiere la navigarea din cautare */
.msg.flash .bubble { outline: 2px solid var(--accent); outline-offset: 2px; transition: outline-color .3s; }

/* atasament fisier (pdf etc.) in previzualizare */
.attach-file {
  width: 56px; height: 56px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--bg3); display: flex; flex-direction: column; align-items: center;
  justify-content: center; font-size: 20px; position: relative;
}
.attach-file span {
  font-size: 8px; color: var(--muted); max-width: 52px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
