/* ELBAS AI — white base with Ethiopian green / gold / red accents and tibeb-style woven bands. */
:root {
  color-scheme: light;
  --bg: #FFFFFF; --bg-2: #FAF7F0; --panel: #FFFFFF; --panel-2: #F7F4EC; --line: #E9E3D5; --line-2: #D9CDB0;
  --text: #1B1A16; --muted: #5F5A4C; --faint: #8C8573;
  --green: #1E8A47; --green-2: #5E8A1A; --gold: #B98A00; --gold-2: #8F6A00; --red: #B81D31;
  --primary: linear-gradient(135deg, #1E8A47, #4F8A1A); --primary-solid: #1E8A47; --on-primary: #FFFFFF;
  --ok: #1E8A47; --warn: #A76F00; --fail: #B81D31;
  --radius: 16px; --shadow: 0 14px 40px rgba(80,60,20,.10);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans Ethiopic", "Ebrima", "Kefa", "Nyala", "Abyssinica SIL", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --tibeb: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='16' viewBox='0 0 48 16'%3E%3Crect width='48' height='16' fill='%23FFFFFF'/%3E%3Cpath d='M0 8L8 0L16 8L8 16Z' fill='%23F2B807'/%3E%3Cpath d='M8 4L12 8L8 12L4 8Z' fill='%23D7263D'/%3E%3Cpath d='M16 8L24 0L32 8L24 16Z' fill='%232FA35A'/%3E%3Cpath d='M24 5L27 8L24 11L21 8Z' fill='%23F2B807'/%3E%3Cpath d='M32 8L40 0L48 8L40 16Z' fill='%23D7263D'/%3E%3Cpath d='M40 4L44 8L40 12L36 8Z' fill='%23F2B807'/%3E%3Crect width='48' height='1.5' fill='%23F2B807'/%3E%3Crect y='14.5' width='48' height='1.5' fill='%23F2B807'/%3E%3C/svg%3E");
  --lattice: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'%3E%3Cpath d='M20 2L38 20L20 38L2 20Z' fill='none' stroke='%23B98A00' stroke-opacity='.12' stroke-width='1'/%3E%3Cpath d='M20 14L26 20L20 26L14 20Z' fill='%231E8A47' fill-opacity='.06'/%3E%3C/svg%3E");
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 15px/1.6 var(--font); min-height: 100vh; display: flex; flex-direction: column; -webkit-font-smoothing: antialiased; }
a { color: var(--gold); text-underline-offset: 3px; }
a:hover { color: var(--gold-2); }
.muted { color: var(--muted); } .mono { font-family: var(--mono); } .small { font-size: 13px; }
.inline { display: inline; margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
::selection { background: rgba(242,184,7,.35); }

/* ---------- Tibeb band ---------- */
.tibeb { height: 10px; background: var(--tibeb) repeat-x center / auto 100%; flex-shrink: 0; }
.tibeb.thin { height: 6px; }

/* ---------- Header / footer ---------- */
.site-header { display: flex; align-items: center; gap: 16px; padding: 12px 24px; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); flex-wrap: wrap; }
.header-wrap { position: sticky; top: 0; z-index: 20; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 800; font-size: 19px; letter-spacing: .02em; }
.brand img { filter: drop-shadow(0 2px 6px rgba(242,184,7,.25)); }
.brand-word b { background: linear-gradient(90deg, var(--green-2), var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 900; }
.site-nav { margin-left: auto; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.site-nav > a { color: var(--muted); text-decoration: none; font-weight: 600; font-size: 14px; padding: 6px 4px; border-bottom: 2px solid transparent; }
.site-nav > a:hover { color: var(--text); border-bottom-color: var(--gold); }
.lang-switch { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--panel); }
.lang-switch a { padding: 5px 13px; color: var(--muted); text-decoration: none; font-size: 13px; }
.lang-switch a[aria-current] { background: var(--gold); color: #1B1406; font-weight: 700; }
.user-chip { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 800; font-size: 13px; color: #1B1406; background: linear-gradient(135deg, var(--gold), var(--green-2)); overflow: hidden; flex-shrink: 0; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.site-main { flex: 1; width: 100%; max-width: 1120px; margin: 0 auto; padding: 40px 20px 64px; }
.site-footer { background: var(--bg-2); color: var(--muted); font-size: 13px; }
.footer-inner { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 18px 24px; max-width: 1120px; margin: 0 auto; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 20px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; transition: transform .15s, box-shadow .15s, border-color .15s, background .15s; }
.btn:hover { border-color: var(--gold); color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); border-color: transparent; color: var(--on-primary); box-shadow: 0 8px 22px rgba(47,163,90,.28); }
.btn-primary:hover { color: var(--on-primary); box-shadow: 0 10px 28px rgba(47,163,90,.4); transform: translateY(-1px); }
.btn-gold { background: linear-gradient(135deg, var(--gold), #E89B00); border-color: transparent; color: #1B1406; box-shadow: 0 8px 22px rgba(242,184,7,.25); }
.btn-gold:hover { color: #1B1406; transform: translateY(-1px); }
.btn-ghost { background: transparent; padding: 8px 15px; }
.btn-lg { padding: 14px 26px; font-size: 16px; border-radius: 14px; }
.btn-block { width: 100%; }
.btn-danger { color: var(--fail); }
.btn-google { width: 100%; background: #FFFFFF; color: #1F1F1F; border-color: #DADCE0; font-weight: 700; }
.btn-google:hover { background: #F6F8FA; color: #1F1F1F; border-color: #C6C9CE; }
.btn-google .g-dot { width: 20px; height: 20px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231F1F1F' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 21c1.5-4 4.5-6 8-6s6.5 2 8 6'/%3E%3C/svg%3E") center / contain no-repeat; }
.btn-auto { width: auto; }

/* ---------- Home ---------- */
.hero { position: relative; text-align: center; padding: 56px 20px 40px; border-radius: 28px; overflow: hidden; isolation: isolate; }
.hero::before { content: ""; position: absolute; inset: 0; z-index: -2; background: var(--lattice); }
.hero::after { content: ""; position: absolute; inset: -20%; z-index: -1; background:
  radial-gradient(40% 35% at 20% 25%, rgba(47,163,90,.28), transparent 70%),
  radial-gradient(35% 30% at 80% 20%, rgba(242,184,7,.22), transparent 70%),
  radial-gradient(35% 30% at 60% 85%, rgba(215,38,61,.18), transparent 70%);
  animation: drift 18s ease-in-out infinite alternate; }
@keyframes drift { to { transform: translate3d(3%, 4%, 0) scale(1.06); } }
.hero-badge { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line-2); background: color-mix(in srgb, var(--panel) 70%, transparent); font-size: 13px; color: var(--muted); }
.hero-badge i { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(47,163,90,.25); }
.hero-logo { position: relative; width: 132px; height: 132px; margin: 26px auto 8px; display: grid; place-items: center; }
.hero-logo::before { content: ""; position: absolute; inset: 0; border-radius: 50%; padding: 4px; background: conic-gradient(var(--green), var(--gold), var(--red), var(--green)); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; animation: spin 14s linear infinite; }
.hero-logo span { position: absolute; inset: 10px; border-radius: 50%; background: var(--panel); box-shadow: var(--shadow); }
.hero-logo img { position: relative; width: 84px; height: 84px; object-fit: contain; }
@keyframes spin { to { transform: rotate(360deg); } }
.hero h1 { font-size: clamp(42px, 7vw, 72px); line-height: 1.05; margin: 18px 0 10px; letter-spacing: -.02em; font-weight: 900; }
.hero h1 .accent { background: linear-gradient(90deg, var(--green-2), var(--gold) 55%, var(--red)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .amharic { font-size: clamp(18px, 2.4vw, 22px); color: var(--gold); margin: 0 0 6px; font-weight: 700; }
.lead { font-size: clamp(17px, 2.2vw, 20px); color: var(--muted); max-width: 680px; margin: 0 auto 28px; }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.model-chips { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 30px; }
.model-chips span { padding: 7px 14px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); font-size: 13px; font-weight: 700; color: var(--muted); }
.model-chips span::before { content: "◆ "; color: var(--gold); }
.section-title { text-align: center; font-size: clamp(24px, 3.4vw, 32px); margin: 64px 0 8px; }
.section-sub { text-align: center; color: var(--muted); margin: 0 auto 28px; max-width: 620px; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.feature { position: relative; padding: 26px 22px 22px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); overflow: hidden; transition: transform .2s, border-color .2s; }
.feature:hover { transform: translateY(-3px); border-color: var(--line-2); }
.feature::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 6px; background: var(--tibeb) repeat-x center / auto 100%; }
.feature .icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 14px; }
.feature:nth-child(1) .icon { background: rgba(47,163,90,.16); color: var(--green-2); }
.feature:nth-child(2) .icon { background: rgba(242,184,7,.16); color: var(--gold); }
.feature:nth-child(3) .icon { background: rgba(215,38,61,.16); color: var(--red); }
.feature h3 { margin: 0 0 6px; font-size: 18px; }
.feature p { margin: 0; color: var(--muted); }
.steps-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; counter-reset: step; }
.step { padding: 20px; border-radius: var(--radius); border: 1px dashed var(--line-2); }
.step::before { counter-increment: step; content: counter(step); display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--gold); color: #1B1406; font-weight: 900; margin-bottom: 10px; }
.step h3 { margin: 0 0 4px; font-size: 16px; }
.step p { margin: 0; color: var(--muted); font-size: 14px; }
.cta-band { margin-top: 56px; padding: 34px 24px; border-radius: 24px; text-align: center; background: linear-gradient(135deg, rgba(47,163,90,.18), rgba(242,184,7,.14) 60%, rgba(215,38,61,.14)); border: 1px solid var(--line-2); }
.cta-band h2 { margin: 0 0 8px; font-size: clamp(22px, 3vw, 28px); }
.cta-band p { margin: 0 0 18px; color: var(--muted); }
.notice { display: inline-block; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--gold); color: var(--gold); font-size: 14px; }

/* ---------- Cards and forms ---------- */
.card { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 30px; margin: 0 auto; max-width: 780px; box-shadow: var(--shadow); overflow: hidden; }
.card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 8px; background: var(--tibeb) repeat-x center / auto 100%; }
.card.narrow { max-width: 450px; }
.card.wide { max-width: 1120px; }
.card h1 { margin: 6px 0 16px; font-size: 24px; }
.card h2 { font-size: 18px; margin: 30px 0 12px; }
.card h3 { font-size: 15px; margin: 0 0 8px; }
.auth-wrap { display: grid; place-items: center; min-height: calc(100vh - 260px); position: relative; }
.auth-wrap::before { content: ""; position: fixed; inset: 0; z-index: -1; background: var(--lattice); pointer-events: none; }
.auth-logo { display: block; width: 56px; height: 56px; margin: 8px auto 0; }
.card.auth h1 { text-align: center; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: 13px; margin: 18px 0 6px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.form { display: grid; gap: 14px; margin-top: 8px; }
.form label { display: grid; gap: 6px; font-size: 14px; color: var(--muted); font-weight: 600; }
input, select { width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-2); color: var(--text); font: inherit; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 4px rgba(242,184,7,.15); }
.alert { padding: 12px 14px; border-radius: 12px; background: rgba(255,107,122,.1); border: 1px solid rgba(255,107,122,.45); margin: 8px 0; }
.notice-box { padding: 12px 14px; border-radius: 12px; background: rgba(76,194,122,.1); border: 1px solid rgba(76,194,122,.45); margin: 8px 0; }
.form-links { margin: 18px 0 0; font-size: 14px; text-align: center; }
.inline-form { margin: 0 0 8px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.check { display: flex !important; flex-direction: row; align-items: center; gap: 10px; color: var(--text) !important; }
.check input { width: auto; accent-color: var(--green); }
.input-sm { padding: 7px 10px; font-size: 14px; border-radius: 9px; }
.copy-field { display: flex; gap: 8px; }
.copy-field input { font-family: var(--mono); font-size: 13px; }

/* ---------- Install steps ---------- */
.steps { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0 0 18px; font-size: 12.5px; }
.steps li { padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.steps li.done { border-color: var(--ok); color: var(--ok); }
.steps li.now { background: var(--gold); border-color: var(--gold); color: #1B1406; font-weight: 700; }

/* ---------- Tables / admin ---------- */
.table-wrap { overflow-x: auto; margin: 0 0 16px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { color: var(--faint); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.table tbody tr:hover { background: var(--panel-2); }
.table input[type=checkbox], .table input[type=radio] { width: 18px; height: 18px; accent-color: var(--green); }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 800; white-space: nowrap; }
.pill-ok { background: rgba(76,194,122,.15); color: var(--ok); }
.pill-warn { background: rgba(242,184,7,.15); color: var(--warn); }
.pill-fail { background: rgba(255,107,122,.15); color: var(--fail); }
.status-banner { padding: 12px 16px; border-radius: 12px; font-weight: 700; }
.status-ok { background: rgba(76,194,122,.12); color: var(--ok); }
.status-warn { background: rgba(242,184,7,.12); color: var(--warn); }
.status-fail { background: rgba(255,107,122,.12); color: var(--fail); }
pre { white-space: pre-wrap; background: var(--bg-2); padding: 12px; border-radius: 10px; }
.admin-tabs { display: flex; gap: 8px; max-width: 1120px; margin: 0 auto 18px; flex-wrap: wrap; }
.admin-tabs a { padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 700; background: var(--panel); }
.admin-tabs a[aria-current] { background: var(--gold); border-color: var(--gold); color: #1B1406; }
.provider-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 14px; }
.provider { border: 1px solid var(--line); border-radius: 14px; padding: 18px; background: var(--bg-2); }
.provider p { margin: 0 0 8px; }
.row-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.row-actions form { margin: 0; }
.model-group { border: 1px solid var(--line); border-radius: 14px; margin: 0 0 12px; padding: 4px 14px; background: var(--bg-2); }
.model-group summary { cursor: pointer; padding: 11px 0; font-weight: 700; }
.settings-form { max-width: 480px; }
.google-box { border: 1px solid var(--line); border-radius: 14px; padding: 18px; background: var(--bg-2); max-width: 720px; }
.google-box ol { margin: 0 0 14px; padding-left: 20px; color: var(--muted); }
.google-box ol li { margin-bottom: 4px; }

/* ---------- Chat app ---------- */
body.app { height: 100vh; height: 100dvh; overflow: hidden; }
body.app .site-main { max-width: none; padding: 0; flex: 1; min-height: 0; display: flex; }
.chat { display: grid; grid-template-columns: 284px 1fr; flex: 1; min-height: 0; width: 100%; }
.chat-side { position: relative; border-right: 1px solid var(--line); background: var(--bg-2); display: flex; flex-direction: column; gap: 10px; padding: 14px 12px 12px; min-height: 0; }
.chat-side::before { content: ""; position: absolute; top: 0; bottom: 0; right: -1px; width: 3px; background: linear-gradient(var(--green), var(--gold), var(--red)); opacity: .55; }
.new-chat { width: 100%; }
.side-label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); font-weight: 800; padding: 6px 8px 0; }
.conv-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; min-height: 0; }
.conv { display: flex; align-items: center; border-radius: 10px; border: 1px solid transparent; }
.conv:hover { background: var(--panel); }
.conv.active { background: var(--panel); border-color: var(--line-2); box-shadow: inset 3px 0 0 var(--gold); }
.conv-link { flex: 1; min-width: 0; padding: 9px 10px; color: var(--text); text-decoration: none; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-link:hover { color: var(--text); }
.conv-btn { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 6px; font-size: 13px; opacity: 0; border-radius: 6px; }
.conv:hover .conv-btn, .conv.active .conv-btn, .conv-btn:focus-visible { opacity: 1; }
.conv-btn:hover { color: var(--text); background: var(--panel-2); }
.usage { padding: 10px 6px 0; border-top: 1px solid var(--line); }
.usage-bar { height: 6px; border-radius: 999px; background: var(--panel-2); overflow: hidden; margin-top: 6px; }
.usage-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--green), var(--gold)); border-radius: 999px; transition: width .3s; }
.chat-main { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.chat-main::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--lattice); opacity: .6; pointer-events: none; }
.chat-top { display: flex; align-items: center; gap: 10px; padding: 10px 18px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(10px); }
.chat-title { flex: 1; min-width: 0; font-size: 15px; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { display: none; padding: 6px 11px; }
.model-pick select { width: auto; padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--panel); color: var(--text); font: inherit; font-size: 14px; font-weight: 700; max-width: 240px; }
.chat-scroll { flex: 1; overflow-y: auto; min-height: 0; }
.chat-empty { text-align: center; padding: 9vh 20px 20px; max-width: 760px; margin: 0 auto; }
.chat-empty .hero-logo { width: 104px; height: 104px; margin: 0 auto 6px; }
.chat-empty .hero-logo img { width: 64px; height: 64px; }
.chat-empty h2 { margin: 14px 0 6px; font-size: clamp(22px, 3vw, 30px); }
.suggestions { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin-top: 24px; text-align: left; }
.suggestion { padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font: inherit; font-size: 14px; cursor: pointer; text-align: left; transition: border-color .15s, transform .15s; }
.suggestion:hover { border-color: var(--gold); transform: translateY(-2px); }
.suggestion b { display: block; font-size: 13px; color: var(--gold); margin-bottom: 2px; }
.msgs { max-width: 820px; margin: 0 auto; padding: 24px 18px 10px; display: flex; flex-direction: column; gap: 22px; }
.msg { display: flex; flex-direction: column; }
.msg.user { align-items: flex-end; }
.msg.user .msg-body { background: linear-gradient(135deg, rgba(242,184,7,.16), rgba(47,163,90,.12)); border: 1px solid var(--line-2); padding: 11px 15px; border-radius: 18px 18px 4px 18px; max-width: 85%; white-space: pre-wrap; word-wrap: break-word; }
.msg.assistant { display: grid; grid-template-columns: 34px 1fr; column-gap: 12px; }
.msg.assistant::before { content: ""; width: 34px; height: 34px; border-radius: 50%; grid-row: 1 / span 2; background: var(--panel) url("/assets/img/elbas-symbol-256.png?v=6") center / 24px no-repeat; border: 1px solid var(--line-2); box-shadow: 0 0 0 3px rgba(242,184,7,.08); }
.msg.assistant .msg-body { line-height: 1.75; word-wrap: break-word; min-width: 0; padding-top: 4px; }
.msg.error .msg-body { color: var(--fail); }
.msg-body > :first-child { margin-top: 0; }
.msg-body > :last-child { margin-bottom: 0; }
.msg-body p, .msg-body ul, .msg-body ol, .msg-body blockquote { margin: 0 0 12px; }
.msg-body ul, .msg-body ol { padding-left: 24px; }
.msg-body li::marker { color: var(--gold); }
.msg-body li.nested { margin-left: 20px; }
.msg-body h2, .msg-body h3, .msg-body h4, .msg-body h5, .msg-body h6 { margin: 18px 0 8px; line-height: 1.3; }
.msg-body h2 { font-size: 20px; } .msg-body h3 { font-size: 17px; } .msg-body h4, .msg-body h5, .msg-body h6 { font-size: 15px; }
.msg-body blockquote { border-left: 3px solid var(--gold); padding-left: 12px; color: var(--muted); }
.msg-body code { font-family: var(--mono); font-size: .9em; background: var(--panel-2); padding: 1px 6px; border-radius: 6px; }
.msg-body hr { border: 0; height: 6px; background: var(--tibeb) repeat-x center / auto 100%; margin: 18px 0; opacity: .8; }
.msg-body a { color: var(--gold); }
.codeblock { margin: 0 0 12px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #070B16; }
.code-head { display: flex; justify-content: space-between; align-items: center; padding: 5px 12px; background: var(--panel-2); font-size: 12px; color: var(--muted); }
.copy-code, .msg-copy { background: none; border: 0; color: var(--muted); cursor: pointer; font: inherit; font-size: 12px; padding: 3px 8px; border-radius: 6px; }
.copy-code:hover, .msg-copy:hover { color: var(--text); background: var(--panel); }
.codeblock pre { margin: 0; padding: 14px 16px; overflow-x: auto; background: transparent; border-radius: 0; color: #E8E6DF; }
.codeblock code { background: none; padding: 0; font-size: 13px; color: inherit; }
.md-table { overflow-x: auto; margin: 0 0 12px; }
.md-table table { border-collapse: collapse; font-size: 14px; }
.md-table th, .md-table td { border: 1px solid var(--line); padding: 7px 11px; text-align: left; }
.md-table th { background: var(--panel-2); }
.msg-foot { grid-column: 2; display: flex; gap: 10px; align-items: center; margin-top: 6px; font-size: 12px; color: var(--faint); }
.msg.streaming .msg-foot { visibility: hidden; }
.cursor { display: inline-block; width: 8px; height: 16px; background: linear-gradient(var(--gold), var(--green)); vertical-align: text-bottom; margin-left: 2px; animation: blink 1s steps(2) infinite; border-radius: 2px; }
@keyframes blink { 50% { opacity: 0; } }
.dots { display: inline-flex; gap: 5px; padding: 8px 0; }
.dots i { width: 8px; height: 8px; border-radius: 50%; animation: bounce 1.2s infinite ease-in-out; }
.dots i:nth-child(1) { background: var(--green); } .dots i:nth-child(2) { background: var(--gold); animation-delay: .15s; } .dots i:nth-child(3) { background: var(--red); animation-delay: .3s; }
@keyframes bounce { 0%, 80%, 100% { transform: scale(.6); opacity: .5; } 40% { transform: scale(1); opacity: 1; } }
.composer-wrap { padding: 8px 16px 0; }
.composer { display: flex; align-items: flex-end; gap: 8px; max-width: 820px; margin: 0 auto 4px; padding: 9px 9px 9px 16px; border: 1px solid var(--line-2); border-radius: 20px; background: var(--panel); box-shadow: var(--shadow); transition: border-color .15s, box-shadow .15s; }
.composer:focus-within { border-color: var(--gold); box-shadow: var(--shadow), 0 0 0 4px rgba(242,184,7,.12); }
.composer textarea { flex: 1; resize: none; border: 0; background: transparent; color: var(--text); font: inherit; line-height: 1.5; padding: 7px 0; max-height: 220px; outline: none; }
.send-btn { width: 40px; height: 40px; flex-shrink: 0; border-radius: 13px; border: 0; background: var(--primary); color: var(--on-primary); font-size: 18px; font-weight: 900; cursor: pointer; transition: transform .15s; }
.send-btn:hover:not(:disabled) { transform: scale(1.06); }
.send-btn:disabled { opacity: .35; cursor: default; }
.send-btn.stop { background: var(--red); color: #fff; font-size: 13px; }
.disclaimer { text-align: center; margin: 0 0 8px; color: var(--faint); }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--panel); border: 1px solid var(--fail); color: var(--text); padding: 11px 18px; border-radius: 12px; z-index: 50; max-width: calc(100% - 32px); box-shadow: var(--shadow); }
.side-backdrop { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .site-header { padding: 10px 14px; gap: 10px; }
  .site-main { padding: 22px 14px 48px; }
  .card { padding: 22px 18px; }
  .site-nav { gap: 8px; }
  .site-nav > a:not(.btn) { display: none; }
  .hero { padding: 36px 8px 28px; }
  .chat { grid-template-columns: 1fr; }
  .chat-side { position: fixed; top: 0; bottom: 0; left: 0; width: 290px; max-width: 86vw; z-index: 40; transform: translateX(-100%); transition: transform .22s; }
  body.side-open .chat-side { transform: none; box-shadow: var(--shadow); }
  .side-backdrop:not([hidden]) { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 30; }
  .icon-btn { display: inline-flex; }
  .model-pick select { max-width: 150px; }
  .conv-btn { opacity: 1; }
  .user-chip > span:last-child { display: none; }
  .msg.assistant { grid-template-columns: 1fr; }
  .msg.assistant::before { display: none; }
  .msg-foot { grid-column: 1; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- Unlimited passes ---------- */
.center { text-align: center; }
.pricing-head { text-align: center; max-width: 720px; margin: 0 auto 30px; }
.pricing-head h1 { font-size: clamp(30px, 5vw, 44px); margin: 16px 0 8px; letter-spacing: -.01em; }
.pricing-head .notice-box, .pricing-head .alert { text-align: left; margin-top: 14px; }
.pass-active { display: inline-block; margin-top: 14px; padding: 10px 16px; border-radius: 12px; background: color-mix(in srgb, var(--green) 10%, transparent); border: 1px solid color-mix(in srgb, var(--green) 35%, transparent); font-size: 14px; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; max-width: 980px; margin: 0 auto; align-items: stretch; }
.plan { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 26px 22px 22px; border: 1px solid var(--line); border-radius: 20px; background: var(--panel); box-shadow: var(--shadow); overflow: hidden; }
.plan::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 6px; background: var(--tibeb) repeat-x center / auto 100%; }
.plan-best { border-color: var(--gold); box-shadow: 0 18px 46px rgba(185,138,0,.18); }
.plan-tag { position: absolute; top: 16px; right: 16px; padding: 3px 10px; border-radius: 999px; background: var(--gold); color: #FFFFFF; font-size: 12px; font-weight: 800; }
.plan h2 { margin: 6px 0 0; font-size: 18px; color: var(--muted); }
.plan-price { margin: 0; font-size: 18px; color: var(--muted); }
.plan-price b { font-size: 44px; line-height: 1.1; color: var(--text); letter-spacing: -.02em; }
.plan-list { list-style: none; padding: 0; margin: 6px 0 10px; display: grid; gap: 8px; flex: 1; }
.plan-list li { padding-left: 26px; position: relative; font-size: 14px; }
.plan-list li::before { content: "✓"; position: absolute; left: 0; top: 0; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 900; color: #FFFFFF; background: var(--green); }
.plan form { margin: 0; }
.plan .btn[disabled] { opacity: .6; cursor: not-allowed; }
.pay-note { max-width: 680px; margin: 22px auto 0; }
.go-pass { margin-top: 10px; padding: 9px 14px; font-size: 14px; }
.limit-box { display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 820px; margin: 0 auto 10px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--gold); background: color-mix(in srgb, var(--gold) 9%, var(--panel)); }
.limit-box[hidden] { display: none; }
.limit-box div { display: grid; gap: 2px; }
.chat-notice { max-width: 820px; margin: 0 auto 10px; }
@media (max-width: 560px) { .limit-box { flex-direction: column; align-items: stretch; text-align: center; } }
.go-pass[hidden] { display: none; }

/* ---------- Single assistant, pictures, websites, install ---------- */
.model-badge { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px 6px 7px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--panel); font-weight: 800; font-size: 13px; letter-spacing: .02em; white-space: nowrap; }
.model-badge img { border-radius: 50%; }
.model-chips span.chip-main { color: var(--text); border-color: var(--gold); background: color-mix(in srgb, var(--gold) 10%, var(--panel)); }
.tool-btn { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px; flex-shrink: 0; border-radius: 13px; border: 1px solid var(--line); background: var(--panel-2); color: var(--muted); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.tool-btn[hidden] { display: none; }
.tool-btn:hover { color: var(--text); border-color: var(--line-2); }
.tool-btn[aria-pressed="true"] { background: color-mix(in srgb, var(--gold) 16%, var(--panel)); color: var(--gold-2); border-color: var(--gold); }
.composer { padding-left: 9px; }
.composer textarea { padding-left: 6px; }
body.image-mode .composer { border-color: var(--gold); }
.gen-img { margin: 4px 0 10px; max-width: 520px; }
.gen-img img { display: block; width: 100%; height: auto; border-radius: 16px; border: 1px solid var(--line); box-shadow: var(--shadow); background: var(--panel-2); }
.gen-img figcaption { margin-top: 6px; }
.gen-img figcaption .btn { padding: 6px 12px; font-size: 13px; }
.img-wait { display: flex; align-items: center; gap: 12px; width: min(100%, 420px); aspect-ratio: 1 / 1; max-height: 320px; justify-content: center; flex-direction: column; border-radius: 16px; border: 1px dashed var(--line-2); color: var(--muted); font-size: 14px; text-align: center; padding: 16px;
  background: linear-gradient(110deg, var(--panel-2) 30%, var(--panel) 50%, var(--panel-2) 70%); background-size: 220% 100%; animation: shimmer 1.6s linear infinite; }
@keyframes shimmer { to { background-position: -220% 0; } }
.code-actions { display: inline-flex; gap: 4px; }
.dl-code { background: none; border: 0; color: var(--green); cursor: pointer; font: inherit; font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 6px; }
.dl-code:hover { background: var(--panel); }
.install-btn[hidden], .install-side[hidden] { display: none; }
.install-side { margin-top: 6px; font-size: 14px; padding: 8px 12px; }
.install-help { position: fixed; inset: 0; z-index: 60; display: grid; place-items: end center; background: rgba(20,18,10,.45); padding: 16px; padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
.install-help[hidden] { display: none; }
.install-card { width: min(420px, 100%); background: var(--panel); border-radius: 22px; padding: 22px; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.install-card img { border-radius: 14px; }
.install-card h2 { font-size: 18px; margin: 10px 0; }
.install-card ol { text-align: left; margin: 0 0 16px; padding-left: 22px; display: grid; gap: 6px; font-size: 14px; }

/* App feel: safe areas (notch, home bar) and comfortable touch targets */
body.app .composer-wrap { padding-bottom: env(safe-area-inset-bottom); }
.site-header { padding-left: max(24px, env(safe-area-inset-left)); padding-right: max(24px, env(safe-area-inset-right)); }
@media (max-width: 760px) {
  .site-header { padding: 8px max(12px, env(safe-area-inset-left)); }
  body.app .site-header .brand-word { font-size: 16px; }
  body.app .site-header .brand img { width: 28px; height: 28px; }
  body.app .site-header form.inline { display: none; }   /* logout lives in the menu on phones */
  .chat-top { padding: 8px 10px; gap: 8px; }
  .chat-title { font-size: 14px; }
  .model-badge { padding: 4px 9px 4px 5px; font-size: 12px; }
  .model-badge img { width: 18px; height: 18px; }
  .msgs { padding: 16px 12px 8px; gap: 18px; }
  .msg.user .msg-body { max-width: 92%; }
  .composer-wrap { padding: 6px 8px 0; }
  .composer { border-radius: 18px; gap: 6px; padding: 6px; }
  .composer textarea { font-size: 16px; }      /* 16px stops iOS from zooming in on focus */
  .tool-btn { padding: 0 10px; }
  .tool-btn .tool-label { display: none; }
  .disclaimer { font-size: 11px; margin: 4px 0 6px; }
  .chat-empty { padding: 5vh 14px 14px; }
  .suggestions { grid-template-columns: 1fr 1fr; gap: 8px; }
  .plans { gap: 14px; }
  .plan-price b { font-size: 38px; }
  .install-btn { padding: 6px 10px; font-size: 13px; }
  .lang-switch a { padding: 5px 10px; }
}
@media (max-width: 380px) {
  .suggestions { grid-template-columns: 1fr; }
  .install-btn { display: none !important; }
}
@media (display-mode: standalone) { .install-btn, .install-side { display: none !important; } }
.side-links { display: none; gap: 14px; flex-wrap: wrap; margin-top: 10px; font-size: 13px; }
.side-links a, .linklike { color: var(--muted); text-decoration: none; background: none; border: 0; padding: 0; font: inherit; font-size: 13px; cursor: pointer; }
.side-links a:hover, .linklike:hover { color: var(--text); }
@media (max-width: 760px) { .side-links { display: flex; } }
/* Phone header: one row */
.suggestions { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 680px; margin-left: auto; margin-right: auto; }
.gen-img img { max-height: 70vh; object-fit: contain; }
@media (max-width: 760px) {
  .site-header { flex-wrap: nowrap; }
  .site-nav { flex-wrap: nowrap; gap: 6px; }
  .brand { font-size: 16px; gap: 8px; min-width: 0; }
  .brand img { width: 28px; height: 28px; }
  .install-btn { padding: 6px 9px; }
  .install-btn .install-label { display: none; }
  body.app .install-btn { display: none !important; }
  .lang-switch a { padding: 4px 8px; font-size: 12px; }
  .site-nav .btn-ghost { padding: 7px 12px; }
}
@media (max-width: 380px) { .brand-word { display: none; } }
.brand-word, .site-nav .btn, .lang-switch a { white-space: nowrap; }
@media (max-width: 760px) {
  body:not(.app) .user-chip { display: none; }
  .suggestion { font-size: 13px; padding: 12px; }
}

/* ---------- Attachments ---------- */
.tool-btn.icon-only { padding: 0 10px; }
.attach-row { display: flex; flex-wrap: wrap; gap: 8px; max-width: 820px; margin: 0 auto 8px; }
.attach-row[hidden] { display: none; }
.attach-chip { display: inline-flex; align-items: center; gap: 8px; max-width: 240px; padding: 5px 6px 5px 6px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--panel); font-size: 13px; box-shadow: 0 4px 12px rgba(80,60,20,.06); }
.attach-chip img { width: 34px; height: 34px; object-fit: cover; border-radius: 8px; }
.attach-chip .ic { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; background: var(--panel-2); font-size: 16px; }
.attach-chip .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-chip .x { border: 0; background: var(--panel-2); color: var(--muted); width: 24px; height: 24px; border-radius: 50%; cursor: pointer; font-size: 16px; line-height: 1; flex-shrink: 0; }
.attach-chip .x:hover { color: var(--fail); }
.attach-chip.uploading { opacity: .7; }
.attach-chip.uploading .nm::after { content: ""; display: inline-block; width: 10px; height: 10px; margin-left: 6px; border: 2px solid var(--line-2); border-top-color: var(--green); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -1px; }
.msg-files { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; margin-bottom: 6px; max-width: 85%; }
.file-thumb img { display: block; width: 120px; height: 120px; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); }
.file-chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--panel); color: var(--text); text-decoration: none; font-size: 13px; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-chip:hover { border-color: var(--gold); color: var(--text); }
.chat-main.drop::after { content: ""; position: absolute; inset: 10px; border: 2px dashed var(--green); border-radius: 18px; background: color-mix(in srgb, var(--green) 6%, transparent); pointer-events: none; z-index: 5; }
@media (max-width: 760px) { .file-thumb img { width: 96px; height: 96px; } .msg-files { max-width: 92%; } .attach-row { margin: 0 4px 6px; } }

/* ---------- Manual telebirr payment ---------- */
.card.transfer { max-width: 560px; width: 100%; }
.back-link { text-decoration: none; }
.pay-steps { padding-left: 22px; display: grid; gap: 20px; margin: 18px 0 0; }
.pay-steps > li > b { display: block; margin-bottom: 8px; }
.pay-box { display: grid; gap: 10px; padding: 16px; border: 1px solid var(--gold); border-radius: 16px; background: color-mix(in srgb, var(--gold) 7%, var(--panel)); }
.pay-box > div { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; }
.pay-box > div > span:first-child { min-width: 110px; }
.pay-box .big { font-size: 20px; }
.copy-btn { padding: 4px 10px; font-size: 12px; }
.my-requests { margin-top: 30px; }
.review-list { display: grid; gap: 14px; }
.review { display: grid; grid-template-columns: 1fr 150px; gap: 14px; padding: 16px; border: 1px solid var(--line-2); border-radius: 16px; background: var(--panel); }
.review p { margin: 0 0 4px; }
.review-proof { display: grid; gap: 6px; justify-items: center; align-content: start; text-decoration: none; }
.review-proof img { width: 150px; max-height: 200px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.review-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.review-actions form { margin: 0; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.reject-form input { min-width: 200px; padding: 9px 12px; border: 1px solid var(--line-2); border-radius: 10px; font: inherit; }
.badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--red); color: #fff; font-size: 11px; font-weight: 800; }
@media (max-width: 560px) { .review { grid-template-columns: 1fr; } .reject-form input { min-width: 0; flex: 1; } }
.tg-steps { padding-left: 20px; margin: 0 0 12px; }

/* ================= App feel (phones) + drawer account ================= */
html { -webkit-text-size-adjust: 100%; }
button, a, summary { -webkit-tap-highlight-color: transparent; }
.side-head { display: none; align-items: center; justify-content: space-between; gap: 10px; padding: 2px 4px 6px; }
.side-brand { display: inline-flex; align-items: center; gap: 9px; color: var(--text); text-decoration: none; font-weight: 800; font-size: 17px; }
.side-brand img { border-radius: 9px; }
.side-brand b { color: var(--green); }
.side-close { width: 40px; height: 40px; border: 0; border-radius: 12px; background: var(--panel); color: var(--muted); font-size: 16px; cursor: pointer; }
.side-foot { display: grid; gap: 8px; border-top: 1px solid var(--line); padding-top: 10px; }
.side-foot .usage { border-top: 0; padding: 0 6px; }
.side-foot .go-pass, .side-foot .install-side { margin: 0; }
.account { border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.account summary { display: flex; align-items: center; gap: 10px; padding: 8px 10px; cursor: pointer; list-style: none; border-radius: 14px; }
.account summary::-webkit-details-marker { display: none; }
.account-who { display: grid; min-width: 0; flex: 1; line-height: 1.25; }
.account-who b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.account-who small { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.account-caret { color: var(--faint); transition: transform .2s; }
.account[open] .account-caret { transform: rotate(180deg); }
.account-menu { display: grid; gap: 2px; padding: 4px 6px 8px; border-top: 1px solid var(--line); }
.account-menu > a, .account-menu .linklike { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 8px; border-radius: 10px; color: var(--text); text-decoration: none; font-size: 14px; width: 100%; text-align: left; }
.account-menu > a:hover, .account-menu .linklike:hover { background: var(--panel-2); }
.account-menu form { margin: 0; }
.linklike.danger { color: var(--fail); }
.account-lang { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px 0; }
.account-lang a { text-align: center; padding: 8px; border-radius: 10px; border: 1px solid var(--line); color: var(--muted); text-decoration: none; font-size: 13px; }
.account-lang a[aria-current] { background: var(--gold); border-color: var(--gold); color: #fff; font-weight: 700; }
.side-links { display: none !important; }
.tabbar { display: none; }

@media (max-width: 760px) {
  /* Chat screen = native-style app: own app bar, drawer, composer; no website header */
  body.app .header-wrap { display: none; }
  body.app { overscroll-behavior: none; }
  .chat-scroll { overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  .chat-top { min-height: 56px; padding: max(6px, env(safe-area-inset-top, 0px)) max(8px, env(safe-area-inset-right, 0px)) 6px max(8px, env(safe-area-inset-left, 0px)); gap: 4px; background: var(--bg); backdrop-filter: none; box-shadow: 0 1px 0 var(--line); border-bottom: 0; }
  .chat-top .icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 14px; color: var(--text); }
  .chat-top .icon-btn:active { background: var(--panel-2); }
  .chat-title { text-align: center; font-size: 16px; font-weight: 700; }
  .chat-top .model-badge { display: none; }
  .chat-side { width: min(86vw, 320px); max-width: none; padding: max(12px, env(safe-area-inset-top, 0px)) 12px max(12px, env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px)); transition: transform .26s cubic-bezier(.2, .8, .2, 1); border-right: 0; border-radius: 0 22px 22px 0; }
  .chat-side::before { display: none; }
  body.side-open .chat-side { box-shadow: 12px 0 40px rgba(30, 25, 10, .18); }
  .side-backdrop:not([hidden]) { background: rgba(20, 18, 10, .38); animation: fadein .2s; }
  @keyframes fadein { from { opacity: 0; } }
  .side-head { display: flex; }
  .new-chat { min-height: 46px; border-radius: 14px; }
  .conv-link { padding: 12px 10px; font-size: 15px; }
  .conv-btn { opacity: 1; width: 36px; height: 36px; }
  .msgs { padding: 14px 12px 6px; }
  .msg.user .msg-body { border-radius: 20px 20px 6px 20px; padding: 10px 14px; }
  .msg.assistant .msg-body { font-size: 15.5px; line-height: 1.7; }
  .msg-foot .msg-copy { min-height: 32px; padding: 4px 10px; }
  .composer-wrap { padding: 6px max(8px, env(safe-area-inset-right, 0px)) max(4px, env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px)); background: linear-gradient(transparent, var(--bg) 30%); }
  .composer { border-radius: 24px; padding: 5px; gap: 4px; box-shadow: 0 6px 24px rgba(80, 60, 20, .10); }
  .tool-btn { height: 42px; min-width: 42px; border-radius: 50%; padding: 0; justify-content: center; border: 0; background: transparent; }
  .tool-btn[aria-pressed="true"] { background: color-mix(in srgb, var(--gold) 18%, var(--panel)); }
  .send-btn { width: 42px; height: 42px; border-radius: 50%; }
  .composer textarea { padding: 9px 4px; }
  .disclaimer { display: none; }
  /* Empty state: compact, suggestions as a swipeable row */
  .chat-empty { padding: 4vh 0 8px; display: flex; flex-direction: column; min-height: 100%; }
  .chat-empty .hero-logo { width: 84px; height: 84px; }
  .chat-empty .hero-logo img { width: 52px; height: 52px; }
  .chat-empty h2 { font-size: 22px; padding: 0 16px; }
  .chat-empty > p { padding: 0 16px; }
  .suggestions { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 10px; padding: 4px 14px 8px; margin-top: auto; max-width: none; scrollbar-width: none; }
  .suggestions::-webkit-scrollbar { display: none; }
  .suggestion { flex: 0 0 72%; scroll-snap-align: start; min-height: 0; }
  .limit-box { margin: 0 0 8px; }
  .attach-row { margin: 0 2px 6px; }
  /* Site pages for signed-in people: bottom tab bar like an app */
  body.site.signed-in .site-main { padding-bottom: calc(86px + env(safe-area-inset-bottom, 0px)); }
  body.site.signed-in .site-footer { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
  body.site.signed-in .site-nav form.inline, body.site.signed-in .site-nav .user-chip { display: none; }
  .tabbar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); padding: 4px max(6px, env(safe-area-inset-right, 0px)) max(6px, env(safe-area-inset-bottom, 0px)) max(6px, env(safe-area-inset-left, 0px)); }
  .tabbar a { display: grid; justify-items: center; gap: 2px; padding: 6px 2px; min-height: 52px; color: var(--muted); text-decoration: none; font-size: 11.5px; font-weight: 600; border-radius: 12px; }
  .tabbar a[aria-current] { color: var(--green); }
  .tabbar a[aria-current] svg { stroke-width: 2.4; }
  .tabbar .badge { font-style: normal; min-width: 16px; height: 16px; font-size: 10px; }
  /* Comfortable touch targets */
  .lang-switch a { padding: 8px 10px; }
  .btn { min-height: 44px; }
  .btn-ghost.copy-btn, .code-actions button { min-height: 32px; }
  .admin-tabs { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; padding-bottom: 4px; }
  .admin-tabs a { white-space: nowrap; min-height: 40px; display: inline-flex; align-items: center; }
  input, select, textarea { font-size: 16px; }
}
@media (min-width: 761px) and (max-width: 1100px) { .chat { grid-template-columns: 250px 1fr; } }
@media (display-mode: standalone) and (max-width: 760px) { .tabbar { padding-bottom: max(10px, env(safe-area-inset-bottom, 0px)); } }
.chat-empty[hidden] { display: none !important; }
@media (max-width: 760px) { .suggestions { scroll-padding-inline: 14px; } .suggestion:last-child { margin-right: 14px; } }

/* ---------- Feedback, sources, AI training ---------- */
.vote { background: none; border: 1px solid transparent; border-radius: 8px; cursor: pointer; font-size: 14px; padding: 3px 7px; filter: grayscale(1); opacity: .65; }
.vote:hover { opacity: 1; filter: none; background: var(--panel-2); }
.vote[aria-pressed="true"] { opacity: 1; filter: none; border-color: var(--line-2); background: var(--panel); }
.why { grid-column: 2; display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.why input { flex: 1; min-width: 160px; padding: 8px 10px; border: 1px solid var(--line-2); border-radius: 10px; font: inherit; background: var(--panel); color: var(--text); }
.msg-sources { grid-column: 2; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; font-size: 12.5px; }
.msg-sources span { color: var(--faint); font-weight: 700; }
.msg-sources a { padding: 3px 9px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); text-decoration: none; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-sources a:hover { border-color: var(--gold); color: var(--text); }
.toast.ok { border-color: var(--ok); }
@media (max-width: 760px) { .why, .msg-sources { grid-column: 1; } .vote { min-height: 32px; } }
.tr-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 12px 0 6px; }
.tr-stats a { display: grid; gap: 2px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; text-decoration: none; color: var(--text); background: var(--panel); }
.tr-stats b { font-size: 22px; font-variant-numeric: tabular-nums; }
.tr-stats span { font-size: 12.5px; color: var(--muted); }
.training textarea { width: 100%; font: inherit; line-height: 1.5; }
#instructions_text { font-family: var(--mono); font-size: 13px; }
.tr-settings { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: end; }
.try-form { display: flex; gap: 8px; align-items: flex-end; }
.try-form textarea { flex: 1; }
.try-out { display: grid; gap: 8px; padding: 14px; border: 1px dashed var(--line-2); border-radius: 14px; margin-top: 10px; background: var(--panel); }
.try-answer, .fb-answer { white-space: pre-wrap; word-wrap: break-word; font-size: 14px; }
.fb-answer { max-height: 260px; overflow: auto; padding: 8px 10px; border-radius: 10px; background: var(--panel-2); margin-top: 6px; }
.kb-forms { display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px; }
.kb-form { padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.kb-form h3 { margin: 0 0 4px; font-size: 15px; }
.kb-search { display: flex; gap: 8px; margin: 14px 0 8px; }
.kb-search input { flex: 1; padding: 9px 12px; border: 1px solid var(--line-2); border-radius: 10px; font: inherit; }
.kb-list, .fb-list { display: grid; gap: 8px; }
.kb-item, .fb-item { display: flex; gap: 12px; justify-content: space-between; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.fb-item { display: grid; }
.fb-item p { margin: 0; }
.kb-item.off { opacity: .55; }
.kb-main { min-width: 0; display: grid; gap: 2px; }
.kb-main p { margin: 2px 0; }
.kb-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.kb-actions form { margin: 0; }
.kb-actions .btn { padding: 6px 12px; font-size: 13px; }
.tests-table td { vertical-align: top; }
.test-form { margin-top: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
@media (max-width: 760px) { .kb-forms, .tr-settings { grid-template-columns: 1fr; } .kb-item { flex-direction: column; } .try-form { flex-direction: column; align-items: stretch; } .tr-stats b { font-size: 18px; } }
.try-out[hidden] { display: none; }

/* ---------- Retry / regenerate, jump to latest ---------- */
.msg-retry { background: none; border: 1px solid var(--line-2); border-radius: 999px; color: var(--text); cursor: pointer; font: inherit; font-size: 12.5px; font-weight: 700; padding: 4px 12px; }
.msg-retry:hover { border-color: var(--gold); background: var(--panel); }
.msg.error .msg-retry { border-color: var(--fail); color: var(--fail); }
.msg-retry.regen { border-color: transparent; color: var(--muted); font-weight: 600; }
.msg-retry.regen:hover { color: var(--text); border-color: var(--line-2); }
.chat-main { position: relative; }
.to-bottom { position: absolute; left: 50%; bottom: 112px; transform: translateX(-50%); z-index: 6; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--panel); color: var(--text); font-size: 18px; cursor: pointer; box-shadow: var(--shadow); animation: popin .18s ease-out; }
.to-bottom[hidden] { display: none; }
@keyframes popin { from { opacity: 0; transform: translate(-50%, 6px); } }
@media (max-width: 760px) { .to-bottom { bottom: calc(96px + env(safe-area-inset-bottom, 0px)); } }

/* ================= Landing: download the app (with motion) ================= */
.btn-download { position: relative; overflow: hidden; margin-top: 18px; padding: 14px 26px; font-size: 16px; border-radius: 16px; border: 0; color: #fff; background: linear-gradient(135deg, #1E8A47, #0F6B35 60%, #B98A00); box-shadow: 0 12px 30px rgba(30,138,71,.28); animation: float 4s ease-in-out infinite; }
.btn-download:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 16px 36px rgba(30,138,71,.36); }
.btn-download::after { content: ""; position: absolute; top: 0; left: -60%; width: 40%; height: 100%; background: linear-gradient(100deg, transparent, rgba(255,255,255,.45), transparent); transform: skewX(-18deg); animation: shine 3.2s ease-in-out infinite; }
.btn-download .dl-ic { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: rgba(255,255,255,.18); animation: bob 1.6s ease-in-out infinite; }
.btn-download.installed, .store-btn.installed { opacity: .55; animation: none; }
@keyframes shine { 0%, 55% { left: -60%; } 100% { left: 130%; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes bob { 0%, 100% { transform: translateY(-2px); } 50% { transform: translateY(3px); } }
.hero-cta + .btn-download, .hero .btn-download { display: inline-flex; }

.get-app { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; margin: 56px auto 24px; padding: 40px; border-radius: 28px; border: 1px solid var(--line); background: radial-gradient(60% 80% at 100% 0%, color-mix(in srgb, var(--gold) 12%, transparent), transparent 70%), radial-gradient(60% 80% at 0% 100%, color-mix(in srgb, var(--green) 10%, transparent), transparent 70%), var(--panel); position: relative; overflow: hidden; }
.get-app::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 8px; background: var(--tibeb) repeat-x center / auto 100%; }
.get-app h2 { font-size: clamp(26px, 4vw, 38px); margin: 14px 0 8px; letter-spacing: -.01em; text-wrap: balance; }
.get-app-text p { max-width: 46ch; }
.store-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0; }
.store-btn { display: inline-flex; align-items: center; gap: 10px; padding: 10px 16px 10px 12px; border-radius: 14px; border: 1px solid #1B1A16; background: #1B1A16; color: #fff; cursor: pointer; font: inherit; text-align: left; transition: transform .15s, box-shadow .15s; }
.store-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(27,26,22,.25); }
.store-btn span { display: grid; line-height: 1.15; }
.store-btn small { font-size: 11px; opacity: .8; }
.store-btn b { font-size: 16px; }
.qr-box { display: flex; align-items: center; gap: 14px; padding: 12px; border: 1px dashed var(--line-2); border-radius: 16px; max-width: 360px; background: var(--bg); }
.qr-box img { background: #fff; border-radius: 8px; padding: 4px; }
.qr-box span { display: grid; gap: 2px; font-size: 14px; }

.phone-stage { position: relative; display: grid; place-items: center; min-height: 460px; }
.phone-glow { position: absolute; width: 300px; height: 300px; border-radius: 50%; background: conic-gradient(from 0deg, rgba(30,138,71,.35), rgba(185,138,0,.35), rgba(184,29,49,.3), rgba(30,138,71,.35)); filter: blur(40px); animation: spin 14s linear infinite; }
.phone { position: relative; width: 236px; height: 460px; border-radius: 38px; background: #111; padding: 10px; box-shadow: 0 30px 60px rgba(20,18,10,.28), inset 0 0 0 2px #2a2a2a; animation: float 6s ease-in-out infinite; display: flex; flex-direction: column; }
.phone > * { position: relative; }
.phone-notch { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); width: 70px; height: 18px; border-radius: 12px; background: #111; z-index: 2; }
.phone-bar { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 30px 10px 8px; background: #fff; border-radius: 28px 28px 0 0; font-size: 12px; color: #1B1A16; border-bottom: 1px solid #eee; }
.phone-bar img { border-radius: 5px; }
.phone-chat { flex: 1; background: #fff; padding: 10px; display: flex; flex-direction: column; gap: 8px; overflow: hidden; font-size: 11.5px; line-height: 1.4; color: #1B1A16; }
.pb { max-width: 84%; padding: 7px 10px; border-radius: 14px; opacity: 0; transform: translateY(8px) scale(.98); animation: bubble 12s ease-out infinite; }
.pb.user { align-self: flex-end; background: linear-gradient(135deg, #FFF3CC, #E7F5EC); border: 1px solid #E9E3D5; border-bottom-right-radius: 4px; }
.pb.ai { align-self: flex-start; background: #F7F4EC; border-bottom-left-radius: 4px; }
.b1 { animation-delay: 0s; } .b2 { animation-name: bubbleShort; animation-delay: 1s; } .b3 { animation-delay: 2.6s; } .b4 { animation-delay: 4.4s; } .b5 { animation-delay: 5.8s; }
@keyframes bubble { 0% { opacity: 0; transform: translateY(8px) scale(.98); } 6%, 88% { opacity: 1; transform: none; } 100% { opacity: 0; } }
@keyframes bubbleShort { 0% { opacity: 0; } 4%, 12% { opacity: 1; } 14%, 100% { opacity: 0; height: 0; padding: 0; margin: -4px 0; } }
.typing { display: inline-flex; gap: 3px; }
.typing i { width: 5px; height: 5px; border-radius: 50%; background: #8C8573; animation: dot 1s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 100% { opacity: .3; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-2px); } }
.code-chip { display: inline-block; margin-top: 3px; padding: 1px 6px; border-radius: 6px; background: #0B1220; color: #8BD3A5; font-family: var(--mono); font-size: 10px; }
.pb.art { position: relative; width: 140px; height: 100px; padding: 0; overflow: hidden; background: linear-gradient(#FFD27A, #F59E5B 60%, #B81D31); }
.art-sun { position: absolute; left: 50%; top: 22px; width: 34px; height: 34px; margin-left: -17px; border-radius: 50%; background: #FFF4C2; box-shadow: 0 0 24px #FFF4C2; }
.art-hill { position: absolute; left: -10%; right: -10%; bottom: -30px; height: 64px; border-radius: 50%; background: #1E8A47; }
.art-cup { position: absolute; right: 10px; bottom: 8px; font-size: 22px; }
.phone-input { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin: 0; padding: 8px 8px 10px; background: #fff; border-radius: 0 0 28px 28px; font-size: 11px; color: #8C8573; }
.phone-input span { flex: 1; padding: 7px 10px; border: 1px solid #E9E3D5; border-radius: 999px; }
.phone-input i { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: #1E8A47; color: #fff; font-style: normal; font-weight: 800; }
@media (max-width: 860px) {
  .get-app { grid-template-columns: 1fr; padding: 28px 18px; gap: 18px; text-align: center; }
  .get-app-text p { margin-left: auto; margin-right: auto; }
  .store-row { justify-content: center; }
  .qr-box { display: none; }
  .phone-stage { min-height: 400px; transform: scale(.88); margin: -20px 0; }
}
@media (prefers-reduced-motion: reduce) { .pb { opacity: 1; transform: none; } .b2 { display: none; } }
.install-card ol[hidden] { display: none; }

/* ================= Android-style app (Material 3) on phones ================= */
.m-appbar, .sheet, .chat-avatar { display: none; }
.m-avatar { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; border: 0; padding: 0; overflow: hidden; background: linear-gradient(135deg, var(--green), var(--gold)); color: #fff; font: 700 15px/1 var(--font); cursor: pointer; flex-shrink: 0; }
.m-avatar img { width: 100%; height: 100%; object-fit: cover; }
.m-avatar.sm { width: 26px; height: 26px; font-size: 12px; }
.m-avatar.lg { width: 48px; height: 48px; font-size: 20px; }
.has-ripple { position: relative; overflow: hidden; }
.ripple { position: absolute; border-radius: 50%; background: currentColor; opacity: .16; transform: scale(0); animation: ripple .55s ease-out forwards; pointer-events: none; }
@keyframes ripple { to { transform: scale(1); opacity: 0; } }
.sheet { position: fixed; inset: 0; z-index: 60; background: rgba(20, 18, 10, 0); transition: background .22s; }
.sheet:not([hidden]) { display: block; }
.sheet.open { background: rgba(20, 18, 10, .4); }
.sheet-panel { position: absolute; left: 0; right: 0; bottom: 0; max-width: 560px; margin: 0 auto; max-height: 88vh; overflow-y: auto; background: #FBF8F1; border-radius: 28px 28px 0 0; padding: 8px 16px max(16px, env(safe-area-inset-bottom, 0px)); transform: translateY(100%); transition: transform .24s cubic-bezier(.2, .8, .2, 1); box-shadow: 0 -8px 30px rgba(30, 25, 10, .18); }
.sheet.open .sheet-panel { transform: none; }
.sheet-handle { width: 32px; height: 4px; border-radius: 2px; background: #C9C1AE; margin: 8px auto 14px; }
.sheet-who { display: flex; align-items: center; gap: 14px; padding: 4px 8px 14px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.sheet-who span:last-child { display: grid; min-width: 0; }
.sheet-who b { font-size: 17px; font-weight: 600; }
.sheet-who small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-list { display: grid; }
.sheet-item { display: flex; align-items: center; gap: 16px; width: 100%; min-height: 56px; padding: 0 16px; border: 0; border-radius: 28px; background: none; color: var(--text); font: 500 16px/1 var(--font); text-decoration: none; cursor: pointer; text-align: left; }
.sheet-item[hidden] { display: none; }
.sheet-item > span:first-child { width: 24px; text-align: center; font-size: 18px; }
.sheet-item:hover, .sheet-item:active { background: #EFEADD; color: var(--text); }
.sheet-item.danger { color: var(--fail); }
.sheet-lang { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0; padding: 4px; border-radius: 999px; background: #EFEADD; }
.sheet-lang a { text-align: center; padding: 10px; border-radius: 999px; color: var(--muted); text-decoration: none; font-weight: 600; }
.sheet-lang a[aria-current] { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.sheet form { margin: 0; }
.dl-note { margin-top: 10px; }
.btn-download-lg { font-size: 18px; padding: 16px 30px; }

@media (max-width: 760px) {
  :root { --m-surface: #FFFDF8; --m-container: #F3EFE6; --m-container-hi: #EAE5D8; --m-primary-container: #CDEFD7; --m-on-primary-container: #0B3D1E; }
  html { -webkit-tap-highlight-color: transparent; }
  body.signed-in { background: var(--m-surface); }
  .m-appbar, .tabbar, .chat-top, .sheet, .conv { -webkit-user-select: none; user-select: none; }

  /* Pages for signed-in people: app bar instead of the website header */
  body.site.signed-in .header-wrap, body.site.signed-in .site-footer { display: none; }
  body.site.signed-in .m-appbar { display: flex; align-items: center; gap: 4px; position: sticky; top: 0; z-index: 25; min-height: 64px; padding: max(8px, env(safe-area-inset-top, 0px)) 12px 8px 4px; background: var(--m-surface); transition: background .2s, box-shadow .2s; }
  body.site.signed-in.scrolled .m-appbar { background: var(--m-container); }
  .m-icon { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; color: var(--text); }
  .m-icon:hover { color: var(--text); }
  .m-title { flex: 1; min-width: 0; margin: 0 0 0 4px; font-size: 22px; font-weight: 500; letter-spacing: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  body.site.signed-in .site-main { padding-top: 8px; }
  body.site.signed-in .site-main .tibeb, body.site.signed-in .plan::before { display: none; }

  /* Bottom navigation bar with the pill indicator */
  .tabbar { background: var(--m-container); backdrop-filter: none; -webkit-backdrop-filter: none; border-top: 0; padding-top: 12px; min-height: 80px; }
  .tabbar a, .tabbar button { display: grid; justify-items: center; align-content: start; gap: 4px; padding: 0 2px 6px; min-height: 56px; border: 0; background: none; color: #4A4639; font: 500 12px/1.2 var(--font); text-decoration: none; cursor: pointer; border-radius: 16px; }
  .tabbar a svg, .tabbar button .m-avatar { box-sizing: content-box; width: 24px; height: 24px; padding: 4px 20px; border-radius: 16px; transition: background .2s; }
  .tabbar button .m-avatar { width: 24px; height: 24px; padding: 0; margin: 4px 20px; font-size: 11px; }
  .tabbar a[aria-current] { color: var(--text); font-weight: 700; }
  .tabbar a[aria-current] svg { background: var(--m-primary-container); color: var(--m-on-primary-container); stroke-width: 2.2; }
  .tabbar .ripple { display: none; }

  /* Chat screen */
  .chat-main::before { display: none; }
  body.app .chat-main { background: var(--m-surface); }
  .chat-top { min-height: 64px; box-shadow: none; background: var(--m-surface); }
  .chat-top .icon-btn { width: 48px; height: 48px; border-radius: 50%; }
  .chat-title { text-align: left; font-size: 20px; font-weight: 500; margin-left: 2px; }
  .chat-avatar { display: inline-grid; margin: 0 6px 0 2px; }
  .chat-side { background: #FBF8F1; border-radius: 0 16px 16px 0; padding-left: 12px; padding-right: 12px; }
  .side-brand span { font-size: 18px; }
  .new-chat { background: var(--m-primary-container); color: var(--m-on-primary-container); border-radius: 16px; min-height: 56px; box-shadow: 0 1px 3px rgba(0,0,0,.12); font-weight: 600; justify-content: flex-start; padding-left: 20px; }
  .side-label { text-transform: none; letter-spacing: 0; font-size: 14px; font-weight: 600; color: var(--muted); padding: 14px 16px 4px; }
  .conv { border-radius: 28px; border: 0; min-height: 52px; }
  .conv.active { background: var(--m-primary-container); box-shadow: none; }
  .conv.active .conv-link { color: var(--m-on-primary-container); font-weight: 600; }
  .conv-link { padding: 14px 16px; }
  .msg.user .msg-body { background: var(--m-container-hi); border: 0; border-radius: 22px 22px 6px 22px; padding: 11px 16px; }
  .msg.assistant::before { display: block; width: 28px; height: 28px; background-size: 20px; box-shadow: none; grid-row: auto; margin-bottom: 6px; }
  .composer-wrap { background: var(--m-surface); padding-top: 4px; }
  .composer { border: 0; border-radius: 28px; background: var(--m-container); box-shadow: none; padding: 4px 4px 4px 6px; min-height: 56px; align-items: center; }
  .composer:focus-within { box-shadow: none; background: var(--m-container-hi); border: 0; }
  .send-btn { width: 48px; height: 48px; background: var(--primary-solid); font-size: 20px; }
  .send-btn:disabled { opacity: 1; background: transparent; color: #A39C88; }
  .tool-btn { width: 44px; height: 44px; color: #4A4639; }
  .suggestion { border: 0; background: var(--m-container); border-radius: 16px; padding: 14px 16px; }
  .suggestion b { color: var(--green); }
  .to-bottom { background: var(--m-container-hi); border: 0; box-shadow: 0 3px 8px rgba(0,0,0,.15); width: 48px; height: 48px; border-radius: 16px; }
  .msg-retry, .regen { border-radius: 20px; min-height: 40px; }
  .toast { border-radius: 4px; background: #322F27; color: #F5F0E6; border: 0; bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }

  /* Cards and buttons on app pages */
  body.signed-in .btn { border-radius: 999px; }
  body.signed-in .card, body.signed-in .plan { border-radius: 24px; box-shadow: none; border: 0; background: var(--m-container); }
  body.signed-in .plan-best { background: #EAF5E9; border: 0; }
  body.signed-in input, body.signed-in textarea, body.signed-in select { border-radius: 12px; }
}
@media (max-width: 760px) and (prefers-reduced-motion: reduce) { .sheet-panel { transition: none; } }

/* ================= Update 7: Gemini-inspired look, dark mode, voice, translation, motion ================= */
:root { --bubble: linear-gradient(135deg, #EEF6EE, #FBF3DD); --bubble-text: var(--text); --surface-1: #FBF8F1; --surface-2: #F3EFE6; --surface-3: #EAE5D8;
  --greet: linear-gradient(90deg, #1E8A47 0%, #7A9A1C 35%, #C58B00 65%, #C2364A 100%); --ease: cubic-bezier(.2, .8, .2, 1); }

/* ---- Dark mode (Auto follows the phone; Light/Dark can be chosen in the Me menu or chat settings) ---- */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #131314; --bg-2: #1A1B1C; --panel: #1E1F20; --panel-2: #282A2C; --line: #2F3133; --line-2: #3C3F42;
  --text: #E8E6E1; --muted: #B4B0A6; --faint: #8E8A80;
  --green: #4CC27A; --green-2: #8BC34A; --gold: #E8B730; --gold-2: #F2C94C; --red: #F0646F;
  --primary: linear-gradient(135deg, #2FA35A, #5E9A22); --primary-solid: #2FA35A; --ok: #4CC27A; --warn: #E8B730; --fail: #F0646F;
  --shadow: 0 14px 40px rgba(0, 0, 0, .35);
  --bubble: linear-gradient(135deg, #22322A, #33301F); --surface-1: #1B1C1D; --surface-2: #232526; --surface-3: #2D2F31;
  --greet: linear-gradient(90deg, #4CC27A 0%, #A5C94A 35%, #F2C94C 65%, #F0646F 100%);
  --m-surface: #131314; --m-container: #1E1F20; --m-container-hi: #2A2C2E; --m-primary-container: #1E4D32; --m-on-primary-container: #CDEFD7;
  --lattice: none;
}
:root[data-theme="dark"] body { background: var(--bg); }
:root[data-theme="dark"] .site-header { background: color-mix(in srgb, var(--bg) 85%, transparent); }
:root[data-theme="dark"] .tibeb { opacity: .55; }
:root[data-theme="dark"] .sheet-panel, :root[data-theme="dark"] .chat-side { background: var(--surface-1); }
:root[data-theme="dark"] .sheet-item:hover, :root[data-theme="dark"] .sheet-item:active, :root[data-theme="dark"] .sheet-lang { background: var(--surface-3); }
:root[data-theme="dark"] .sheet-lang a[aria-current] { background: var(--panel-2); color: var(--text); }
:root[data-theme="dark"] .sheet-handle { background: #5A5C5E; }
:root[data-theme="dark"] input, :root[data-theme="dark"] select, :root[data-theme="dark"] textarea { background: var(--panel); color: var(--text); border-color: var(--line-2); }
:root[data-theme="dark"] .btn-ghost { color: var(--text); border-color: var(--line-2); }
:root[data-theme="dark"] .btn-google { background: #1E1F20; color: #E8E6E1; border-color: #3C3F42; }
:root[data-theme="dark"] .msg.assistant::before { background-color: #fff; }
:root[data-theme="dark"] .composer textarea { background: transparent; border: 0; }
:root[data-theme="dark"] .hero-logo img { filter: drop-shadow(0 0 8px rgba(255,255,255,.15)); }
:root[data-theme="dark"] .tabbar a, :root[data-theme="dark"] .tabbar button { color: var(--muted); }
:root[data-theme="dark"] .tabbar a[aria-current] { color: var(--text); }
:root[data-theme="dark"] .codeblock { border-color: var(--line-2); }
:root[data-theme="dark"] .get-app, :root[data-theme="dark"] .feature, :root[data-theme="dark"] .card, :root[data-theme="dark"] .plan { background-color: var(--panel); }
:root[data-theme="dark"] .msg-body a { color: var(--gold); }
:root[data-theme="dark"] .alert { color: #FFD7DA; } :root[data-theme="dark"] .notice-box { color: #D4F5DF; }
.theme-btn { padding: 6px 10px; min-width: 40px; }
.theme-btn .ic-moon { display: none; }
:root[data-theme="dark"] .theme-btn .ic-sun { display: none; } :root[data-theme="dark"] .theme-btn .ic-moon { display: inline; }
@media (max-width: 760px) { .theme-btn { display: none; } }

/* ---- Gemini-inspired chat: soft bubbles, gradient greeting, airy spacing ---- */
.chat-empty h2 { background: var(--greet); -webkit-background-clip: text; background-clip: text; color: transparent; font-size: clamp(26px, 4.4vw, 40px); font-weight: 600; letter-spacing: -.01em; line-height: 1.2; }
.msgs { gap: 26px; }
.msg.user .msg-body { background: var(--bubble); border: 0; border-radius: 24px 24px 8px 24px; padding: 12px 18px; box-shadow: 0 1px 2px rgba(0, 0, 0, .04); line-height: 1.6; }
.msg.assistant .msg-body { font-size: 16px; line-height: 1.75; }
.msg.assistant::before { box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 14%, transparent); }
.composer { border-radius: 28px; background: var(--panel); transition: box-shadow .2s, border-color .2s, background .2s; }
.composer:focus-within { border-color: transparent; box-shadow: 0 0 0 2px color-mix(in srgb, var(--green) 55%, transparent), var(--shadow); }
.suggestion { border-radius: 18px; transition: transform .18s var(--ease), box-shadow .18s, background .18s; }
.suggestion:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0, 0, 0, .06); }
.icon-btn.always { display: inline-flex; }
.chat-top .icon-btn.always { width: 40px; height: 40px; padding: 0; justify-content: center; align-items: center; border-radius: 50%; }

/* ---- Message tools: read aloud, translate ---- */
.msg-foot { flex-wrap: wrap; gap: 4px 6px; }
.msg-tool { display: inline-flex; align-items: center; gap: 5px; min-height: 34px; padding: 4px 11px; border: 0; border-radius: 999px; background: none; color: var(--muted); font: inherit; font-size: 12.5px; cursor: pointer; }
.msg-tool:hover { background: var(--panel-2); color: var(--text); }
.msg-tool.on { background: color-mix(in srgb, var(--green) 16%, transparent); color: var(--green); }
.msg-tool.on span:first-child { animation: pulseDot 1.2s ease-in-out infinite; }
@media (max-width: 760px) { .msg-tool .tool-text { display: none; } .msg-tool { min-width: 40px; min-height: 40px; justify-content: center; font-size: 15px; } }
.msg-trans { grid-column: 2; margin-top: 10px; padding: 12px 14px; border-radius: 18px; background: var(--surface-2); animation: msgIn .28s var(--ease) both; }
.msg-trans[hidden] { display: none; }
.trans-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.trans-body { font-size: 15.5px; }
.orig-note { align-self: flex-end; margin-top: 4px; border: 0; background: none; color: var(--faint); font: inherit; font-size: 12px; cursor: pointer; padding: 4px 8px; border-radius: 999px; }
.orig-note:hover, .orig-note.on { color: var(--text); background: var(--panel-2); }
.thinking-line { display: block; height: 12px; margin: 6px 0; border-radius: 6px; background: linear-gradient(90deg, var(--panel-2), var(--surface-3), var(--panel-2)); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
.thinking-line.short { width: 60%; }
@media (max-width: 760px) { .msg-trans { grid-column: 1; } }

/* ---- Voice input ---- */
.mic-btn { position: relative; }
.mic-btn.rec { color: #fff; background: var(--red) !important; }
.mic-btn.rec::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--red); animation: micPulse 1.3s ease-out infinite; pointer-events: none; }
@keyframes micPulse { 0% { transform: scale(.9); opacity: .9; } 100% { transform: scale(1.45); opacity: 0; } }
.mic-status { display: flex; align-items: center; gap: 10px; max-width: 820px; margin: 0 auto 8px; padding: 8px 14px; border-radius: 999px; background: color-mix(in srgb, var(--red) 10%, var(--panel)); color: var(--text); font-size: 13.5px; animation: msgIn .2s var(--ease) both; }
.mic-status[hidden] { display: none; }
.mic-status.busy { background: var(--surface-2); }
.mic-status.busy .mic-wave i { background: var(--green); }
.mic-wave { display: inline-flex; align-items: center; gap: 3px; height: 18px; }
.mic-wave i { width: 3px; height: 6px; border-radius: 2px; background: var(--red); animation: wave 1s ease-in-out infinite; }
.mic-wave i:nth-child(2) { animation-delay: .1s; } .mic-wave i:nth-child(3) { animation-delay: .2s; } .mic-wave i:nth-child(4) { animation-delay: .3s; } .mic-wave i:nth-child(5) { animation-delay: .4s; }
@keyframes wave { 0%, 100% { height: 5px; } 50% { height: 18px; } }
.mine-note { max-width: 820px; margin: 0 auto 6px; padding: 0 14px; font-size: 12.5px; color: var(--muted); }
.mine-note[hidden] { display: none; }
.send-btn.working { animation: spin .9s linear infinite; }

/* ---- Thinking animation ---- */
.thinking { display: inline-flex; align-items: center; gap: 12px; padding: 6px 0; }
.think-orb { width: 22px; height: 22px; border-radius: 50%; background: conic-gradient(from 0deg, var(--green), var(--gold), var(--red), var(--green)); animation: spin 1.1s linear infinite, breathe 1.6s ease-in-out infinite; -webkit-mask: radial-gradient(circle, transparent 42%, #000 44%); mask: radial-gradient(circle, transparent 42%, #000 44%); }
.thinking-text { background: linear-gradient(90deg, var(--muted) 0%, var(--text) 40%, var(--muted) 80%); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimmer 1.6s linear infinite; font-weight: 500; }
.img-wait { display: flex; align-items: center; gap: 12px; }
.img-shimmer { width: 120px; height: 120px; border-radius: 18px; background: linear-gradient(110deg, var(--panel-2) 8%, var(--surface-3) 18%, var(--panel-2) 33%); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes breathe { 0%, 100% { transform: scale(.9); } 50% { transform: scale(1.08); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulseDot { 50% { opacity: .4; } }

/* ---- Messages fade and slide in ---- */
.msg { animation: msgIn .32s var(--ease) both; }
.msg.user { animation-name: msgInRight; }
.msgs.no-anim .msg { animation: none; }
@keyframes msgIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes msgInRight { from { opacity: 0; transform: translate(12px, 6px) scale(.98); } to { opacity: 1; transform: none; } }
.cursor { animation: blink 1s steps(2) infinite, none; transition: opacity .2s; }

/* ---- Subtle press feedback on every button ---- */
.btn, .send-btn, .tool-btn, .icon-btn, .msg-tool, .vote, .suggestion, .sheet-item, .tabbar a, .tabbar button, .m-icon, .m-avatar, .msg-retry, .sheet-theme button { transition: transform .12s var(--ease), background-color .15s, color .15s, box-shadow .15s; }
.btn:active, .send-btn:active:not(:disabled), .tool-btn:active, .icon-btn:active, .msg-tool:active, .vote:active, .suggestion:active, .sheet-item:active, .tabbar a:active, .tabbar button:active, .m-icon:active, .m-avatar:active, .msg-retry:active, .sheet-theme button:active { transform: scale(.94); }

/* ---- Settings sheet ---- */
.sheet-title { font-size: 20px; font-weight: 600; margin: 0 8px 12px; }
.set-row { display: grid; gap: 8px; padding: 12px 8px; border-bottom: 1px solid var(--line); }
.set-row span, .set-switch span { display: grid; gap: 2px; }
.set-row small, .set-switch small { color: var(--muted); font-size: 12.5px; font-weight: 400; }
.set-row select { min-height: 48px; border-radius: 14px; font-size: 16px; padding: 0 12px; }
.set-switch { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 8px; border-bottom: 1px solid var(--line); cursor: pointer; }
.set-switch input { appearance: none; -webkit-appearance: none; width: 52px; height: 32px; flex-shrink: 0; border-radius: 999px; background: var(--surface-3); border: 2px solid var(--line-2); position: relative; cursor: pointer; transition: background .2s, border-color .2s; padding: 0; margin: 0; }
.set-switch input::after { content: ""; position: absolute; top: 4px; left: 4px; width: 20px; height: 20px; border-radius: 50%; background: var(--muted); transition: transform .2s var(--ease), background .2s, width .2s; }
.set-switch input:checked { background: var(--primary-solid); border-color: var(--primary-solid); }
.set-switch input:checked::after { transform: translateX(20px); background: #fff; }
.set-label { margin: 14px 8px 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.sheet-theme { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 6px 0 12px; padding: 4px; border-radius: 999px; background: var(--surface-2); }
.sheet-theme button { min-height: 44px; border: 0; border-radius: 999px; background: none; color: var(--muted); font: 600 14px/1 var(--font); cursor: pointer; }
.sheet-theme button[aria-pressed="true"] { background: var(--panel); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .14); }
#chatSettings .btn-block { margin-top: 10px; min-height: 52px; }
.sheet-panel { scrollbar-width: thin; }
@media (min-width: 761px) { .sheet { display: none; } .sheet:not([hidden]) { display: block; } .sheet-panel { bottom: auto; top: 50%; border-radius: 28px; transform: translateY(-40%) scale(.97); opacity: 0; transition: transform .22s var(--ease), opacity .22s; } .sheet.open .sheet-panel { transform: translateY(-50%); opacity: 1; } }

/* ---- Easy to read and tap on phones ---- */
@media (max-width: 760px) {
  body { font-size: 16px; }
  .composer textarea { font-size: 17px; line-height: 1.45; }
  .tool-btn, .send-btn { min-width: 46px; min-height: 46px; }
  .msg.user .msg-body { font-size: 16px; }
  .chat-empty h2 { font-size: 30px; padding: 0 20px; text-align: left; }
  .chat-empty > p { text-align: left; padding: 0 20px; }
  .chat-empty .hero-logo { margin-left: 20px; }
  .chat-top .icon-btn.always { width: 48px; height: 48px; }
  .mic-status { margin: 0 4px 6px; }
}
@media (prefers-reduced-motion: reduce) { .msg, .msg-trans, .mic-status { animation: none !important; } }

/* ================= Update 8: Claude-style interface (cream / charcoal, serif headings, side panel) ================= */
:root {
  --bg: #FAF9F5; --bg-2: #F4F2EC; --panel: #FFFFFF; --panel-2: #F0EEE6; --line: #E7E4DA; --line-2: #D8D4C7;
  --text: #1F1E1C; --muted: #6B6862; --faint: #918E86;
  --green: #1E7A43; --green-2: #4C7A1A; --gold: #A8730B; --gold-2: #8A5E06; --red: #B3261E;
  --primary: #1E7A43; --primary-solid: #1E7A43; --on-primary: #FFFFFF; --ok: #1E7A43; --warn: #A8730B; --fail: #B3261E;
  --shadow: 0 1px 2px rgba(31, 30, 28, .05), 0 8px 24px rgba(31, 30, 28, .06);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Charter, Georgia, "Noto Serif Ethiopic", "Abyssinica SIL", serif;
  --bubble: #F0EEE6; --surface-1: #F4F2EC; --surface-2: #F0EEE6; --surface-3: #E7E4DA; --greet: none;
  --m-surface: #FAF9F5; --m-container: #F0EEE6; --m-container-hi: #E9E6DC; --m-primary-container: #E3EFE6; --m-on-primary-container: #14532D;
  --lattice: none; --side-w: 272px; --panel-w: min(46vw, 680px);
}
:root[data-theme="dark"] {
  --bg: #1A1918; --bg-2: #201F1D; --panel: #262624; --panel-2: #2F2E2B; --line: #383733; --line-2: #4A4843;
  --text: #ECEAE4; --muted: #A9A69C; --faint: #87847B;
  --green: #4DB57A; --green-2: #8BC34A; --gold: #D9A93D; --gold-2: #E8BE5A; --red: #EF6B63;
  --primary: #2E8B57; --primary-solid: #2E8B57; --ok: #4DB57A; --warn: #D9A93D; --fail: #EF6B63;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .35);
  --bubble: #2F2E2B; --surface-1: #201F1D; --surface-2: #2A2927; --surface-3: #34332F;
  --m-surface: #1A1918; --m-container: #262624; --m-container-hi: #2F2E2B; --m-primary-container: #1F3D2B; --m-on-primary-container: #CDEFD7;
}
body { background: var(--bg); }
h1, h2, h3, .chat-empty h2, .chat-title, .m-title, .panel-title, .sheet-title, .pricing-head h1, .hero h1 { font-family: var(--serif); font-weight: 500; letter-spacing: -.005em; }
.btn-primary { background: var(--primary-solid); box-shadow: none; }
.btn-primary:hover { box-shadow: none; filter: brightness(1.06); }
body.signed-in .tibeb, .tabbar { display: none !important; }
body.site.signed-in .site-main { padding-bottom: 32px; }
.chat-main::before { display: none; }

/* ---- Layout: sidebar | reading column | side panel ---- */
.chat { grid-template-columns: var(--side-w) minmax(0, 1fr); transition: grid-template-columns .26s var(--ease); }
body.panel-open .chat { grid-template-columns: var(--side-w) minmax(0, 1fr) var(--panel-w); }
body.side-collapsed .chat { grid-template-columns: 0 minmax(0, 1fr); }
body.side-collapsed.panel-open .chat { grid-template-columns: 0 minmax(0, 1fr) var(--panel-w); }
body.side-collapsed .chat-side { visibility: hidden; overflow: hidden; padding: 0; }
.chat-side { background: var(--bg-2); border-right: 1px solid var(--line); padding: 12px 10px; gap: 6px; }
.chat-side::before { display: none; }
.side-head { display: flex; align-items: center; gap: 6px; }
.side-brand { flex: 1; font-family: var(--serif); font-size: 18px; }
.side-brand b { background: none; -webkit-background-clip: initial; background-clip: initial; color: var(--green); }
.side-collapse { display: inline-grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 10px; background: none; color: var(--muted); cursor: pointer; }
.side-collapse:hover { background: var(--panel-2); color: var(--text); }
.new-chat { background: var(--panel); color: var(--text); border: 1px solid var(--line-2); box-shadow: none; border-radius: 12px; min-height: 40px; justify-content: flex-start; font-weight: 600; }
.new-chat:hover { background: var(--panel-2); color: var(--text); }
.side-select { display: grid; gap: 4px; padding: 6px 4px; font-size: 12px; color: var(--muted); font-weight: 600; }
.side-select select { width: 100%; min-height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font: inherit; font-size: 14px; font-weight: 500; padding: 0 10px; }
.side-label { text-transform: none; letter-spacing: 0; font-size: 12px; font-weight: 600; color: var(--faint); padding: 10px 10px 2px; }
.conv { border-radius: 10px; border: 0; }
.conv:hover { background: var(--panel-2); }
.conv.active { background: var(--surface-3); box-shadow: none; }
.conv-link { font-size: 14px; padding: 8px 10px; }
.chat-top { border-bottom: 0; background: var(--bg); backdrop-filter: none; padding: 8px 16px; min-height: 52px; }
.chat-title { font-size: 16px; text-align: left; }
.chat-top .model-badge { display: none; }
body.side-collapsed .chat-top #toggleSide { display: inline-flex; }

/* ---- Reading column ---- */
.msgs { max-width: 48rem; padding: 18px 20px 24px; gap: 28px; }
.chat-empty { max-width: 48rem; padding-top: 14vh; }
.chat-empty h2 { background: none; color: var(--text); -webkit-background-clip: initial; background-clip: initial; font-size: clamp(28px, 4vw, 40px); font-weight: 400; }
.chat-empty .hero-logo { width: 56px; height: 56px; margin-bottom: 4px; }
.chat-empty .hero-logo::before { display: none; }
.chat-empty .hero-logo img { width: 44px; height: 44px; }
.suggestion { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: none; }
.suggestion:hover { border-color: var(--line-2); background: var(--panel-2); transform: none; box-shadow: none; }
.suggestion b { color: var(--muted); font-weight: 600; }
.msg.assistant { grid-template-columns: 1fr; }
.msg.assistant::before { display: none; }
.msg-foot, .msg-sources, .msg-trans, .actions-box, .thoughts { grid-column: 1; }
.msg.assistant .msg-body { font-size: 16.5px; line-height: 1.72; padding-top: 0; }
.msg-body h2, .msg-body h3, .msg-body h4 { font-family: var(--serif); font-weight: 600; }
.msg.user { align-items: flex-end; }
.msg.user .msg-body { background: var(--bubble); border: 0; border-radius: 18px; padding: 10px 16px; max-width: min(80%, 36rem); box-shadow: none; font-size: 16px; }
.codeblock { border-radius: 12px; border-color: var(--line); background: #1E1D1B; }
.code-head { background: var(--panel-2); }
.open-code, .dl-code { background: none; border: 0; color: var(--muted); cursor: pointer; font: inherit; font-size: 12px; padding: 3px 8px; border-radius: 6px; }
.open-code:hover, .dl-code:hover { color: var(--text); background: var(--panel); }
/* subtle controls: shown on hover (always on touch screens) */
.msg-foot { opacity: .0; transition: opacity .15s; }
.msg.assistant:hover .msg-foot, .msg.assistant:focus-within .msg-foot, .msg.assistant:last-child .msg-foot, .msg.error .msg-foot { opacity: 1; }
.user-tools { display: flex; gap: 2px; justify-content: flex-end; opacity: 0; transition: opacity .15s; margin-top: 2px; }
.msg.user:hover .user-tools, .msg.user:focus-within .user-tools { opacity: 1; }
@media (hover: none) { .msg-foot, .user-tools { opacity: 1; } }
.user-tools .msg-tool { min-height: 30px; padding: 2px 9px; }
.msg.editing { align-items: stretch; }
.edit-box { display: grid; gap: 8px; width: 100%; max-width: 48rem; margin-left: auto; }
.edit-box textarea { width: 100%; border-radius: 14px; border: 1px solid var(--line-2); background: var(--panel); color: var(--text); font: inherit; font-size: 16px; padding: 12px 14px; resize: vertical; }
.edit-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* ---- Thought process accordion ---- */
.thoughts { margin: 0 0 10px; border-radius: 12px; }
.thoughts summary { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px 6px 8px; border-radius: 999px; color: var(--muted); font-size: 13.5px; cursor: pointer; list-style: none; user-select: none; }
.thoughts summary::-webkit-details-marker { display: none; }
.thoughts summary::after { content: "›"; font-size: 15px; transition: transform .2s; }
.thoughts[open] summary::after { transform: rotate(90deg); }
.thoughts summary:hover { background: var(--panel-2); color: var(--text); }
.thoughts:not(.live) .think-orb { animation: none; opacity: .55; }
.thoughts.live .th-label { background: linear-gradient(90deg, var(--muted) 0%, var(--text) 40%, var(--muted) 80%); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimmer 1.6s linear infinite; }
.think-orb.sm { width: 14px; height: 14px; }
.thoughts-body { margin: 6px 0 2px 10px; padding: 4px 0 4px 14px; border-left: 2px solid var(--line-2); color: var(--muted); font-size: 13.5px; line-height: 1.6; white-space: pre-wrap; max-height: 260px; overflow-y: auto; }

/* ---- Action pills and approval cards ---- */
.actions-box { display: grid; gap: 8px; margin: 10px 0 4px; }
.action-card { border: 1px solid var(--line); border-radius: 14px; background: var(--panel); padding: 10px 12px; animation: msgIn .25s var(--ease) both; font-size: 14px; }
.action-card.st-pending_approval { border-color: color-mix(in srgb, var(--warn) 55%, var(--line)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--warn) 12%, transparent); }
.ac-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ac-icon { font-size: 16px; }
.ac-pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--panel-2); color: var(--muted); }
.st-running .ac-pill { background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--warn); }
.st-done .ac-pill { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.st-failed .ac-pill, .st-rejected .ac-pill { background: color-mix(in srgb, var(--fail) 12%, transparent); color: var(--fail); }
.st-pending_approval .ac-pill { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.ac-details { margin-left: auto; font-size: 12.5px; }
.spin { width: 11px; height: 11px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; }
.ac-fields { display: grid; gap: 8px; margin: 10px 0 6px; }
.ac-fields label { display: grid; gap: 3px; font-size: 12.5px; color: var(--muted); }
.ac-fields input, .ac-fields textarea { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font: inherit; font-size: 14px; color: var(--text); background: var(--bg); resize: vertical; }
.ac-fields input[readonly], .ac-fields textarea[readonly] { background: var(--panel-2); border-color: transparent; }
.ac-note { margin: 4px 0 8px; font-size: 13px; color: var(--muted); }
.ac-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.ac-params, .ac-result { margin-top: 6px; font-size: 13px; color: var(--muted); word-break: break-word; }
.ac-result { color: var(--text); }

/* ---- Floating composer ---- */
.composer-wrap { padding: 0 20px 6px; background: linear-gradient(transparent, var(--bg) 28%); }
.composer { flex-wrap: wrap; align-items: center; max-width: 48rem; padding: 6px 8px 8px; gap: 4px; border: 1px solid var(--line-2); border-radius: 22px; background: var(--panel); box-shadow: var(--shadow); }
.composer:focus-within { border-color: color-mix(in srgb, var(--green) 45%, var(--line-2)); box-shadow: var(--shadow), 0 0 0 3px color-mix(in srgb, var(--green) 12%, transparent); }
.composer textarea { order: -1; flex: 1 1 100%; padding: 10px 10px 6px; font-size: 16px; max-height: 260px; }
.composer-gap { flex: 1; }
.tool-btn { border: 0; background: none; color: var(--muted); border-radius: 10px; height: 36px; min-width: 36px; padding: 0 8px; }
.tool-btn:hover { background: var(--panel-2); color: var(--text); }
.tool-btn[aria-pressed="true"] { background: var(--m-primary-container); color: var(--m-on-primary-container); }
.task-chip { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); }
.task-chip select { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 13px; font-weight: 600; padding: 6px 10px; max-width: 190px; cursor: pointer; appearance: none; -webkit-appearance: none; }
.task-chip.on { border-color: color-mix(in srgb, var(--green) 40%, var(--line)); background: var(--m-primary-container); }
.task-chip.on select { color: var(--m-on-primary-container); }
.send-btn { width: 36px; height: 36px; border-radius: 10px; background: var(--primary-solid); font-size: 17px; }
.send-btn:disabled { background: var(--panel-2); color: var(--faint); opacity: 1; }
.disclaimer { display: block; font-size: 11.5px; color: var(--faint); margin: 6px 0 4px; }
body.call-mode .composer { opacity: .5; pointer-events: none; }
.to-bottom { background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); color: var(--text); }

/* ---- Side panel (code, preview, documents, call logs) ---- */
.panel { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; border-left: 1px solid var(--line); background: var(--panel); opacity: 0; transform: translateX(24px); transition: opacity .24s var(--ease), transform .26s var(--ease); }
body.panel-open .panel { opacity: 1; transform: none; }
.panel[hidden] { display: none; }
.panel-head { display: flex; align-items: center; gap: 4px; padding: 10px 10px 10px 18px; border-bottom: 1px solid var(--line); min-height: 52px; }
.panel-title { flex: 1; min-width: 0; margin: 0; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.panel-tabs { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--panel-2); margin-right: 6px; }
.panel-tabs[hidden] { display: none; }
.panel-tabs button { border: 0; background: none; border-radius: 8px; padding: 5px 12px; font: inherit; font-size: 13px; color: var(--muted); cursor: pointer; }
.panel-tabs button[aria-selected="true"] { background: var(--panel); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .1); }
.panel-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 9px; background: none; color: var(--muted); cursor: pointer; font-size: 15px; }
.panel-btn:hover { background: var(--panel-2); color: var(--text); }
.panel-body { flex: 1; min-height: 0; overflow: auto; }
.panel-body pre { margin: 0; min-height: 100%; padding: 16px 18px; border-radius: 0; background: var(--bg-2); white-space: pre; font-size: 13px; line-height: 1.55; }
.panel-body.html.tab-preview { overflow: hidden; background: #fff; }
.preview-frame { display: block; width: 100%; height: 100%; border: 0; background: #fff; }
.panel-body .doc { max-width: 44rem; margin: 0 auto; padding: 24px 26px 60px; font-size: 16px; }
.call-log { display: grid; gap: 10px; padding: 20px; }
.call-row { display: grid; gap: 2px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.call-row span { font-size: 12px; color: var(--muted); }

/* ---- Admin: agent + phone ---- */
.jump-links { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 8px 0 4px; font-size: 14px; }
.profile-list { display: grid; gap: 8px; margin-bottom: 18px; }
.profile-item { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.profile-item > summary { padding: 10px 14px; cursor: pointer; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.profile-item.off > summary { opacity: .6; }
.profile-item.add > summary { color: var(--green); font-weight: 600; }
.profile-item .profile-form { padding: 0 14px 14px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }
.table-wrap { overflow-x: auto; }
.tel-provider { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin: 10px 0; }
.tel-provider summary { cursor: pointer; }
code.copyable { cursor: pointer; padding: 2px 6px; border-radius: 6px; background: var(--panel-2); word-break: break-all; }
code.copyable.copied { background: var(--m-primary-container); }
.sim { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--bg); }
.sim-log { min-height: 160px; max-height: 360px; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.sim-line { max-width: 80%; padding: 8px 12px; border-radius: 14px; font-size: 14.5px; animation: msgIn .2s var(--ease) both; }
.sim-line.agent { background: var(--panel-2); align-self: flex-start; }
.sim-line.caller { background: var(--m-primary-container); color: var(--m-on-primary-container); align-self: flex-end; }
.sim-line.sys { align-self: center; color: var(--muted); font-size: 12.5px; }
.sim-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); background: var(--panel); }
.sim-form input { flex: 1; min-width: 0; }

/* ---- Phones ---- */
@media (max-width: 760px) {
  .chat, body.panel-open .chat, body.side-collapsed .chat { grid-template-columns: 1fr; }
  body.side-collapsed .chat-side { visibility: visible; padding: 12px 10px; }
  .side-collapse { display: none; }
  .chat-top { background: var(--bg); min-height: 56px; padding-top: max(6px, env(safe-area-inset-top, 0px)); }
  .chat-title { font-size: 17px; }
  .msgs { padding: 12px 14px 16px; }
  .msg.assistant .msg-body { font-size: 16px; }
  .composer-wrap { padding: 0 8px max(6px, env(safe-area-inset-bottom, 0px)); background: linear-gradient(transparent, var(--bg) 30%); }
  .composer { border-radius: 22px; padding: 4px 6px 6px; background: var(--panel); box-shadow: var(--shadow); min-height: 0; }
  .composer:focus-within { background: var(--panel); }
  .composer textarea { font-size: 17px; }
  .task-chip select { max-width: 120px; font-size: 12.5px; }
  .tool-btn { min-width: 42px; height: 42px; }
  .send-btn { width: 42px; height: 42px; border-radius: 12px; }
  .send-btn:disabled { background: var(--panel-2); }
  .disclaimer { display: none; }
  .chat-empty { padding-top: 6vh; }
  .chat-empty h2 { font-size: 30px; }
  .suggestion { background: var(--panel); }
  .chat-side { background: var(--bg-2); }
  .panel { position: fixed; inset: 0; z-index: 45; border-left: 0; transform: translateY(16px); }
  .panel-head { padding-top: max(10px, env(safe-area-inset-top, 0px)); }
  body.site.signed-in .m-appbar { background: var(--bg); }
  body.site.signed-in.scrolled .m-appbar { background: var(--bg-2); }
  .sheet-panel { background: var(--panel); }
  .new-chat { background: var(--panel); color: var(--text); min-height: 44px; }
  .conv.active { background: var(--surface-3); }
  .conv.active .conv-link { color: var(--text); }
  .msg.user .msg-body { background: var(--bubble); }
}
/* Chat is a full-screen app on every screen size: no website header; account, theme and language live in the sidebar. */
body.app .header-wrap { display: none; }
@media (min-width: 761px) { .side-close { display: none !important; } .chat-top .chat-avatar { display: none; } }
body.side-collapsed .chat-top #newChatTop { display: inline-flex; }
/* Composer tools stay on one line even when the side panel narrows the column */
.composer > :not(textarea) { flex-shrink: 0; }
.task-chip { min-width: 0; flex: 0 1 auto !important; }
.task-chip select { max-width: 100%; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; }
body.panel-open .tool-btn .tool-label { display: none; }
.sim-form select { width: auto; flex: 0 0 auto; }
.sim-form input { width: auto; }
.tr-stats > span { display: grid; gap: 2px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; color: var(--text); background: var(--panel); font-size: inherit; }

/* ================= Update 9: interactive replies, tickets, storage ================= */
.ix-choices, .ix-next { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 2px; }
.ix-chip { border: 1px solid var(--line-2); background: var(--panel); color: var(--text); border-radius: 999px; padding: 8px 14px; min-height: 40px; font: inherit; font-size: 14px; cursor: pointer; transition: background .15s, border-color .15s, transform .12s var(--ease); animation: msgIn .3s var(--ease) both; }
.ix-chip:hover { background: var(--panel-2); border-color: var(--green); }
.ix-chip:active { transform: scale(.95); }
.ix-choices .ix-chip { border-color: color-mix(in srgb, var(--green) 45%, var(--line-2)); color: var(--green); font-weight: 600; }
.ix-next .ix-chip { font-size: 13.5px; color: var(--muted); border-style: dashed; }
.ix-choices.used .ix-chip:not(.picked), .ix-next.used .ix-chip:not(.picked) { opacity: .45; }
.ix-chip.picked { background: var(--m-primary-container); color: var(--m-on-primary-container); }
.msg:not(:last-child) .ix-next { display: none; }
.msg:not(:last-child) .ix-choices .ix-chip { pointer-events: none; opacity: .6; }
.ix-form { display: grid; gap: 10px; margin: 12px 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); animation: msgIn .3s var(--ease) both; max-width: 30rem; }
.ixf-title { font-family: var(--serif); font-size: 17px; font-weight: 600; }
.ix-form label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.ix-form input, .ix-form select, .ix-form textarea { border: 1px solid var(--line-2); border-radius: 10px; padding: 9px 11px; min-height: 42px; font: inherit; font-size: 15px; color: var(--text); background: var(--bg); width: 100%; }
.ix-form.sent { opacity: .7; }
.ix-form.sent button { display: none; }
.ix-place { margin: 12px 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); display: grid; gap: 6px; animation: msgIn .3s var(--ease) both; max-width: 32rem; }
.pl-name { font-family: var(--serif); font-size: 18px; font-weight: 600; }
.pl-rating { font-family: var(--font); font-size: 13px; color: var(--warn); font-weight: 600; }
.pl-row { display: flex; gap: 8px; font-size: 14.5px; color: var(--text); }
.pl-row span { width: 20px; flex-shrink: 0; }
.pl-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.pl-actions .btn { min-height: 38px; padding: 6px 14px; text-decoration: none; }
.ix-skeleton { max-width: 26rem; padding: 10px 0; }
.msg.status-update .msg-body { border-left: 3px solid var(--green); padding-left: 12px; }
.conv.unread .conv-link::after { content: ""; display: inline-block; width: 8px; height: 8px; margin-left: 6px; border-radius: 50%; background: var(--green); vertical-align: middle; }
.toast.ok { border-color: var(--green); }
/* tickets */
.ticket-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.ticket-thread .tt-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ticket-thread .tt-head h2 { margin: 0; flex: 1; font-size: 20px; }
.tt-msgs { display: grid; gap: 10px; margin: 14px 0; }
.tt-msg { padding: 10px 14px; border-radius: 14px; background: var(--panel-2); max-width: 46rem; }
.tt-msg.ai { background: var(--m-primary-container); }
.tt-msg.staff { background: color-mix(in srgb, var(--warn) 12%, var(--panel)); }
.tt-body { margin-top: 4px; white-space: normal; line-height: 1.6; }
.ticket-admin .tt-msgs, .ticket-admin form { padding: 0 14px; }
/* storage */
.store-meter { margin: 14px 0; }
.store-bar { position: relative; height: 14px; border-radius: 999px; background: var(--panel-2); overflow: visible; }
.store-bar i { display: block; height: 100%; width: 0; border-radius: 999px; background: var(--green); transition: width .6s var(--ease); }
.store-bar i.hot { background: var(--red); }
.store-mark { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--text); opacity: .5; }
/* Keep the tool row on one line on phones even with a long task name */
.composer-gap { flex: 1 1 0; min-width: 0; }
.task-chip { max-width: 44%; }
@media (max-width: 760px) { .task-chip { max-width: 40vw; } .task-chip select { padding: 6px 8px; } }

/* ---------- Help desk (update 10) ---------- */
.desk-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.desk-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0 8px; border-bottom: 1px solid var(--border, rgba(0,0,0,.1)); }
.desk-tabs a { padding: 8px 12px; border-radius: 10px 10px 0 0; text-decoration: none; color: inherit; opacity: .75; }
.desk-tabs a[aria-current="page"] { opacity: 1; font-weight: 600; border-bottom: 2px solid var(--accent, #c96442); }
.desk-filter { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 12px; }
.desk-filter .chip { padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border, rgba(0,0,0,.12)); text-decoration: none; color: inherit; }
.desk-filter .chip.on { background: var(--accent, #c96442); border-color: transparent; color: #fff; }
.ticket-row.unread { border-left: 3px solid var(--accent, #c96442); }
.desk-thread .tt-msg.staff { background: color-mix(in srgb, var(--accent, #c96442) 9%, transparent); }
.desk-add { align-items: end; }
@media (max-width: 640px) { .desk-add { grid-template-columns: 1fr; } }
.desk-thread textarea { font-family: inherit; font-size: 15px; }
.desk-sub { font-size: .6em; font-weight: 400; }
.desk-switch { display: flex; gap: 6px; overflow-x: auto; padding: 6px 0 10px; scrollbar-width: thin; }
.desk-switch a { white-space: nowrap; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border, rgba(0,0,0,.12)); text-decoration: none; color: inherit; font-size: 14px; }
.desk-switch a[aria-current="page"] { background: var(--fg, #1a1918); color: var(--bg, #faf9f5); border-color: transparent; }
/* Businesses */
.biz-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin: 12px 0; }
.biz-card { display: block; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--border, rgba(0,0,0,.1)); text-decoration: none; color: inherit; background: var(--card, transparent); transition: transform .15s ease, box-shadow .15s ease; }
.biz-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.08); }
.biz-card b { display: block; font-size: 16px; margin-bottom: 2px; }
.biz-icon { font-size: 22px; }
.biz-hero { display: flex; gap: 14px; align-items: center; }
.biz-hero .biz-icon { font-size: 40px; }
.biz-contacts { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.biz-talk textarea { font-family: inherit; }
.sector-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.sector-chips a { padding: 5px 12px; border-radius: 999px; border: 1px solid var(--border, rgba(0,0,0,.12)); text-decoration: none; color: inherit; font-size: 14px; }
.sector-chips a[aria-current="page"] { background: var(--accent, #c96442); color: #fff; border-color: transparent; }
.code-big { font-size: 22px; letter-spacing: 3px; font-weight: 700; }
.biz-page textarea, .biz-talk textarea { font-family: inherit; font-size: 15px; }

/* ---------- Customer-waiting notification (update 12) ---------- */
.desk-alert { display: flex; align-items: center; gap: 10px; margin: 8px auto 0; width: min(100% - 24px, 48rem); padding: 10px 12px 10px 14px; border-radius: 14px;
  background: color-mix(in srgb, #d97706 14%, var(--bg, #faf9f5)); border: 1px solid color-mix(in srgb, #d97706 45%, transparent); box-shadow: 0 4px 14px rgba(0,0,0,.06); }
.desk-alert[hidden] { display: none; }
.desk-alert .da-text { flex: 1; font-weight: 600; font-size: 14px; line-height: 1.35; }
.desk-alert .da-bell { font-size: 20px; animation: da-ring 2.4s ease-in-out infinite; transform-origin: 50% 0; }
.desk-alert.pulse { animation: da-pulse .9s ease 2; }
@keyframes da-ring { 0%, 70%, 100% { transform: rotate(0); } 75% { transform: rotate(14deg); } 82% { transform: rotate(-12deg); } 89% { transform: rotate(8deg); } }
@keyframes da-pulse { 50% { transform: scale(1.03); box-shadow: 0 0 0 6px color-mix(in srgb, #d97706 25%, transparent); } }
@media (prefers-reduced-motion: reduce) { .desk-alert .da-bell, .desk-alert.pulse { animation: none; } }
@media (max-width: 640px) { .desk-alert { flex-wrap: wrap; } .desk-alert .da-text { flex-basis: calc(100% - 40px); } .desk-alert .btn { width: 100%; } }
.desk-sheet { max-height: 85vh; overflow-y: auto; }
.desk-item { border: 1px solid var(--border, rgba(0,0,0,.1)); border-radius: 14px; padding: 12px; margin: 10px 0; transition: opacity .3s, transform .3s; }
.desk-item.done { opacity: 0; transform: translateX(30px); }
.desk-item .di-head { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.desk-item .di-msg p { margin: 4px 0 8px; white-space: pre-wrap; }
.desk-item textarea { width: 100%; font-family: inherit; font-size: 15px; margin-top: 4px; }
.desk-suggest-note { font-size: 13px; color: var(--muted, #6b6a66); }

/* ---------- Telegram connect (update 13) ---------- */
.tg-gate { position: fixed; inset: 0; z-index: 900; display: grid; place-items: center; padding: 16px; background: rgba(20, 19, 18, .55); backdrop-filter: blur(3px); animation: tg-fade .25s ease; }
.tg-gate[hidden] { display: none; }
.tg-card { width: min(100%, 26rem); background: var(--card, var(--bg, #fff)); color: inherit; border-radius: 20px; padding: 22px 20px 18px; box-shadow: 0 20px 50px rgba(0,0,0,.25); text-align: center; animation: tg-up .3s ease; max-height: calc(100vh - 32px); overflow-y: auto; }
.tg-card h2 { margin: 8px 0 6px; font-size: 1.3rem; }
.tg-text { margin: 0 0 10px; }
.tg-steps { text-align: left; margin: 0 auto 10px; padding-left: 1.3em; max-width: 20rem; line-height: 1.5; }
.tg-status { min-height: 1.2em; font-weight: 600; }
.tg-actions { display: grid; gap: 8px; }
.tg-actions .btn { width: 100%; }
#tgConnect { background: #229ED9; border-color: #229ED9; color: #fff; }
.tg-logout { margin-top: 8px; }
body.tg-locked { overflow: hidden; }
@keyframes tg-fade { from { opacity: 0; } }
@keyframes tg-up { from { transform: translateY(16px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .tg-gate, .tg-card { animation: none; } }
/* ---------- In-chat inbox ---------- */
.side-desk .badge { margin-left: 4px; }
.desk-row.unread .conv-link { font-weight: 700; }
.desk-row.unread .conv-link::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #d97706; margin-right: 6px; vertical-align: middle; }
.desk-empty { padding: 4px 12px 8px; }
.desk-bar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 auto 6px; width: min(100% - 24px, 48rem); }
.desk-bar[hidden] { display: none; }
.desk-bar .db-info { flex: 1 1 100%; font-size: 13px; color: var(--muted, #6b6a66); }
.desk-bar .chip { padding: 5px 12px; border-radius: 999px; border: 1px solid var(--border, rgba(0,0,0,.14)); background: transparent; color: inherit; font-size: 13px; cursor: pointer; }
.desk-msg .desk-who { margin-bottom: 4px; }
.desk-msg.desk-ai .msg-body { opacity: .85; }
.desk-context { margin: 8px 0 14px; font-size: 13px; }
.desk-context pre { white-space: pre-wrap; font-family: inherit; background: color-mix(in srgb, currentColor 5%, transparent); padding: 10px; border-radius: 10px; }
body.desk-mode .chat-empty { display: none; }
.tg-actions [hidden], .desk-bar [hidden] { display: none !important; }
body.desk-mode #attachBtn, body.desk-mode #imgBtn, body.desk-mode .task-chip, body.desk-mode #attachRow { display: none !important; }
.confirm-bar { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; justify-content: center; margin: 6px auto; width: min(100% - 24px, 48rem); padding: 8px 12px; border-radius: 12px; font-size: 13px; background: color-mix(in srgb, #2563eb 9%, transparent); }
.confirm-bar .linklike { font-weight: 600; }

/* ---------- File cards (Word / PDF / Excel) ---------- */
.file-card { border: 1px solid var(--border, rgba(0,0,0,.12)); border-radius: 16px; padding: 14px; margin: 10px 0; background: color-mix(in srgb, currentColor 3%, transparent); }
.file-card .fc-head { display: flex; gap: 12px; align-items: center; }
.file-card .fc-icon { font-size: 30px; line-height: 1; }
.file-card .fc-head b { display: block; }
.file-card .fc-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.file-card .fc-preview { margin-top: 8px; font-size: 14px; }
.file-card .fc-preview summary { cursor: pointer; color: var(--muted, #6b6a66); }
.file-card .fc-body { max-height: 420px; overflow: auto; padding: 8px 4px; }

/* Update 21: one-tap telebirr payment */
.tb-quick { display: grid; gap: 12px; margin-top: 14px; padding: 16px; border: 1px solid var(--gold); border-radius: 18px; background: color-mix(in srgb, var(--gold) 8%, var(--panel)); }
.tb-quick-sum { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; align-items: baseline; }
.tb-quick-sum > span.small:last-child { grid-column: 2; }
.tb-big { font-size: 22px; letter-spacing: .01em; word-break: break-all; }
.tb-copy { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tb-open { font-size: 18px; min-height: 54px; display: flex; align-items: center; justify-content: center; }
.tb-guide { list-style: none; padding: 0; margin: 16px 0 6px; display: grid; gap: 10px; counter-reset: tb; }
.tb-guide li { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); counter-increment: tb; }
.tb-guide li::before { content: counter(tb); flex: 0 0 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 13px; background: var(--green); color: #fff; }
.tb-ico { font-size: 20px; line-height: 1; }
.tb-h { font-size: 18px; margin: 18px 0 6px; }
.tb-file input[type=file] { padding: 14px; border: 2px dashed var(--gold); border-radius: 14px; background: var(--panel); width: 100%; }
@media (max-width: 380px) { .tb-copy { grid-template-columns: 1fr; } .tb-big { font-size: 19px; } }

/* Update 21: My ELBAS dashboard, Pro plan and Pro tools */
.card + .card, .pricing-head + .card, .card + .lock-card { margin-top: 18px; }
.pill-lock { background: color-mix(in srgb, var(--gold) 16%, transparent); color: var(--gold-2, var(--gold)); }
.sub-card .sub-top { display: flex; justify-content: space-between; gap: 16px; align-items: center; flex-wrap: wrap; }
.sub-tier { font-size: 28px; font-weight: 800; margin: 2px 0 4px; }
.sub-card.is-pro .sub-tier { color: var(--gold); }
.sub-days { display: grid; place-items: center; min-width: 92px; padding: 10px 14px; border-radius: 18px; background: color-mix(in srgb, var(--gold) 12%, var(--panel)); border: 1px solid var(--gold); text-align: center; }
.sub-days b { font-size: 30px; line-height: 1; }
.sub-days span { font-size: 12px; color: var(--muted); }
.sub-meter { width: 100%; height: 10px; margin: 14px 0 4px; border: 0; border-radius: 99px; overflow: hidden; background: var(--line); appearance: none; -webkit-appearance: none; }
.sub-meter::-webkit-progress-bar { background: var(--line); border-radius: 99px; }
.sub-meter::-webkit-progress-value { background: linear-gradient(90deg, var(--green), var(--gold)); border-radius: 99px; }
.sub-meter::-moz-progress-bar { background: linear-gradient(90deg, var(--green), var(--gold)); border-radius: 99px; }
.sub-actions { display: grid; gap: 10px; margin-top: 16px; }
.sub-cta { min-height: 52px; font-size: 17px; }
.pay-modal { width: min(520px, calc(100vw - 24px)); max-height: calc(100dvh - 40px); overflow: auto; border: 1px solid var(--gold); border-radius: 22px; padding: 22px 20px; background: var(--panel); color: var(--text); box-shadow: var(--shadow); }
.pay-modal::backdrop { background: rgba(0, 0, 0, .55); }
.pay-modal h2 { margin: 0 34px 6px 0; font-size: 20px; }
.pay-modal-close { position: absolute; top: 10px; right: 10px; margin: 0; }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.tool-card { position: relative; display: grid; gap: 6px; align-content: start; padding: 18px; border-radius: 18px; border: 1px solid var(--line); background: var(--panel-2, var(--panel)); color: var(--text); text-decoration: none; transition: border-color .15s, transform .15s; }
.tool-card:hover { border-color: var(--gold); transform: translateY(-2px); color: var(--text); }
.tool-card .tool-ic { font-size: 30px; }
.tool-card .pill { justify-self: start; margin-top: 4px; }
.tool-card.locked { border-style: dashed; }
.tool-card.locked .tool-ic { filter: grayscale(.6); opacity: .75; }
.lock-card { text-align: center; max-width: 560px; border-color: var(--gold); }
.lock-card .lock-ic { font-size: 40px; }
.lock-card .plan-list { text-align: left; max-width: 320px; margin: 10px auto 16px; }
.dash-mini { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.dash-mini a { display: grid; gap: 2px; padding: 14px; border-radius: 16px; border: 1px solid var(--line); color: var(--text); text-decoration: none; }
.dash-mini a > span:first-child { font-size: 22px; }
.tax-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; align-items: end; }
.tax-form .check, .tax-form button { grid-column: 1 / -1; }
.tax-result { margin-top: 20px; }
.tax-net { display: grid; gap: 2px; justify-items: center; padding: 18px; border-radius: 18px; background: color-mix(in srgb, var(--green) 10%, var(--panel)); border: 1px solid var(--green); margin-bottom: 12px; text-align: center; }
.tax-net strong { font-size: 34px; color: var(--green); }
.tax-table td.neg { color: var(--red); }
.tax-table .tax-total td { border-top: 2px solid var(--line-2, var(--line)); }
.tax-bands { margin-top: 14px; }
.inv-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.inv-parties { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin: 14px 0; }
.inv-parties fieldset { border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; display: grid; gap: 8px; min-width: 0; }
.inv-parties legend { font-weight: 800; padding: 0 6px; }
.inv-items input { width: 100%; min-width: 64px; }
.inv-items td:first-child input { min-width: 150px; }
.inv-items td, .inv-items th { padding: 6px; }
.inv-totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; align-items: start; margin: 12px 0; }
.inv-totals dl { display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; margin: 0; padding: 14px; border-radius: 16px; background: var(--panel-2, var(--panel)); border: 1px solid var(--line); }
.inv-totals dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.tnd-filter { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto auto; gap: 10px; align-items: center; }
.tnd-list { display: grid; gap: 12px; margin-top: 12px; }
.tnd { padding: 14px 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel-2, var(--panel)); }
.tnd h3 { margin: 8px 0 6px; font-size: 16px; }
.tnd-head { display: flex; gap: 6px; flex-wrap: wrap; }
.tnd-locked .tnd { opacity: .75; }
.tnd-edit { border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; margin: 8px 0; }
@media (max-width: 640px) {
  .card { padding: 20px 16px; }
  .tnd-filter { grid-template-columns: 1fr; }
  .sub-tier { font-size: 24px; }
  .tax-net strong { font-size: 28px; }
  .inv-items thead { display: none; }
  .inv-items tr { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 6px; padding: 8px 0; border-bottom: 1px solid var(--line); }
  .inv-items td { padding: 0; border: 0; }
  .inv-items td:first-child { grid-column: 1 / -1; }
  .inv-items td:first-child input { min-width: 0; }
  .inv-items td[data-line] { align-self: center; }
}
/* Header stays on one row: less-used links move to My ELBAS on medium screens */
@media (min-width: 761px) { .site-header { flex-wrap: nowrap; } .site-nav { flex-wrap: nowrap; } .site-nav > a { white-space: nowrap; } }
@media (min-width: 761px) and (max-width: 1599px) { .site-nav > a.nav-l2 { display: none; } }
@media (min-width: 761px) and (max-width: 959px) { .site-nav > a.nav-l4 { display: none; } }
@media (min-width: 761px) and (max-width: 1199px) { .site-nav > a.nav-l3 { display: none; } .site-nav { gap: 10px; } .site-nav .user-chip span:not(.m-avatar) { display: none; } }
@media (min-width: 761px) and (max-width: 879px) { .site-nav { gap: 6px; } .site-nav > a { padding: 6px 2px; font-size: 13.5px; } .site-header { gap: 10px; padding-left: 16px; padding-right: 16px; } }
.inv-row { grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr)); }
.inv-form input, .inv-form select, .inv-form textarea { min-width: 0; max-width: 100%; box-sizing: border-box; }
.inv-row input, .inv-row select { width: 100%; }

/* ---------- Update 22: services hub, jobs, football, calls ---------- */
.svc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.svc-card { position: relative; display: flex; align-items: flex-start; gap: 12px; padding: 16px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); color: var(--text); text-decoration: none; transition: transform .15s, border-color .15s, box-shadow .15s; min-height: 92px; }
.svc-card:hover { transform: translateY(-2px); border-color: var(--gold); box-shadow: var(--shadow); color: var(--text); }
.svc-card.mine { border-color: color-mix(in srgb, var(--green) 45%, var(--line)); }
.svc-card.locked .svc-ic { filter: grayscale(.4); opacity: .85; }
.svc-ic { flex: 0 0 44px; height: 44px; display: grid; place-items: center; font-size: 22px; border-radius: 12px; background: color-mix(in srgb, var(--gold) 12%, var(--panel)); }
.svc-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding-right: 54px; }
.svc-txt b { font-size: 15px; line-height: 1.3; }
.svc-txt .small { line-height: 1.4; }
.svc-tier { position: absolute; top: 10px; right: 10px; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.svc-tier.tier-free { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, var(--line)); }
.svc-tier.tier-pro { color: var(--gold-2); border-color: color-mix(in srgb, var(--gold) 50%, var(--line)); background: color-mix(in srgb, var(--gold) 10%, var(--panel)); }
.svc-tier.tier-pass, .svc-tier.tier-business { color: var(--muted); }
.svc-pick .svc-card { cursor: pointer; }
.svc-pick .svc-card input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.svc-check { position: absolute; top: 10px; right: 10px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid var(--line-2); color: transparent; font-weight: 900; font-size: 13px; }
.svc-pick .svc-card:has(input:checked) { border-color: var(--green); background: color-mix(in srgb, var(--green) 6%, var(--panel)); }
.svc-pick .svc-card:has(input:checked) .svc-check { background: var(--green); border-color: var(--green); color: #fff; }
.svc-pick .svc-card:has(input:focus-visible) { outline: 2px solid var(--gold); outline-offset: 2px; }
.svc-pick-bar { position: sticky; bottom: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 0 4px; margin-top: 18px; background: linear-gradient(transparent, var(--panel) 30%); }
.svc-pick-bar .btn { max-width: 420px; }
.home-services { max-width: 1120px; margin: 56px auto 0; padding: 0 16px; }
.home-services h2 { text-align: center; }
.home-services .svc-group-h { margin: 22px 0 8px; font-size: 14px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.home-services .cta-row { text-align: center; margin-top: 22px; }
.svc-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--text); text-decoration: none; font-size: 13px; font-weight: 600; }
.chip:hover { border-color: var(--gold); color: var(--text); }
.chip.on { background: var(--gold); border-color: transparent; color: #1B1406; }
.jobs-sites { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.job h3 a { color: var(--text); text-decoration: none; }
.job h3 a:hover { color: var(--gold-2); text-decoration: underline; }
/* football */
.foot-comps { display: flex; flex-wrap: wrap; gap: 8px; }
.foot-list { display: flex; flex-direction: column; gap: 6px; }
.foot-day { margin: 16px 0 4px !important; font-size: 13px !important; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.foot-row { display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; color: var(--text); text-decoration: none; }
.foot-row:hover, .foot-row.on { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 6%, var(--panel)); color: var(--text); }
.foot-time { font-family: var(--mono); font-weight: 700; }
.foot-teams { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: baseline; min-width: 0; }
.foot-teams i { color: var(--faint); font-style: normal; font-size: 12px; }
.foot-teams small { flex-basis: 100%; font-size: 12px; }
.foot-vs { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; align-items: baseline; text-align: center; font-size: clamp(20px, 3vw, 26px) !important; }
.foot-vs i { font-style: normal; color: var(--faint); font-size: 15px; }
.foot-bars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 16px 0; }
.foot-bars > div { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 8px; border: 1px solid var(--line); border-radius: 12px; }
.foot-bars b { font-size: 26px; line-height: 1; }
.foot-bars progress { width: 100%; height: 8px; accent-color: var(--green); }
.foot-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin-bottom: 14px; }
.foot-stats span { display: flex; flex-direction: column; padding: 10px; border-radius: 12px; background: var(--panel-2); text-align: center; }
.foot-stats b { font-size: 18px; } .foot-stats small { color: var(--muted); font-size: 12px; }
.conf-high b { color: var(--ok); } .conf-medium b { color: var(--warn); } .conf-low b { color: var(--muted); }
.foot-verdict { padding: 12px 14px; border-left: 4px solid var(--gold); background: color-mix(in srgb, var(--gold) 8%, var(--panel)); border-radius: 8px; }
.foot-factors { padding-left: 20px; } .foot-factors li { margin: 4px 0; }
.foot-h2h { list-style: none; padding: 0; } .foot-h2h li { padding: 4px 0; border-bottom: 1px dashed var(--line); }
.foot-table { width: 100%; border-collapse: collapse; font-size: 14px; } .foot-table th, .foot-table td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.foot-safe { border-color: color-mix(in srgb, var(--fail) 30%, var(--line)); }
/* calls */
.biz-call { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0 4px; }
.call-incoming { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--green); border-radius: 12px; margin-bottom: 10px; background: color-mix(in srgb, var(--green) 6%, var(--panel)); }
.call-incoming p { margin: 0; flex: 1 1 200px; }
.call-modal { border: 1px solid var(--line); border-radius: 22px; padding: 28px 22px 20px; width: min(360px, calc(100vw - 32px)); text-align: center; background: var(--panel); color: var(--text); box-shadow: var(--shadow); }
.call-modal::backdrop { background: rgba(20,16,8,.55); }
.call-ava { width: 76px; height: 76px; margin: 0 auto 10px; border-radius: 50%; display: grid; place-items: center; font-size: 34px; background: color-mix(in srgb, var(--green) 14%, var(--panel)); animation: callpulse 1.6s ease-out infinite; }
@keyframes callpulse { 0% { box-shadow: 0 0 0 0 rgba(30,138,71,.45); } 100% { box-shadow: 0 0 0 22px rgba(30,138,71,0); } }
@media (prefers-reduced-motion: reduce) { .call-ava { animation: none; } }
.call-modal h2 { margin: 4px 0; font-size: 20px; }
.call-state { margin: 0; color: var(--muted); font-weight: 600; }
.call-time { margin: 4px 0 14px; min-height: 1.4em; }
.call-btns { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; }
.call-hang { border-color: var(--fail); }
.ring-banner[hidden], .call-modal [hidden] { display: none !important; }
.ring-banner { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 90; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: center; max-width: calc(100vw - 32px); padding: 10px 14px; border-radius: 14px; background: var(--panel); border: 2px solid var(--green); box-shadow: var(--shadow); font-weight: 700; }
.src-table { width: 100%; border-collapse: collapse; } .src-table td, .src-table th { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; text-align: left; }
.fail { color: var(--fail); }
@media (max-width: 560px) {
  .svc-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .svc-card { flex-direction: column; gap: 8px; padding: 12px 10px; min-height: 0; }
  .svc-txt { padding-right: 0; } .svc-txt .small { display: none; }
  .svc-tier { position: static; align-self: flex-start; }
  .svc-check { top: 8px; right: 8px; }
  .foot-row { grid-template-columns: 46px 1fr; } .foot-row .pill { grid-column: 2; justify-self: start; }
  .foot-bars b { font-size: 20px; }
}
.svc-chips { justify-content: center; margin: 4px 0 18px; }
.svc-chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--text); text-decoration: none; font-size: 13.5px; font-weight: 600; transition: border-color .15s, transform .15s; }
.svc-chip:hover { border-color: var(--gold); color: var(--text); transform: translateY(-1px); }
.svc-chip-all { border-style: dashed; color: var(--gold-2); }
/* update 22.1 */
.tax-mode { border: 0; padding: 0; margin: 0 0 6px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tax-mode legend { padding: 0; margin-bottom: 6px; width: 100%; }
.tax-mode .chip input, .tone-opts .chip input { margin: 0 4px 0 0; accent-color: var(--green); }
.tax-mode .chip:has(input:checked), .tone-opts .chip:has(input:checked) { border-color: var(--green); background: color-mix(in srgb, var(--green) 8%, var(--panel)); }
.tax-basic-out { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px 14px; margin-bottom: 10px; border-radius: 12px; border: 1px solid var(--gold); background: color-mix(in srgb, var(--gold) 8%, var(--panel)); }
.tax-basic-out strong { font-size: 26px; }
.tax-basic-out[hidden] { display: none; }
.tone-form { display: flex; flex-direction: column; gap: 8px; padding: 12px 0; border-bottom: 1px dashed var(--line); }
.tone-opts { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.tax-form label[hidden] { display: none; }
.svc-tier-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 0 auto 14px; max-width: 1120px; padding: 0 16px; }
.svc-tier-sec { padding: 6px 0 18px; scroll-margin-top: 80px; }
.svc-tier-sec + .svc-tier-sec { border-top: 1px solid var(--line); padding-top: 18px; }
.svc-tier-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin-bottom: 10px; }
.svc-tier-head h2 { margin: 0 !important; font-size: 20px; }
.svc-tier-head p { margin: 0; flex: 1 1 260px; }
.tier-sec-pro .svc-tier-head h2 { color: var(--gold-2); }
.tier-sec-free .svc-tier-head h2 { color: var(--ok); }
.home-services .svc-tier-sec { text-align: left; }
/* update 23: friends */
.fr-list { display: flex; flex-direction: column; gap: 8px; }
.fr-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.fr-ava { width: 40px; height: 40px; flex: 0 0 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #1B1406; background: linear-gradient(135deg, var(--gold), var(--green-2)); }
.fr-name { flex: 1 1 120px; min-width: 0; overflow-wrap: anywhere; }
.fr-more { position: relative; } .fr-more summary { list-style: none; cursor: pointer; padding: 6px 10px; border-radius: 10px; color: var(--muted); font-weight: 800; }
.fr-more summary::-webkit-details-marker { display: none; }
.fr-more[open] form { margin-top: 6px; }
.fr-code { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 14px; border: 1px dashed var(--line-2); border-radius: 14px; }
.fr-code b { font-size: 20px; letter-spacing: .12em; }
.fr-add-card .fr-row { border: 0; padding: 0 0 10px; }
.fr-add { grid-template-columns: minmax(0, 1fr) auto !important; }
/* update 23.1: full-screen incoming call */
.ring-pop { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 16px; background: radial-gradient(circle at 50% 35%, rgba(30,138,71,.55), rgba(10,20,12,.92) 70%); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: ringbg 1.6s ease-in-out infinite alternate; }
.ring-pop[hidden] { display: none !important; }
@keyframes ringbg { from { background-color: rgba(10,20,12,.0); } to { background-color: rgba(30,138,71,.18); } }
.ring-card { width: min(380px, 100%); text-align: center; color: #fff; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.ring-signal { position: relative; width: 140px; height: 140px; margin: 0 auto 14px; display: grid; place-items: center; }
.ring-signal span { position: relative; z-index: 2; width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; font-size: 44px; background: linear-gradient(135deg, #2FA35A, #1E8A47); box-shadow: 0 10px 40px rgba(47,163,90,.6); animation: ringshake 1.2s ease-in-out infinite; }
.ring-signal i { position: absolute; inset: 22px; border-radius: 50%; border: 3px solid rgba(120,230,150,.8); animation: ringwave 1.8s ease-out infinite; }
.ring-signal i:nth-child(2) { animation-delay: .6s; } .ring-signal i:nth-child(3) { animation-delay: 1.2s; }
@keyframes ringwave { from { transform: scale(.9); opacity: .95; } to { transform: scale(1.9); opacity: 0; } }
@keyframes ringshake { 0%, 50%, 100% { transform: rotate(0); } 10%, 30% { transform: rotate(-14deg); } 20%, 40% { transform: rotate(14deg); } }
.ring-kind { margin: 0; font-size: 14px; letter-spacing: .04em; text-transform: uppercase; color: rgba(255,255,255,.8); }
.ring-who { margin: 0; font-size: clamp(26px, 7vw, 34px); line-height: 1.15; color: #fff; overflow-wrap: anywhere; }
.ring-sub { margin: 0; color: rgba(255,255,255,.75); }
.ring-bars { display: flex; gap: 5px; align-items: flex-end; height: 22px; margin: 10px 0 24px; }
.ring-bars b { width: 5px; border-radius: 3px; background: #7EE29B; animation: ringbar 1s ease-in-out infinite; }
.ring-bars b:nth-child(1) { height: 30%; animation-delay: 0s; } .ring-bars b:nth-child(2) { height: 55%; animation-delay: .15s; } .ring-bars b:nth-child(3) { height: 80%; animation-delay: .3s; } .ring-bars b:nth-child(4) { height: 55%; animation-delay: .45s; } .ring-bars b:nth-child(5) { height: 30%; animation-delay: .6s; }
@keyframes ringbar { 0%, 100% { transform: scaleY(.4); opacity: .6; } 50% { transform: scaleY(1); opacity: 1; } }
.ring-actions { display: flex; justify-content: center; gap: 56px; }
.ring-btn { width: 74px; height: 74px; border-radius: 50%; border: 0; display: grid; place-items: center; font-size: 30px; color: #fff; text-decoration: none; cursor: pointer; position: relative; }
.ring-btn small { position: absolute; top: 100%; margin-top: 8px; font-size: 14px; font-weight: 700; color: #fff; white-space: nowrap; }
.ring-decline { background: #D7263D; box-shadow: 0 8px 26px rgba(215,38,61,.5); }
.ring-answer { background: #2FA35A; box-shadow: 0 8px 26px rgba(47,163,90,.6); animation: ringpulse 1.2s ease-in-out infinite; }
.ring-answer:hover, .ring-answer:focus-visible { color: #fff; outline: 3px solid #fff; outline-offset: 3px; }
.ring-decline:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
@keyframes ringpulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.1); } }
html.ringing body { overflow: hidden; }
@media (prefers-reduced-motion: reduce) { .ring-pop, .ring-signal span, .ring-signal i, .ring-bars b, .ring-answer { animation: none; } .ring-signal i { opacity: .5; } }
/* update 24: Android app */
.app-dl { margin-top: 6px; }
.app-why { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.app-why > div { padding: 14px; border: 1px solid var(--line); border-radius: 14px; }
.app-why span { font-size: 26px; display: block; } .app-why b { display: block; margin: 6px 0 2px; } .app-why p { margin: 0; }
.app-steps li { margin: 6px 0; }
.app-sha { display: block; overflow-wrap: anywhere; font-size: 11px; margin-top: 6px; }
.app-promo { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 80; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--panel); border: 1px solid var(--gold); box-shadow: var(--shadow); max-width: 560px; margin: 0 auto; }
.app-promo[hidden] { display: none; }
.app-promo > span:first-child { font-size: 24px; }
.app-promo-txt { flex: 1; display: flex; flex-direction: column; min-width: 0; } .app-promo-txt small { color: var(--muted); }
.app-android { margin-top: 8px; }

/* Update 24.1: APK download on the home page */
.btn-apk{text-decoration:none}
.apk-meta{margin:.55rem 0 0}
.apk-meta a,.get-app-text .small a{color:inherit;text-decoration:underline;text-underline-offset:2px}

/* Update 24.1: the app banner sits at the top so it never covers the chat box or buttons at the bottom */
.app-promo { top: calc(env(safe-area-inset-top, 0px) + 76px); bottom: auto; padding: 8px 10px; }
.app-promo .btn { padding: 8px 14px; min-height: 0; }
@media (max-width: 420px) { .app-promo-txt small { display: none; } }
.in-app [data-apk], .in-app .apk-meta, .in-app #download, .in-app #appPromo, .in-app .app-android { display: none !important; }

/* AI support for your website (owner page + docs) */
.sup-stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(120px,1fr));gap:10px;margin:14px 0 6px}
.sup-stats div{border:1px solid var(--border,#d9e2de);border-radius:12px;padding:10px 12px;display:flex;flex-direction:column;gap:2px}
.sup-stats b{font-size:1.4rem;line-height:1.1}.sup-stats span{font-size:.82rem;opacity:.75}
.sup-code{white-space:pre-wrap;word-break:break-all;background:var(--code-bg,#0e2433);color:#e8efec;border-radius:10px;padding:12px 14px;font-size:.85rem;line-height:1.45;overflow-x:auto}
.sup-steps{padding-left:1.3rem;line-height:1.7}
.sup-transcript{border:1px solid var(--border,#d9e2de);border-radius:12px;padding:12px 14px;margin-top:12px;max-height:420px;overflow-y:auto}
.sup-m{margin:0 0 8px;font-size:.92rem}.sup-m.sup-system{opacity:.7;font-style:italic}.sup-m.sup-agent b{color:#9a6b00}
.sup-docs h2{margin-top:28px}.sup-docs .table{margin:8px 0 12px}

/* Wallet balance at the top of the chat + prices on every service (update 26) */
.wallet-top { display: inline-flex; align-items: baseline; gap: 4px; padding: 6px 12px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--gold) 55%, var(--line)); background: color-mix(in srgb, var(--gold) 12%, var(--panel)); color: var(--text); text-decoration: none; font-weight: 700; white-space: nowrap; line-height: 1.2; margin-left: auto; }
.wallet-top b { font-size: 15px; font-variant-numeric: tabular-nums; }
.wallet-top small { font-size: 12px; color: var(--muted); font-weight: 600; }
.wallet-top:hover { border-color: var(--gold); color: var(--text); }
.wallet-top.empty { border-color: var(--line); background: var(--panel); }
.wallet-top.big { padding: 8px 16px; }
.wallet-top.big b { font-size: 20px; }
.chat-top .wallet-top + .model-badge { margin-left: 0; }
@media (max-width: 760px) { .chat-top .wallet-top { padding: 5px 10px; margin-left: auto; } .chat-top .wallet-top small { display: none; } .chat-top .chat-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } }
.svc-price { display: block; margin-top: 6px; font-size: 12.5px; font-weight: 700; color: var(--gold-2); }
.svc-price.free { color: var(--ok); }
.svc-allprices { text-align: center; margin: 18px 0 4px; }
.price-list h2 { margin-top: 26px; } .price-list h2:first-child { margin-top: 0; }
.price-table td:last-child { white-space: normal; font-weight: 700; min-width: 140px; }
.price-table td.price-free { color: var(--ok); } .price-table td.price-paid { color: var(--gold-2); }
.price-how { padding-left: 20px; display: grid; gap: 6px; }

/* Messages between people (update 27) */
.msg-app { display: grid; grid-template-columns: 320px 1fr; height: calc(100dvh - 140px); min-height: 460px; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: var(--panel); max-width: 1180px; margin: 0 auto; }
.msg-list { border-right: 1px solid var(--line); overflow-y: auto; display: flex; flex-direction: column; background: var(--bg); }
.msg-list-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 14px 10px; position: sticky; top: 0; background: var(--bg); z-index: 1; }
.msg-list-head h1 { font-size: 20px; margin: 0; }
.msg-list .notice-box, .msg-list .alert { margin: 0 12px 10px; }
.msg-empty-list { padding: 18px 14px; display: grid; gap: 10px; }
.msg-threads { display: flex; flex-direction: column; }
.msg-th { display: flex; align-items: center; gap: 10px; padding: 10px 14px; color: var(--text); text-decoration: none; border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent); min-height: 60px; }
.msg-th:hover { background: var(--panel-2); color: var(--text); }
.msg-th.on { background: color-mix(in srgb, var(--green) 10%, var(--panel)); }
.msg-th-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.msg-th-txt b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-th-txt small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-th.unread .msg-th-txt b, .msg-th.unread .msg-th-txt small { color: var(--text); font-weight: 800; }
.msg-ava { flex: none; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--green) 18%, var(--panel)); color: var(--green); font-weight: 800; font-size: 17px; }
.msg-ava.grp { background: color-mix(in srgb, var(--gold) 20%, var(--panel)); font-size: 20px; }
.msg-ava.sm { width: 30px; height: 30px; font-size: 13px; }
.msg-ava.big { width: 72px; height: 72px; font-size: 34px; margin: 0 auto 10px; }
.msg-badge { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--green); color: #fff; font-size: 12px; font-weight: 800; display: grid; place-items: center; }
.msg-friends { border-top: 1px solid var(--line); margin-top: auto; }
.msg-friends summary { padding: 12px 14px; cursor: pointer; font-weight: 700; color: var(--muted); }
.msg-pane { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.msg-pick { margin: auto; text-align: center; display: grid; gap: 10px; justify-items: center; padding: 20px; }
.msg-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--panel); }
.msg-head-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.msg-head-txt b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 16px; }
.msg-back { display: none; }
.msg-scroll { flex: 1; overflow-y: auto; padding: 14px; background: color-mix(in srgb, var(--bg) 70%, var(--panel)); overscroll-behavior: contain; }
.msg-older { display: block; margin: 0 auto 10px; }
.msg-older[hidden] { display: none; }
.msg-day { text-align: center; font-size: 12px; color: var(--muted); margin: 12px 0 8px; font-weight: 700; }
.msg-sys { text-align: center; font-size: 12.5px; color: var(--muted); margin: 8px auto; max-width: 80%; }
.msg-row { display: flex; margin: 4px 0; }
.msg-row.mine { justify-content: flex-end; }
.msg-bubble { position: relative; max-width: min(78%, 560px); padding: 8px 12px 18px; border-radius: 16px 16px 16px 4px; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 1px 1px rgba(0,0,0,.03); }
.msg-row.mine .msg-bubble { background: color-mix(in srgb, var(--green) 14%, var(--panel)); border-color: color-mix(in srgb, var(--green) 30%, var(--line)); border-radius: 16px 16px 4px 16px; }
.msg-bubble p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.45; }
.msg-bubble.gone p { font-style: italic; color: var(--muted); }
.msg-who { display: block; font-size: 12px; color: var(--gold-2); margin-bottom: 2px; }
.msg-time { position: absolute; right: 10px; bottom: 3px; font-size: 10.5px; color: var(--muted); }
.msg-del { position: absolute; top: 2px; right: -26px; border: 0; background: none; color: var(--muted); cursor: pointer; opacity: 0; padding: 4px; font-size: 12px; }
.msg-row:hover .msg-del, .msg-del:focus { opacity: 1; }
.msg-compose { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px max(10px, env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); background: var(--panel); }
.msg-compose textarea { flex: 1; resize: none; min-height: 44px; max-height: 140px; border-radius: 22px; padding: 11px 16px; font: inherit; }
.msg-send { width: 46px; height: 46px; border-radius: 50%; padding: 0; font-size: 18px; flex: none; }
.msg-alert { margin: 0 12px 8px; }
.msg-info h3 { margin: 18px 0 6px; font-size: 15px; }
.msg-members { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.msg-members li { display: flex; align-items: center; gap: 10px; }
.msg-members li > span:nth-child(2) { flex: 1; }
.msg-pickers { display: grid; gap: 6px; max-height: 220px; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; padding: 10px; margin: 8px 0; }
.msg-chiplist { display: flex; flex-wrap: wrap; gap: 8px; }
.msg-join { text-align: center; }
.msg-top { position: relative; }
.msg-dot { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 999px; background: var(--danger, #c0392b); color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; line-height: 1; }
.fr-msg { margin-left: auto; }
@media (max-width: 760px) {
  .msg-app { grid-template-columns: 1fr; height: calc(100dvh - 120px); border-radius: 0; border-left: 0; border-right: 0; margin: -8px -16px 0; }
  .msg-app.has-thread .msg-list { display: none; }
  .msg-app:not(.has-thread) .msg-pane { display: none; }
  .msg-head-txt small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .msg-del { position: absolute; top: auto; bottom: 2px; right: auto; left: 8px; opacity: .55; }
  .msg-bubble { max-width: 86%; }
}

/* App update popup for older Android app versions (update 27.1) */
.upd-pop { position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,.45); display: grid; place-items: end center; padding: 16px; }
.upd-card { width: min(440px, 100%); background: var(--panel); border-radius: 20px; padding: 20px; display: grid; gap: 12px; box-shadow: var(--shadow); margin-bottom: max(16px, env(safe-area-inset-bottom, 0px)); }
.upd-card h2 { margin: 0; font-size: 20px; } .upd-card p { margin: 0; color: var(--muted); }

/* Update 28: message ticks and the live alert banner (new message / incoming call) on every page */
.msg-tick { margin-left: 4px; font-size: .78em; letter-spacing: -2px; color: var(--muted, #8a857a); font-weight: 600; }
.msg-tick.seen { color: #2b8fe0; }
.live-alert { position: fixed; top: calc(10px + env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%); z-index: 120;
  width: min(440px, calc(100% - 20px)); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 10px 10px 12px;
  background: var(--panel, #fff); color: var(--text, #222); border: 1px solid var(--border, rgba(0,0,0,.12)); border-radius: 16px;
  box-shadow: 0 12px 32px rgba(0,0,0,.22); animation: live-in .28s ease-out; }
.live-alert.live-call { border-color: var(--green, #1f7a48); box-shadow: 0 0 0 3px rgba(31,122,72,.18), 0 12px 32px rgba(0,0,0,.25); }
.live-alert.live-msg { flex-wrap: nowrap; }
.live-alert .live-main { display: flex; align-items: center; gap: 10px; flex: 1 1 0; min-width: 0; min-height: 0; height: auto; padding: 0; margin: 0; color: inherit; text-decoration: none; background: none; border: 0; }
.live-alert.live-call .live-main { flex-basis: 100%; }
.live-ico { font-size: 1.5rem; line-height: 1; }
.live-alert.live-call .live-ico { animation: live-pulse 1s ease-in-out infinite; }
.live-txt { display: flex; flex-direction: column; min-width: 0; }
.live-txt b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-txt small { color: var(--muted, #6b675e); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.live-alert .live-btn { flex: 1 1 0; width: auto; margin: 0; padding: 8px 14px; min-height: 42px; }
.live-alert .live-x { flex: 0 0 auto; width: auto; min-height: 0; margin: 0; background: none; border: 0; box-shadow: none; color: var(--muted, #6b675e); font-size: 1rem; padding: 6px 8px; cursor: pointer; align-self: flex-start; }
.live-alert.live-call .live-x { position: absolute; top: 6px; right: 6px; }
@keyframes live-in { from { opacity: 0; transform: translate(-50%, -14px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes live-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.18); } }
@media (prefers-reduced-motion: reduce) { .live-alert, .live-alert.live-call .live-ico { animation: none; } }
