/* AjonTec Social — mobile-first app styles */
:root {
  --primary: #3D5AFE; --accent: #FFB020;
  --bg: #F7F8FB; --surface: #FFFFFF; --ink: #0E1530; --muted: #6A7393; --line: #E3E7F1;
  --ok: #1E9E6A; --warn: #C27A00; --bad: #D23B3B;
  --bubble-me: #DCE6FF; --bubble-ai: #FFFFFF;
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}
:root[data-theme="dark"] { --bg: #0A0F1F; --surface: #131B37; --ink: #ECEFFA; --muted: #8E97B8; --line: #232C4E; --bubble-me: #24356F; --bubble-ai: #1A2440; color-scheme: dark; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body { font-family: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); color: var(--ink); font-size: 16px; line-height: 1.5; -webkit-tap-highlight-color: transparent; }
#app { max-width: 560px; margin: 0 auto; min-height: 100%; display: flex; flex-direction: column; padding-top: var(--safe-t); }
.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: var(--bg); font-family: "Bricolage Grotesque", "Figtree", sans-serif; font-weight: 700; font-size: 18px; letter-spacing: -0.02em; }
.topbar a.home { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.topbar .tbtn { margin-left: auto; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.topbar .tbtn svg { width: 18px; height: 18px; }
.ico-dark { display: none; } :root[data-theme="dark"] .ico-dark { display: block; } :root[data-theme="dark"] .ico-light { display: none; }
.topbar img { width: 30px; height: 30px; border-radius: 8px; object-fit: cover; }
main { flex: 1; padding: 4px 16px calc(96px + var(--safe-b)); outline: none; }
h1 { font-family: "Bricolage Grotesque", "Figtree", sans-serif; font-size: 26px; line-height: 1.15; letter-spacing: -0.025em; margin: 8px 0 18px; font-weight: 700; }
h2 { font-family: "Bricolage Grotesque", "Figtree", sans-serif; font-weight: 650; font-size: 17px; margin: 26px 0 10px; }
p { margin: 0 0 12px; } .muted { color: var(--muted); } small { color: var(--muted); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 16px; margin-bottom: 12px; }
.hero { background: var(--primary); color: #fff; border: 0; border-radius: 24px; padding: 20px; }
.hero .when { font-family: "Bricolage Grotesque", "Figtree", sans-serif; font-size: 26px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; margin: 4px 0 6px; }
.hero p { color: rgba(255,255,255,.85); }
label { display: block; font-size: 14px; font-weight: 600; margin: 14px 0 6px; }
input, select, textarea { width: 100%; font: inherit; color: var(--ink); background: var(--surface); border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; }
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); outline: none; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 55%, transparent); outline-offset: 2px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 700; border: 0; border-radius: 14px; padding: 13px 18px; background: var(--primary); color: #fff; cursor: pointer; text-decoration: none; }
.btn.block { width: 100%; } .btn.ghost { background: transparent; color: var(--primary); border: 1.5px solid var(--line); }
.btn.light { background: #fff; color: var(--primary); } .btn.danger { background: transparent; color: var(--bad); border: 1.5px solid var(--line); }
.btn:disabled { opacity: .55; }
.row { display: flex; gap: 10px; align-items: center; } .row > * { flex: 1; } .spread { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.link { background: none; border: 0; color: var(--primary); font: inherit; font-weight: 600; padding: 12px 0; cursor: pointer; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 10px 14px; font: inherit; font-weight: 600; font-size: 15px; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.price { position: sticky; bottom: calc(78px + var(--safe-b)); background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 14px 16px; margin-top: 18px; box-shadow: 0 10px 30px -12px rgba(27,33,64,.25); }
.price .amt { font-family: "Bricolage Grotesque", "Figtree", sans-serif; font-size: 30px; font-weight: 700; letter-spacing: -0.02em; }
.status { font-size: 13px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--bg); white-space: nowrap; }
.status.awaiting_approval { background: #FFF1D6; color: var(--warn); } .status.published { background: #DDF5EA; color: var(--ok); } .status.failed { background: #FBE1E1; color: var(--bad); }
.post { display: grid; grid-template-columns: 64px 1fr; gap: 12px; align-items: start; }
.post img, .post .ph { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; background: var(--line); }
.post .cap { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 14px; color: var(--muted); }
.switch { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 6px 0; }
.switch input { width: 48px; height: 28px; appearance: none; background: var(--line); border-radius: 999px; position: relative; border: 0; padding: 0; flex: none; cursor: pointer; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: left .15s; }
.switch input:checked { background: var(--primary); } .switch input:checked::after { left: 23px; }
/* Tabs */
.tabs { position: fixed; bottom: 0; left: 0; right: 0; z-index: 10; display: flex; justify-content: center; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: var(--safe-b); }
.tabs .in { display: flex; width: 100%; max-width: 560px; }
.tabs button { flex: 1; background: none; border: 0; padding: 9px 2px 10px; font: inherit; font-size: 12px; font-weight: 600; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 3px; cursor: pointer; }
.tabs button svg { width: 24px; height: 24px; } .tabs button[aria-current="page"] { color: var(--primary); }
.tabs .dot { position: absolute; transform: translate(10px, -2px); width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
/* Chat */
.chat { display: flex; flex-direction: column; gap: 8px; padding-bottom: 80px; }
.msg { max-width: 86%; padding: 9px 12px; border-radius: 16px; background: var(--bubble-ai); border: 1px solid var(--line); white-space: pre-wrap; word-wrap: break-word; font-size: 15px; }
.msg.client { align-self: flex-end; background: var(--bubble-me); border-color: transparent; border-bottom-right-radius: 6px; }
.msg.ai, .msg.system { align-self: flex-start; border-bottom-left-radius: 6px; } .msg.system { background: transparent; color: var(--muted); font-size: 14px; }
.msg time { display: block; font-size: 11px; color: var(--muted); text-align: right; margin-top: 2px; }
.preview { align-self: flex-start; width: 88%; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.preview img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; background: var(--line); }
.preview .body { padding: 12px 14px; font-size: 14px; white-space: pre-wrap; } .preview .tags { color: var(--primary); }
.preview .acts { display: flex; border-top: 1px solid var(--line); } .preview .acts button { flex: 1; padding: 12px; background: none; border: 0; font: inherit; font-weight: 700; color: var(--primary); cursor: pointer; } .preview .acts button + button { border-left: 1px solid var(--line); }
.composer { position: fixed; left: 0; right: 0; bottom: calc(62px + var(--safe-b)); display: flex; justify-content: center; padding: 8px 12px; background: var(--bg); }
.composer .in { display: flex; gap: 8px; width: 100%; max-width: 536px; }
.composer input { border-radius: 999px; }
.round { width: 48px; height: 48px; flex: none; border-radius: 50%; border: 0; background: var(--primary); color: #fff; display: grid; place-items: center; cursor: pointer; }
.round.rec { background: var(--bad); } .round svg { width: 22px; height: 22px; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; } .stats .panel { margin: 0; } .stats b { display: block; font-size: 24px; }
.powered { text-align: center; font-size: 12px; color: var(--muted); padding: 0 0 calc(70px + var(--safe-b)); }
#toast { position: fixed; left: 50%; bottom: calc(150px + var(--safe-b)); transform: translateX(-50%); background: var(--ink); color: var(--surface); padding: 10px 16px; border-radius: 12px; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .2s; max-width: 90%; }
#toast.show { opacity: 1; }
.auth { padding-top: 6vh; } .auth .tag { font-family: "Bricolage Grotesque", "Figtree", sans-serif; font-size: 30px; font-weight: 700; line-height: 1.1; letter-spacing: -0.025em; margin-bottom: 22px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

.progress { height: 6px; border-radius: 6px; background: var(--line); overflow: hidden; margin-top: 10px; } .progress i { display: block; height: 100%; background: var(--primary); transition: width .3s; }
.langrow { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
