/* KYYNO STORE - mobile-first */
:root {
  --bg: #07040d;
  --bg-2: #0f0820;
  --surface: #160b2b;
  --surface-2: #21123f;
  --line: #3a2268;
  --electric: #9b3dff;
  --violet: #6d3bf0;
  --magenta: #e83cff;
  --text: #ffffff;
  --muted: #b9afd0;
  --ok: #25d366;
  --danger: #ff5a7a;
  --radius: 14px;
  --glow: 0 0 0 1px rgba(155, 61, 255, .45), 0 8px 28px -8px rgba(155, 61, 255, .55);
  --font-head: "Chakra Petch", "Segoe UI", sans-serif;
  --font-body: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --bn-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(155, 61, 255, .22), transparent 60%),
    radial-gradient(700px 480px at -10% 30%, rgba(232, 60, 255, .10), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  padding-bottom: calc(var(--bn-h) + env(safe-area-inset-bottom));
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-head); font-style: italic; font-weight: 700; line-height: 1.1; margin: 0; letter-spacing: .01em; }
p { margin: 0; }
[hidden] { display: none !important; }

:focus-visible { outline: 3px solid var(--magenta); outline-offset: 2px; border-radius: 6px; }

.container { width: min(1120px, 100% - 32px); margin-inline: auto; }
.section { padding: 40px 0 8px; }
.section-head { display: flex; flex-direction: column; gap: 4px; margin-bottom: 18px; }
.section-head h2 { font-size: clamp(1.6rem, 5vw, 2.2rem); }
.section-head p { color: var(--muted); max-width: 52ch; }

/* ---------- Header ---------- */
.topbar { position: sticky; top: 0; z-index: 50; background: rgba(7, 4, 13, .82); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.topbar-inner { width: min(1120px, 100% - 32px); margin-inline: auto; height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: baseline; gap: 6px; text-decoration: none; font-family: var(--font-head); font-style: italic; font-weight: 700; font-size: 1.45rem; }
.brand-mark { color: #fff; text-shadow: 0 0 18px rgba(155, 61, 255, .8); }
.brand-sub { background: linear-gradient(180deg, var(--magenta), var(--violet)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nav-desktop { display: none; gap: 4px; }
.nav-link { padding: 8px 14px; border-radius: 10px; text-decoration: none; color: var(--muted); font-weight: 600; transition: color .2s, background .2s; }
.nav-link:hover, .nav-link.is-active { color: #fff; background: var(--surface-2); }
.account { display: flex; align-items: center; gap: 10px; }
.who { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-weight: 600; font-size: .9rem; }

/* ---------- Bottom nav (mobile) ---------- */
.bottom-nav { position: fixed; inset: auto 0 0 0; z-index: 60; height: calc(var(--bn-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: rgba(15, 8, 32, .94); backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
.bn-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 48px; border: 0; background: none; color: var(--muted); font: 600 .7rem var(--font-body); text-decoration: none; cursor: pointer; }
.bn-item.is-active { color: var(--magenta); }
.bn-item:active { background: var(--surface-2); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 20px; border-radius: 12px; border: 1px solid transparent; font: 700 .95rem var(--font-body); text-decoration: none; cursor: pointer; transition: transform .15s, box-shadow .2s, background .2s; }
.btn:active { transform: scale(.98); }
.btn-sm { min-height: 40px; padding: 0 14px; font-size: .85rem; }
.btn-block { width: 100%; }
.btn-primary { color: #fff; background: linear-gradient(135deg, var(--electric), var(--violet)); box-shadow: var(--glow); }
.btn-primary:hover { box-shadow: 0 0 0 1px var(--magenta), 0 10px 34px -6px rgba(232, 60, 255, .6); }
.btn-ghost { color: var(--text); background: transparent; border-color: var(--line); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-outline { color: #fff; border-color: var(--electric); background: transparent; }
.btn-outline:hover { background: rgba(155, 61, 255, .18); }
.btn-wa { color: #04200f; background: var(--ok); }
.btn-wa:hover { filter: brightness(1.08); }
.btn-disabled, .btn:disabled { color: var(--muted); background: var(--surface-2); border-color: var(--line); box-shadow: none; cursor: not-allowed; }

/* ---------- Banner mode demo ---------- */
.demo-banner { background: linear-gradient(90deg, rgba(232, 60, 255, .2), rgba(109, 59, 240, .2)); border-bottom: 1px solid var(--magenta); padding: 10px 16px; text-align: center; font-size: .9rem; }

/* ---------- Hero ---------- */
.hero { padding: 28px 0 8px; }
.hero-grid { display: grid; gap: 28px; align-items: center; }
.hero-copy { display: flex; flex-direction: column; gap: 16px; }
.hero h1 { font-size: clamp(2.3rem, 9vw, 4.2rem); transform: skewX(-4deg); text-shadow: 0 0 40px rgba(155, 61, 255, .55); }
.hero h1 span { display: block; background: linear-gradient(180deg, #fff, var(--electric) 60%, var(--magenta)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { color: var(--muted); font-size: 1.05rem; max-width: 46ch; }
.search { display: flex; gap: 8px; padding: 6px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--glow); }
.search input { flex: 1; min-width: 0; height: 46px; padding: 0 14px; border: 0; background: transparent; color: #fff; font: 500 1rem var(--font-body); }
.search input::placeholder { color: #8c80a8; }
.search input:focus-visible { outline: none; }
.search:focus-within { border-color: var(--magenta); }
.hero-art { position: relative; justify-self: center; width: min(420px, 88%); }
.hero-art::before { content: ""; position: absolute; inset: -6%; background: radial-gradient(closest-side, rgba(155, 61, 255, .6), transparent 70%); filter: blur(18px); z-index: 0; }
.hero-art img { position: relative; z-index: 1; border-radius: 22px; border: 1px solid var(--electric); box-shadow: 0 24px 60px -18px rgba(155, 61, 255, .8); transform: rotate(-3deg); animation: float 7s ease-in-out infinite; }
@keyframes float { 0%, 100% { transform: rotate(-3deg) translateY(0); } 50% { transform: rotate(-3deg) translateY(-8px); } }
.notice { font-size: .85rem; color: var(--muted); border-left: 3px solid var(--magenta); padding: 6px 12px; background: rgba(232, 60, 255, .06); border-radius: 0 8px 8px 0; }

/* ---------- Kategori ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 10px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; min-height: 42px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font: 600 .9rem var(--font-body); cursor: pointer; transition: all .2s; }
.chip:hover { color: #fff; border-color: var(--electric); }
.chip.is-active { color: #fff; background: linear-gradient(135deg, var(--electric), var(--violet)); border-color: transparent; box-shadow: var(--glow); }

/* ---------- Grid & kartu ---------- */
.grid { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-need, .grid-service { grid-template-columns: 1fr; }
.card { display: flex; flex-direction: column; overflow: hidden; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); transition: border-color .2s, box-shadow .2s; }
.card:hover { border-color: var(--electric); box-shadow: var(--glow); }
.card-body { display: flex; flex-direction: column; gap: 8px; padding: 12px; flex: 1; }
.card-body .btn { margin-top: auto; }
.card-title { font-size: 1.05rem; font-style: normal; font-family: var(--font-body); font-weight: 700; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.price { font: 700 1.1rem var(--font-head); font-style: italic; color: var(--magenta); }
.meta { color: var(--muted); font-size: .8rem; }
.clamp { color: var(--muted); font-size: .9rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.thumb { position: relative; aspect-ratio: 4 / 3; background: var(--bg-2); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-empty { height: 100%; display: grid; place-items: center; color: var(--muted); font-size: .85rem; }
.badge { position: absolute; top: 8px; left: 8px; padding: 3px 10px; border-radius: 999px; font-size: .72rem; font-weight: 700; background: rgba(7, 4, 13, .8); border: 1px solid var(--electric); }
.badge-sold { left: auto; right: 8px; border-color: var(--danger); color: var(--danger); }
.badge-inline { position: static; align-self: flex-start; }
.product.is-sold img { filter: grayscale(.8) brightness(.7); }
.ticks { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: .92rem; }
.ticks li { padding-left: 22px; position: relative; }
.ticks li::before { content: ""; position: absolute; left: 4px; top: .5em; width: 8px; height: 8px; border-radius: 50%; background: var(--magenta); box-shadow: 0 0 8px var(--magenta); }

/* ---------- State ---------- */
.state { grid-column: 1 / -1; padding: 28px 18px; text-align: center; border: 1px dashed var(--line); border-radius: var(--radius); background: rgba(22, 11, 43, .5); }
.state strong { display: block; font-size: 1.05rem; margin-bottom: 4px; }
.state p { color: var(--muted); max-width: 46ch; margin-inline: auto; }
.state-error { border-color: var(--danger); }
.skeleton { min-height: 250px; background: linear-gradient(100deg, var(--surface) 30%, var(--surface-2) 50%, var(--surface) 70%); background-size: 300% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -300% 0; } }

/* ---------- Statistik ---------- */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.stat { padding: 18px 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.stat b { display: block; font: 700 1.9rem var(--font-head); font-style: italic; }
.stat span { color: var(--muted); font-size: .9rem; }

/* ---------- Footer ---------- */
.footer { margin-top: 56px; padding: 28px 0 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: .88rem; }
.footer-grid { display: grid; gap: 14px; }
.footer .warn { padding: 12px 14px; border-radius: 10px; background: rgba(255, 90, 122, .08); border: 1px solid rgba(255, 90, 122, .4); color: #ffd3dc; }

/* ---------- Auth ---------- */
.auth-wrap { min-height: calc(100dvh - 60px - var(--bn-h)); display: grid; align-items: center; padding: 24px 0; }
.auth-card { width: min(440px, 100%); margin-inline: auto; padding: 22px 18px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--glow); display: grid; gap: 18px; }
.auth-card h1 { font-size: 1.8rem; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); }
.tab { min-height: 44px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font: 700 .95rem var(--font-body); cursor: pointer; }
.tab.is-active { color: #fff; background: linear-gradient(135deg, var(--electric), var(--violet)); }
.form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 600; font-size: .9rem; }
.field input { width: 100%; height: 48px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-2); color: #fff; font: 500 1rem var(--font-body); }
.field input:focus-visible { outline: none; border-color: var(--magenta); box-shadow: 0 0 0 3px rgba(232, 60, 255, .25); }
.field small { color: var(--muted); }
.form-error { padding: 10px 12px; border-radius: 10px; background: rgba(255, 90, 122, .1); border: 1px solid var(--danger); color: #ffd3dc; font-size: .9rem; }

/* ---------- Toast ---------- */
#toasts { position: fixed; z-index: 100; left: 16px; right: 16px; bottom: calc(var(--bn-h) + 16px + env(safe-area-inset-bottom)); display: grid; gap: 8px; pointer-events: none; }
.toast { justify-self: center; max-width: 420px; padding: 12px 16px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--electric); box-shadow: var(--glow); font-weight: 600; font-size: .92rem; }
.toast-success { border-color: var(--ok); }
.toast-error { border-color: var(--danger); }

/* ---------- Tablet ---------- */
@media (min-width: 600px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-need, .grid-service { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats { grid-template-columns: repeat(4, 1fr); }
}

/* ---------- Desktop ---------- */
@media (min-width: 860px) {
  body { padding-bottom: 0; }
  .bottom-nav { display: none; }
  .nav-desktop { display: flex; }
  .hero { padding-top: 56px; }
  .hero-grid { grid-template-columns: 1.1fr .9fr; gap: 48px; }
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .grid-need, .grid-service { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .section { padding-top: 64px; }
  .footer-grid { grid-template-columns: 1.2fr 1fr; align-items: start; }
  .auth-wrap { min-height: calc(100dvh - 60px); }
  #toasts { bottom: 24px; left: auto; right: 24px; }
  .who { max-width: 180px; }
}

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

/* ---------- Panel admin ---------- */
.admin { padding-top: 20px; padding-bottom: 24px; }
.admin-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.admin-head h1 { font-size: clamp(1.6rem, 5vw, 2.2rem); }
.admin-pane { margin-top: 16px; display: grid; gap: 14px; }
.admin-h2 { font-size: 1.3rem; }
.pos { color: #4ade80; }
.neg { color: var(--danger); }

.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.kpi { display: flex; flex-direction: column; gap: 2px; padding: 14px 12px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); min-width: 0; }
.kpi span { color: var(--muted); font-size: .82rem; }
.kpi b { font: 700 1.2rem var(--font-head); font-style: italic; overflow-wrap: anywhere; }
.kpi small { color: var(--muted); font-size: .75rem; }
.kpi:first-child { grid-column: 1 / -1; border-color: var(--electric); box-shadow: var(--glow); }
.kpi:first-child b { font-size: 1.8rem; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { padding: 10px 12px; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--line); }
.table th { color: var(--muted); font-weight: 600; background: var(--surface); }
.table tr:last-child td { border-bottom: 0; }

.stock-list { display: grid; gap: 12px; }
.acard { flex-direction: row; }
.acard-thumb { flex: 0 0 96px; background: var(--bg-2); display: grid; place-items: center; color: var(--muted); font-size: .75rem; text-align: center; }
.acard-thumb img { width: 100%; height: 100%; object-fit: cover; }
.acard.is-sold .acard-thumb img { filter: grayscale(.8) brightness(.7); }
.acard-body { flex: 1; min-width: 0; padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.acard-top { display: flex; align-items: center; gap: 8px; }
.pill { padding: 2px 10px; border-radius: 999px; font-size: .72rem; font-weight: 700; border: 1px solid; }
.pill-ok { color: #4ade80; border-color: #4ade80; background: rgba(74, 222, 128, .1); }
.pill-sold { color: var(--danger); border-color: var(--danger); background: rgba(255, 90, 122, .1); }
.profit { font-weight: 700; }
.acard-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.btn-danger { color: var(--danger); border-color: rgba(255, 90, 122, .5); }
.btn-danger:hover { background: rgba(255, 90, 122, .12); }

.field select, .field textarea { width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-2); color: #fff; font: 500 1rem var(--font-body); }
.field select { height: 48px; padding: 0 12px; }
.field textarea { resize: vertical; min-height: 88px; }
.field select:focus-visible, .field textarea:focus-visible { outline: none; border-color: var(--magenta); box-shadow: 0 0 0 3px rgba(232, 60, 255, .25); }
.row2 { display: grid; gap: 14px; grid-template-columns: 1fr; }

.thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.thumbs:empty { display: none; }
.thumb-item { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.thumb-item img { width: 100%; height: 100%; object-fit: cover; }
.thumb-x { position: absolute; top: 2px; right: 2px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(7, 4, 13, .85); color: #fff; font-size: 1.1rem; line-height: 1; cursor: pointer; }

dialog.sheet { width: min(560px, 100%); max-height: 92dvh; margin: auto auto 0; padding: 0; border: 1px solid var(--line); border-radius: 18px 18px 0 0; background: var(--surface); color: #fff; box-shadow: var(--glow); }
dialog.sheet::backdrop { background: rgba(0, 0, 0, .72); }
.sheet-body { padding: 18px; max-height: 92dvh; overflow-y: auto; }
.sheet-body h2 { font-size: 1.5rem; }
.sheet-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; position: sticky; bottom: -18px; padding: 12px 0 4px; background: linear-gradient(to top, var(--surface) 70%, transparent); }

@media (min-width: 600px) {
  .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .kpi:first-child { grid-column: span 2; }
  .row2 { grid-template-columns: 1fr 1fr; }
  .acard-thumb { flex-basis: 140px; }
}
@media (min-width: 860px) {
  dialog.sheet { margin: auto; border-radius: 18px; }
  .stock-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 479px) {
  .who { display: none; }
}

/* ---------- Tambahan: tab 3, badge, centang, titik notif ---------- */
.tabs-3 { grid-template-columns: repeat(3, 1fr); }
.pill-wait { color: #fbbf24; border-color: #fbbf24; background: rgba(251, 191, 36, .1); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; color: var(--muted); }
.check input { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--electric); flex: 0 0 auto; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--magenta); box-shadow: 0 0 8px var(--magenta); margin-left: 6px; }
.bn-item { position: relative; }
.bn-item .dot { position: absolute; top: 8px; left: calc(50% + 8px); margin: 0; }

/* ---------- Chat ---------- */
.chat-wrap { padding-top: 20px; padding-bottom: 24px; }
.chat-wrap h1 { font-size: clamp(1.6rem, 5vw, 2.2rem); margin-bottom: 14px; }
.newchat { display: flex; gap: 8px; margin-bottom: 14px; }
.newchat input { flex: 1; min-width: 0; height: 46px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-2); color: #fff; font: 500 1rem var(--font-body); }
.newchat input:focus-visible { outline: none; border-color: var(--magenta); }
.chat-list { display: grid; gap: 8px; }
.chat-item { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); text-decoration: none; }
.chat-item:hover { border-color: var(--electric); }
.avatar { flex: 0 0 44px; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font: 700 1.1rem var(--font-head); background: linear-gradient(135deg, var(--electric), var(--violet)); }
.avatar-mc { background: linear-gradient(135deg, var(--magenta), var(--violet)); font-size: .95rem; }
.chat-item .txt { flex: 1; min-width: 0; }
.chat-item strong { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chat-item p { color: var(--muted); font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-item .end { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.chat-item time { color: var(--muted); font-size: .72rem; white-space: nowrap; }

.thread { display: flex; flex-direction: column; width: min(760px, 100%); margin-inline: auto; height: calc(100dvh - 60px - var(--bn-h) - env(safe-area-inset-bottom)); }
.thread-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); background: rgba(15, 8, 32, .9); }
.thread-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.thread-title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-title small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-actions { display: flex; gap: 6px; }
.thread-banner { padding: 10px 14px; background: rgba(155, 61, 255, .12); border-bottom: 1px solid var(--line); font-size: .88rem; }
.thread-banner a { text-decoration: underline; }
.banner-actions { display: flex; gap: 8px; margin-top: 8px; }
.msgs { flex: 1; overflow-y: auto; padding: 14px 12px; display: flex; flex-direction: column; gap: 8px; overscroll-behavior: contain; }
.bubble { max-width: 82%; padding: 8px 12px 6px; border-radius: 16px; display: flex; flex-direction: column; gap: 4px; overflow-wrap: anywhere; }
.bubble p { white-space: pre-wrap; }
.bubble time { align-self: flex-end; font-size: .68rem; opacity: .7; }
.bubble.mine { align-self: flex-end; background: linear-gradient(135deg, var(--electric), var(--violet)); border-bottom-right-radius: 4px; }
.bubble.theirs { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.who-tag { font-size: .75rem; font-weight: 700; color: var(--magenta); }
.who-tag em { font-style: normal; color: var(--muted); font-weight: 600; }
.chat-img { max-width: min(260px, 100%); border-radius: 12px; cursor: zoom-in; min-height: 60px; background: var(--bg-2); }
.bubble audio { width: min(240px, 100%); height: 40px; }
.msg-sys { align-self: center; max-width: 90%; text-align: center; padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-size: .8rem; }

.composer { padding: 8px 10px; border-top: 1px solid var(--line); background: rgba(15, 8, 32, .96); }
.composer-off { padding: 14px; text-align: center; color: var(--muted); border-top: 1px solid var(--line); font-size: .9rem; }
.comp-row { display: flex; align-items: flex-end; gap: 6px; }
.comp-row textarea { flex: 1; min-width: 0; resize: none; max-height: 120px; padding: 11px 14px; border-radius: 20px; border: 1px solid var(--line); background: var(--bg-2); color: #fff; font: 500 1rem var(--font-body); line-height: 1.35; }
.comp-row textarea:focus-visible { outline: none; border-color: var(--magenta); }
.icon-btn { flex: 0 0 44px; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; border: 0; background: transparent; color: var(--muted); cursor: pointer; text-decoration: none; }
.icon-btn:hover { color: #fff; background: var(--surface-2); }
.icon-primary { color: #fff; background: linear-gradient(135deg, var(--electric), var(--violet)); }
.icon-primary:hover { background: linear-gradient(135deg, var(--magenta), var(--violet)); }
.rec-bar { display: flex; align-items: center; gap: 10px; padding: 2px 4px; }
.rec-bar .meta { flex: 1; }
.rec-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--danger); animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; } }

@media (min-width: 860px) {
  .thread { height: calc(100dvh - 60px); }
}
