/* ==================================================================
   EROTS AI — Interface pública (erots.essentialstore.cv)
   Usa os tokens de erots.css.
   ================================================================== */

:root { --side-w: 300px; --side-w-mini: 84px; --top-h: 96px; }

/* ---------- Entrada ---------- */
#login { min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card { width: 100%; max-width: 420px; padding: 40px 32px 28px; text-align: center; }
.login-logo { width: 96px; height: 96px; filter: drop-shadow(0 0 18px rgba(0, 212, 255, 0.5)) drop-shadow(0 0 34px rgba(139, 92, 246, 0.35)); }
.login-card .brand-name { font-size: 38px; margin: 18px 0 8px; }
.login-sub { color: var(--text-2); margin: 0 0 18px; }
.chip { display: inline-block; font-size: 12px; font-weight: 600; padding: 5px 12px; border-radius: var(--r-pill); color: var(--cyan); border: 1px solid rgba(0, 212, 255, 0.4); margin-bottom: 22px; }
#googleButton { display: flex; justify-content: center; min-height: 44px; }
#loginError { color: #fca5a5; font-size: 14px; min-height: 20px; margin-top: 14px; }
.login-foot { font-size: 12px; color: var(--text-2); margin-top: 18px; }

/* ---------- Estrutura ---------- */
#app {
  height: 100dvh; display: grid;
  grid-template-columns: var(--side-w) 1fr;
  grid-template-rows: var(--top-h) 1fr;
  grid-template-areas: "top top" "side main";
}
#app.collapsed { grid-template-columns: var(--side-w-mini) 1fr; }

/* ---------- Barra superior ---------- */
#topbar {
  grid-area: top; display: flex; align-items: center; gap: 24px; padding: 0 28px 0 24px;
  border-bottom: 1px solid var(--line); background: rgba(5, 8, 23, 0.55);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); position: relative; z-index: 20;
}
.brand { width: calc(var(--side-w) - 24px); flex-shrink: 0; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-sub { white-space: nowrap; }

.top-search {
  flex: 1; max-width: 620px; margin: 0 auto; position: relative; display: flex; align-items: center; gap: 12px;
  height: 52px; padding: 0 20px; border-radius: var(--r-pill); background: rgba(16, 22, 36, 0.7);
  border: 1px solid var(--line-strong); color: var(--text-2);
}
.top-search:focus-within { border-color: rgba(0, 212, 255, 0.5); box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.12); }
.top-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 15px; color: var(--text); }
.top-search input::placeholder { color: var(--text-2); }
.top-search input::-webkit-search-cancel-button { display: none; }
.search-results {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; padding: 6px; max-height: 360px; overflow-y: auto;
  background: var(--glass-strong); border: 1px solid var(--line-strong); border-radius: var(--r-md);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5); backdrop-filter: blur(14px);
}
.search-results button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; background: transparent; border-radius: var(--r-sm); cursor: pointer; text-align: left; font-size: 14px; color: var(--text); }
.search-results button:hover, .search-results button.sel { background: rgba(0, 212, 255, 0.1); }
.search-results button .ico { width: 18px; height: 18px; color: var(--text-2); }
.search-results .hint { color: var(--cyan); }
.search-results span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.top-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.avatar-btn {
  width: 46px; height: 46px; border-radius: 50%; cursor: pointer; margin-left: 8px; display: grid; place-items: center;
  border: 1.5px solid rgba(0, 212, 255, 0.55); background: rgba(16, 22, 36, 0.8); color: var(--text);
  font-weight: 600; font-size: 17px; box-shadow: 0 0 14px rgba(0, 212, 255, 0.2);
}
.avatar-btn:hover { box-shadow: 0 0 18px rgba(0, 212, 255, 0.45); }
.mobile-only { display: none !important; }

/* ---------- Barra lateral ---------- */
#sidebar {
  grid-area: side; margin: 18px 0 18px 18px; padding: 18px 14px 14px; display: flex; flex-direction: column;
  min-height: 0; position: relative; z-index: 15; border-radius: var(--r-lg);
}
.collapse-btn {
  position: absolute; top: 14px; right: -15px; width: 30px; height: 30px; border-radius: 50%; cursor: pointer;
  border: 1px solid var(--line-strong); background: var(--panel); color: var(--text-2); display: grid; place-items: center; z-index: 2;
}
.collapse-btn .ico { width: 16px; height: 16px; }
.collapse-btn:hover { color: var(--cyan); }

.nav { display: flex; flex-direction: column; gap: 0; margin-top: 18px; }
.nav-item + .nav-item { box-shadow: 0 -1px 0 var(--line); }
.nav-item:hover + .nav-item, .nav-item.active + .nav-item { box-shadow: none; }
.nav-item {
  display: flex; align-items: center; gap: 16px; padding: 14px 12px 14px 14px; border-radius: var(--r-sm); border: 0;
  background: transparent; color: var(--text); cursor: pointer; font-size: 17px; text-align: left; width: 100%;
  transition: background 0.15s, color 0.15s;
}
.nav-item:hover { background: rgba(148, 163, 184, 0.08); }
.nav-item.active { background: rgba(0, 212, 255, 0.1); color: var(--cyan); }
.nav-item.soon { color: rgba(241, 245, 249, 0.55); }
.nav-item.soon .ico { opacity: 0.6; }

.history { flex: 1; min-height: 0; display: flex; flex-direction: column; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.history.closed #convList, .history.closed .history-title { display: none; }
.history-title { font-size: 11px; font-weight: 600; letter-spacing: 0.8px; text-transform: uppercase; color: var(--text-2); padding: 4px 14px 8px; }
#convList { flex: 1; overflow-y: auto; min-height: 0; scrollbar-width: thin; scrollbar-color: rgba(148, 163, 184, 0.25) transparent; }
.side-search { display: flex; align-items: center; gap: 8px; margin: 0 4px 10px; padding: 0 12px; height: 40px; border-radius: var(--r-sm); background: rgba(5, 8, 23, 0.6); border: 1px solid var(--line-strong); color: var(--text-2); }
.side-search .ico { width: 18px; height: 18px; }
.side-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 14px; }
.conv {
  display: flex; align-items: center; gap: 6px; padding: 9px 8px 9px 14px; border-radius: var(--r-sm); cursor: pointer;
  font-size: 14px; color: rgba(241, 245, 249, 0.82);
}
.conv span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv:hover { background: rgba(148, 163, 184, 0.07); }
.conv.active { background: rgba(37, 99, 235, 0.16); color: var(--text); box-shadow: inset 2px 0 0 var(--cyan); }
.conv .icon-btn { width: 30px; height: 30px; opacity: 0; color: var(--text-2); }
.conv .icon-btn .ico { width: 16px; height: 16px; }
.conv:hover .icon-btn, .conv.active .icon-btn { opacity: 1; }
.conv .icon-btn:hover { color: var(--err); }
.side-empty { font-size: 13px; color: var(--text-2); padding: 6px 14px; }

.side-foot { display: flex; align-items: center; gap: 14px; padding: 12px 14px; margin-top: 10px; border-radius: var(--r-md);
  background: rgba(11, 22, 51, 0.55); border: 1px solid var(--line); }
.foot-logo { width: 46px; height: 46px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid rgba(0, 212, 255, 0.7); box-shadow: 0 0 14px rgba(0, 212, 255, 0.35); }
.foot-logo img { width: 24px; height: 24px; }
.foot-text { display: flex; flex-direction: column; gap: 2px; }
.version { font-family: var(--font-brand); font-size: 17px; font-weight: 700; color: var(--text); }
.version em { font-style: normal; color: var(--cyan); }

/* Barra recolhida (só ícones) */
#app.collapsed #sidebar { padding: 18px 10px 14px; }
#app.collapsed #sidebar .label, #app.collapsed .history { display: none; }
#app.collapsed .btn-primary { justify-content: center; padding: 13px 0; }
#app.collapsed .nav-item { justify-content: center; padding: 12px 0; }
#app.collapsed .side-foot { justify-content: center; margin-top: auto; padding: 10px 0; background: none; border: 0; }

#scrim { display: none; }

/* ---------- Área principal ---------- */
#main { grid-area: main; display: flex; flex-direction: column; min-height: 0; min-width: 0; position: relative; }

.home {
  flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; align-items: center;
  padding: 8px 32px 12px; text-align: center;
}
.home::before, .home::after { content: ""; flex: 1 1 0; min-height: 0; }
.home::after { flex-grow: 1.4; }
.hero { position: relative; width: 100%; height: clamp(190px, 29vh, 350px); flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.waves { position: absolute; left: 50%; top: 58%; width: max(140%, 1300px); height: auto; transform: translate(-50%, -50%); opacity: 1; pointer-events: none;
  -webkit-mask-image: radial-gradient(ellipse 52% 62% at 50% 50%, #000 45%, transparent 100%); mask-image: radial-gradient(ellipse 52% 62% at 50% 50%, #000 45%, transparent 100%); }
.orbit { position: relative; width: clamp(160px, 25vh, 270px); aspect-ratio: 1; display: grid; place-items: center; perspective: 900px; }
.hero-logo { width: 66%; position: relative; z-index: 3; animation: float 6s ease-in-out infinite;
  filter: drop-shadow(0 0 22px rgba(0, 212, 255, 0.7)) drop-shadow(0 0 60px rgba(139, 92, 246, 0.55)); }
.halo { position: absolute; inset: -10%; border-radius: 50%; background: radial-gradient(circle, rgba(37, 99, 235, 0.55), rgba(139, 92, 246, 0.25) 45%, transparent 70%); filter: blur(8px); z-index: 1; }
.ring, .ring-front {
  position: absolute; left: 50%; top: 50%; border-radius: 50%; transform-style: preserve-3d;
  border: 2px solid transparent; pointer-events: none;
}
.ring.r1, .ring-front.r1 { width: 190%; height: 190%; margin: -95% 0 0 -95%; transform: rotateX(76deg); }
.ring.r1 { border-color: rgba(0, 212, 255, 0.85) rgba(139, 92, 246, 0.8) rgba(37, 99, 235, 0.3) rgba(168, 85, 247, 0.7); box-shadow: 0 0 26px rgba(139, 92, 246, 0.5), inset 0 0 20px rgba(0, 212, 255, 0.25); z-index: 2; animation: spin1 14s linear infinite; }
.ring-front.r1 { border-color: transparent transparent rgba(0, 240, 255, 0.95) transparent; z-index: 4; animation: spin1 14s linear infinite; filter: drop-shadow(0 0 8px rgba(0, 240, 255, 0.9)); }
.ring.r2 { width: 250%; height: 250%; margin: -125% 0 0 -125%; transform: rotateX(78deg) rotateY(-6deg); border-color: rgba(168, 85, 247, 0.6) transparent rgba(0, 212, 255, 0.3) transparent; box-shadow: 0 0 30px rgba(168, 85, 247, 0.25); z-index: 1; animation: spin2 22s linear infinite; }
.ring.r3 { width: 145%; height: 145%; margin: -72.5% 0 0 -72.5%; transform: rotateX(72deg) rotateY(10deg); border-color: transparent rgba(0, 212, 255, 0.45) transparent rgba(217, 70, 239, 0.5); z-index: 1; animation: spin3 18s linear infinite reverse; }
@keyframes spin1 { to { transform: rotateX(76deg) rotateZ(360deg); } }
@keyframes spin2 { to { transform: rotateX(78deg) rotateY(-6deg) rotateZ(360deg); } }
@keyframes spin3 { to { transform: rotateX(72deg) rotateY(10deg) rotateZ(360deg); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

.hero-title { position: relative; z-index: 2; font-family: var(--font-brand); font-weight: 700; font-size: clamp(52px, 8.2vh, 92px); letter-spacing: 1px; margin: clamp(-34px, -3vh, -14px) 0 0; line-height: 1;
  text-shadow: 0 0 30px rgba(37, 99, 235, 0.45), 0 2px 0 rgba(0, 0, 0, 0.3); }
.hero-title .ai { color: var(--cyan); text-shadow: 0 0 28px rgba(0, 212, 255, 0.6); }
.hero-q { font-family: var(--font-brand); font-size: clamp(22px, 3.4vh, 38px); margin: 6px 0 14px; font-weight: 600; }
.slogan { display: flex; align-items: center; gap: 22px; color: var(--text); font-size: clamp(16px, 2.3vh, 24px); font-weight: 500; }
.slogan .line { width: clamp(70px, 9vw, 130px); height: 2px; background: linear-gradient(90deg, transparent, var(--cyan)); box-shadow: 0 0 10px var(--cyan); }
.slogan .line:last-child { background: linear-gradient(90deg, var(--cyan), transparent); }

.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; width: 100%; max-width: 1240px; margin: clamp(16px, 3.2vh, 44px) auto 0; }
.card {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 12px;
  padding: clamp(18px, 2.6vh, 30px) 18px clamp(18px, 2.4vh, 28px); min-height: clamp(140px, 21vh, 250px); cursor: pointer; text-align: center;
  border-radius: var(--r-lg); color: var(--text); border: 1.5px solid var(--accent-line);
  background:
    radial-gradient(120% 70% at 50% 0%, var(--accent-fill), transparent 70%),
    linear-gradient(180deg, rgba(16, 22, 36, 0.55), rgba(11, 22, 51, 0.6));
  box-shadow: 0 0 26px var(--accent-glow), inset 0 0 30px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: transform 0.18s, box-shadow 0.18s;
}
.card:hover, .card.open { transform: translateY(-3px); box-shadow: 0 0 40px var(--accent-glow-strong), inset 0 0 34px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.08); }
.card.open { border-width: 2px; }
.card.c-cyan { --accent: var(--cyan); --accent-line: rgba(0, 212, 255, 0.6); --accent-fill: rgba(37, 99, 235, 0.48); --accent-glow: rgba(0, 212, 255, 0.16); --accent-glow-strong: rgba(0, 212, 255, 0.38); }
.card.c-violet { --accent: var(--purple); --accent-line: rgba(168, 85, 247, 0.65); --accent-fill: rgba(139, 92, 246, 0.46); --accent-glow: rgba(168, 85, 247, 0.17); --accent-glow-strong: rgba(168, 85, 247, 0.4); }
.card.c-magenta { --accent: var(--magenta); --accent-line: rgba(217, 70, 239, 0.6); --accent-fill: rgba(168, 85, 247, 0.48); --accent-glow: rgba(217, 70, 239, 0.16); --accent-glow-strong: rgba(217, 70, 239, 0.38); }
.card-ico { color: var(--accent); display: grid; place-items: center; filter: drop-shadow(0 0 10px var(--accent)); }
.card-ico .ico { width: clamp(40px, 6vh, 66px); height: clamp(40px, 6vh, 66px); stroke-width: 1.6; }
.card-text { display: flex; flex-direction: column; align-items: center; gap: 10px; min-width: 0; }
.card-text b { font-family: var(--font-brand); font-size: clamp(17px, 2.3vh, 24px); font-weight: 700; line-height: 1.2; }
.card-text small { font-size: clamp(13px, 1.6vh, 16px); color: #CBD5E1; line-height: 1.45; }

.suggestions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; width: 100%; max-width: 1240px; margin-top: 18px; }
.suggestions button {
  padding: 10px 16px; border-radius: var(--r-pill); border: 1px solid var(--line-strong); background: rgba(16, 22, 36, 0.7);
  color: var(--text); cursor: pointer; font-size: 14px; animation: rise 0.25s ease both;
}
.suggestions button:hover { border-color: rgba(0, 212, 255, 0.55); color: var(--cyan); }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Campo de mensagens ---------- */
#composerWrap { padding: 8px 32px 14px; flex-shrink: 0; }
#composerWrap .composer { max-width: 1240px; margin: 0 auto; }
.composer-note { text-align: center; font-size: 12px; color: var(--text-2); margin-top: 8px; opacity: 0.8; }
#attachBtn { opacity: 0.6; }

/* ---------- Conversa ---------- */
.chat { flex: 1; min-height: 0; overflow-y: auto; padding: 24px 32px 8px; scroll-behavior: smooth; }
.chat-inner { max-width: 900px; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; }
.msg { display: flex; gap: 14px; align-items: flex-start; }
.msg.user { flex-direction: row-reverse; }
.msg-avatar { width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; font-weight: 600; font-size: 14px; }
.msg.bot .msg-avatar { background: rgba(11, 22, 51, 0.9); border: 1px solid rgba(0, 212, 255, 0.4); box-shadow: 0 0 12px rgba(0, 212, 255, 0.25); }
.msg.bot .msg-avatar img { width: 22px; height: 22px; }
.msg.user .msg-avatar { background: var(--grad-primary); color: var(--bg-0); }
.msg-body { min-width: 0; max-width: calc(100% - 50px); }
.msg.user .bubble { background: rgba(37, 99, 235, 0.22); border: 1px solid rgba(37, 99, 235, 0.45); border-radius: 18px 4px 18px 18px; padding: 11px 16px; white-space: pre-wrap; word-wrap: break-word; line-height: 1.55; }
.msg.bot .bubble { padding: 6px 0 0; line-height: 1.65; word-wrap: break-word; overflow-wrap: anywhere; }
.msg.bot.error .bubble { color: #fca5a5; }
.msg.bot.wait .bubble::after { content: ""; display: inline-block; width: 42px; height: 10px; background:
  radial-gradient(circle, var(--cyan) 3px, transparent 3.5px) 0 50% / 14px 10px repeat-x; animation: dots 1s steps(3) infinite; vertical-align: middle; }
@keyframes dots { from { width: 14px; } to { width: 56px; } }
.stopped-note { font-size: 12px; color: var(--warn); margin-top: 6px; }

.msg-tools { display: flex; align-items: center; gap: 2px; margin-top: 6px; color: var(--text-2); }
.msg-tools .icon-btn { width: 32px; height: 32px; color: var(--text-2); }
.msg-tools .icon-btn .ico { width: 17px; height: 17px; }
.msg-tools .icon-btn:hover { color: var(--cyan); }
.metrics { font-size: 11.5px; color: var(--text-2); opacity: 0.75; margin-left: 8px; font-variant-numeric: tabular-nums; }
body:not(.show-metrics) .metrics { display: none; }

/* Markdown */
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md p { margin: 0 0 12px; }
.md h1, .md h2, .md h3, .md h4 { font-family: var(--font-brand); margin: 18px 0 8px; line-height: 1.3; }
.md h1 { font-size: 22px; } .md h2 { font-size: 19px; } .md h3, .md h4 { font-size: 16.5px; }
.md ul, .md ol { margin: 0 0 12px; padding-left: 22px; }
.md li { margin: 4px 0; }
.md li::marker { color: var(--cyan); }
.md strong { color: #fff; }
.md a { color: var(--cyan); text-decoration: none; border-bottom: 1px solid rgba(0, 212, 255, 0.35); }
.md a:hover { border-bottom-color: var(--cyan); }
.md blockquote { margin: 0 0 12px; padding: 4px 14px; border-left: 3px solid var(--violet); color: var(--text-2); }
.md hr { border: 0; border-top: 1px solid var(--line-strong); margin: 16px 0; }
.md code { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 0.9em; background: rgba(148, 163, 184, 0.14); padding: 2px 6px; border-radius: 6px; }
.md .codeblock { margin: 0 0 14px; border-radius: var(--r-sm); overflow: hidden; border: 1px solid var(--line-strong); background: #060a16; }
.md .codeblock-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 4px 14px; font-size: 12px; color: var(--text-2); background: rgba(16, 22, 36, 0.9); border-bottom: 1px solid var(--line); }
.md .codeblock-head .icon-btn { width: 30px; height: 30px; }
.md .codeblock-head .icon-btn .ico { width: 16px; height: 16px; }
.md pre { margin: 0; padding: 14px 16px; overflow-x: auto; font-size: 13.5px; line-height: 1.55; }
.md pre code { background: none; padding: 0; font-size: inherit; }
.md .table-wrap { overflow-x: auto; margin: 0 0 14px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); }
.md table { border-collapse: collapse; width: 100%; font-size: 14px; }
.md th, .md td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.md th { background: rgba(37, 99, 235, 0.14); font-weight: 600; }
.md tr:last-child td { border-bottom: 0; }
.tok-k { color: #c084fc; } .tok-s { color: #5eead4; } .tok-c { color: #64748b; font-style: italic; } .tok-n { color: #fbbf24; } .tok-f { color: #60a5fa; }

/* ---------- Janelas ---------- */
.account-line { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.account-line b { display: block; }
.account-line span { color: var(--text-2); font-size: 14px; }
.avatar-lg { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-size: 20px; background: var(--grad-primary); color: var(--bg-0); }
#deleteBox input { width: 100%; padding: 10px 12px; border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: rgba(5, 8, 23, 0.6); margin-bottom: 4px; }
#deleteBox .btn { justify-content: center; }
#deleteBox .btn:disabled { opacity: 0.45; cursor: default; }
.mem { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.mem div { flex: 1; font-size: 14px; }
.mem small { display: block; font-size: 11px; color: var(--cyan); text-transform: uppercase; letter-spacing: 0.6px; margin-bottom: 2px; }
.mem .icon-btn { width: 34px; height: 34px; color: var(--text-2); }
.mem .icon-btn:hover { color: var(--err); }
.mem .icon-btn .ico { width: 17px; height: 17px; }
.engine { margin-top: 14px !important; font-size: 12px !important; }
.help dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 14px; margin: 4px 0 16px; }
.help dd { margin: 0; color: var(--text-2); }
kbd { font-family: inherit; font-size: 12px; padding: 2px 7px; border-radius: 6px; border: 1px solid var(--line-strong); background: rgba(148, 163, 184, 0.08); }

.toast {
  position: fixed; left: 50%; bottom: 120px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 80;
  padding: 11px 18px; border-radius: var(--r-pill); font-size: 14px; background: var(--glass-strong);
  border: 1px solid rgba(0, 212, 255, 0.35); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45); transition: opacity 0.2s, transform 0.2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Animações desligadas pela pessoa */
body.no-motion .ring, body.no-motion .ring-front, body.no-motion .hero-logo { animation: none; }

/* ---------- Ecrãs médios (1366×768, 1648×928) ---------- */
@media (max-width: 1500px) {
  :root { --side-w: 270px; --top-h: 84px; }
  .brand-logo { width: 46px; height: 46px; }
  .brand-name { font-size: 27px; }
  .brand-sub { font-size: 12.5px; }
  .cards { gap: 16px; }
  .card { padding-left: 14px; padding-right: 14px; }
  .nav-item { padding: 11px 12px; font-size: 15.5px; }
  .version { font-size: 15px; }
  .foot-logo { width: 40px; height: 40px; }
}
@media (max-height: 800px) and (min-width: 901px) {
  .hero { height: clamp(170px, 28vh, 230px); }
  .orbit { width: clamp(130px, 19vh, 170px); }
  .cards { margin-top: 16px; }
  .card { min-height: 0; gap: 8px; padding-top: 14px; padding-bottom: 14px; }
  .card-text { gap: 6px; }
  .card-text b { font-size: 16px; }
  .card-text small { font-size: 12.5px; }
  .nav { margin-top: 12px; }
  .nav-item { padding: 9px 12px; }
  .side-foot { padding: 8px 12px; }
}

/* ---------- Tablet (768×1024) ---------- */
@media (max-width: 1100px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 760px; gap: 14px; }
  .card { min-height: 0; padding: 16px 14px; gap: 8px; }
  .card-ico .ico { width: 40px; height: 40px; }
  .card-text { gap: 6px; }
  .card-text b { font-size: 18px; }
  .card-text small { font-size: 13.5px; }
  .hero { height: clamp(180px, 25vh, 300px); }
  .brand-sub { display: none; }
  .brand { width: auto; }
}
@media (max-width: 900px) {
  :root { --top-h: 70px; }
  #app, #app.collapsed { grid-template-columns: 1fr; grid-template-areas: "top" "main"; }
  .mobile-only { display: grid !important; }
  .desk-only { display: none !important; }
  #topbar { gap: 10px; padding: 0 12px; }
  .brand { margin-right: auto; }
  .brand-logo { width: 40px; height: 40px; }
  .brand-name { font-size: 24px; }
  .top-search { display: none; position: absolute; left: 12px; right: 12px; top: calc(100% + 8px); max-width: none; z-index: 30; background: var(--glass-strong); }
  .top-search.open { display: flex; }
  #sidebar { position: fixed; top: 0; bottom: 0; left: 0; width: min(320px, 86vw); margin: 0; border-radius: 0 var(--r-lg) var(--r-lg) 0;
    transform: translateX(-105%); transition: transform 0.22s ease; z-index: 40; background: var(--glass-strong); }
  #app.side-open #sidebar { transform: none; }
  #app.side-open #scrim { display: block; position: fixed; inset: 0; background: rgba(5, 8, 23, 0.6); z-index: 35; }
  #app.collapsed #sidebar .label, #app.collapsed .history { display: revert; }
  .home { padding: 8px 18px 12px; }
  #composerWrap { padding: 6px 14px max(12px, env(safe-area-inset-bottom)); }
  .chat { padding: 18px 14px 8px; }
}

/* ---------- Telemóvel (390×844) ---------- */
@media (max-width: 560px) {
  .hero { height: 190px; }
  .orbit { width: 128px; }
  .hero-title { font-size: 44px; margin-top: -16px; }
  .hero-q { font-size: 20px; margin: 6px 0 10px; }
  .slogan { font-size: 14px; gap: 10px; }
  .slogan .line { width: 36px; }
  .cards { gap: 10px; margin-top: 20px; }
  .card { gap: 8px; padding: 14px 10px; min-height: 0; border-radius: var(--r-md); }
  .card-ico .ico { width: 34px; height: 34px; }
  .card-text { gap: 5px; }
  .card-text b { font-size: 15px; }
  .card-text small { font-size: 12px; }
  .composer { padding: 6px 6px 6px 8px; gap: 2px; border-radius: 24px; }
  .composer textarea { font-size: 16px; padding: 10px 4px; min-height: 44px; }
  .composer .icon-btn { width: 40px; height: 40px; }
  .send-btn { width: 44px; height: 44px; }
  .composer-note { font-size: 11px; }
  .msg { gap: 10px; }
  .msg-avatar { width: 30px; height: 30px; }
  .msg.user .msg-avatar { display: none; }
  .msg-body { max-width: 100%; }
}
.nav-item > .label:not(.pill-soon) { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#main.chatting #composerWrap .composer { max-width: 960px; }
