/* Rayan chat (ChatGPT-like): collapsible sidebar on the inline-start side, centered column, sticky composer. */
:root { --col: 780px; --side-w: 272px; }
html, body { height: 100%; }
body { overflow: hidden; }
* { scrollbar-width: thin; scrollbar-color: #26334f transparent; }

.app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); height: 100dvh; transition: grid-template-columns .22s ease; }
.app.collapsed { grid-template-columns: 0 minmax(0, 1fr); }
.side { background: var(--side); border-inline-end: 1px solid #0f1830; display: flex; flex-direction: column; min-height: 0; min-width: 0; overflow: hidden; padding: 10px; }
.app.collapsed .side { padding: 0; border: 0; }
.side-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 4px 12px; gap: 8px; }
.side-head .brand img.orb { width: 28px; height: 28px; }
.side-head .brand img.word { height: 18px; }
.icon-btn { background: transparent; border: 0; color: var(--ink-2); width: 38px; height: 38px; border-radius: 10px; cursor: pointer; display: grid; place-items: center; flex: none; }
.icon-btn:hover { background: var(--panel); color: #fff; }
.new-chat { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: transparent; cursor: pointer; font-weight: 600; white-space: nowrap; }
.new-chat:hover { background: var(--panel); border-color: var(--line-2); }
.new-chat svg { color: var(--accent); flex: none; }
.hist-label { color: var(--muted); font-size: 12.5px; padding: 16px 10px 6px; white-space: nowrap; }
.history { flex: 1; overflow-y: auto; min-height: 0; display: flex; flex-direction: column; gap: 1px; }
.hist-item { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-radius: 10px; cursor: pointer; color: var(--ink-2); font-size: 14.5px; }
.hist-item:hover { background: var(--panel); }
.hist-item.active { background: #131e36; color: #fff; }
.hist-item .t { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hist-item .del { opacity: 0; border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 2px 6px; border-radius: 6px; line-height: 1; font-size: 17px; }
.hist-item:hover .del, .hist-item.active .del { opacity: 1; }
.hist-item .del:hover { color: #ff97a6; }
.hist-empty { color: var(--muted); font-size: 13px; padding: 4px 10px; }
.side-foot { border-top: 1px solid #121c33; padding-top: 8px; display: flex; flex-direction: column; gap: 4px; font-size: 13.5px; }
.account { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; }
.account .av { width: 32px; height: 32px; border-radius: 50%; background: var(--panel-2); display: grid; place-items: center; overflow: hidden; flex: none; font-weight: 700; color: var(--accent); }
.account .av img { width: 100%; height: 100%; object-fit: cover; }
.account .who { flex: 1; min-width: 0; line-height: 1.35; }
.account .who b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.account .who small { color: var(--muted); font-size: 11.5px; display: block; }
.side-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 0 6px; }
.link-btn { background: transparent; border: 0; color: var(--ink-2); cursor: pointer; padding: 5px 6px; border-radius: 8px; font-size: 13px; }
.link-btn:hover { background: var(--panel); color: #fff; }
.link-btn.danger { color: #ff97a6; }
.side-links { display: flex; gap: 12px; padding: 2px 8px 4px; font-size: 12px; }
.side-links a { color: var(--muted); }
.model-info { color: var(--muted); font-size: 11.5px; padding: 0 8px 4px; }

.scrim { display: none; }
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; position: relative; }
.topbar { display: flex; align-items: center; gap: 6px; padding: 8px 12px; min-height: 54px; }
.topbar .title { font-weight: 700; font-size: 17px; display: flex; align-items: center; gap: 8px; }
.topbar .sp { flex: 1; }
.app:not(.collapsed) .only-collapsed { display: none; }
.loadbar { position: absolute; inset-inline: 0; top: 0; height: 2px; }
.loadbar .fill { height: 100%; width: 0; background: var(--accent); transition: width .2s, opacity .4s; }
.loadbar.done .fill { opacity: 0; }

.scroll { flex: 1; overflow-y: auto; min-height: 0; overscroll-behavior: contain; }
.welcome { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 20px 18px 30px; }
.welcome.hidden { display: none; }
.welcome .orb-v { width: 72px; height: 72px; border-radius: 50%; overflow: hidden; margin-bottom: 10px; }
.welcome .orb-v video, .welcome .orb-v img { width: 100%; height: 100%; object-fit: cover; display: block; }
.welcome h1 { font-size: clamp(22px, 3.2vw, 30px); margin: 4px 0 22px; font-weight: 700; }
.chips { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: min(var(--col), 100%); }
.chip { text-align: start; background: transparent; border: 1px solid var(--line); border-radius: 16px; padding: 12px 16px; cursor: pointer; color: var(--ink-2); font-size: 14.5px; line-height: 1.6; }
.chip:hover { background: var(--panel); border-color: var(--line-2); color: #fff; }

.thread { width: min(var(--col), 100%); margin: 0 auto; padding: 8px 18px 30px; }
.msg { margin: 18px 0; }
.msg.user { display: flex; justify-content: flex-end; }
.msg.user .bubble { background: #15203a; border-radius: 20px; padding: 10px 18px; max-width: 80%; white-space: pre-wrap; word-wrap: break-word; }
.msg.bot { display: flex; gap: 14px; align-items: flex-start; }
.avatar { flex: none; width: 32px; height: 32px; border-radius: 50%; overflow: hidden; margin-top: 2px; }
.avatar img, .avatar video { width: 100%; height: 100%; object-fit: cover; display: block; }
.bot-body { flex: 1; min-width: 0; }
.tier-label { color: var(--muted); font-size: 12.5px; font-weight: 600; margin-bottom: 2px; }
.badge { display: inline-block; font-size: 12px; color: #8cc4ff; background: var(--accent-soft); border-radius: 99px; padding: 1px 10px; margin-bottom: 6px; }
.content { word-wrap: break-word; }
.content p { margin: 0 0 12px; }
.content p:last-child { margin-bottom: 0; }
.content h3, .content h4, .content h5, .content h6 { margin: 18px 0 8px; }
.content ul, .content ol { margin: 0 0 12px; padding-inline-start: 24px; }
.content blockquote { margin: 0 0 12px; border-inline-start: 3px solid var(--line-2); padding-inline-start: 12px; color: var(--ink-2); }
.content code { background: #111a2e; border-radius: 6px; padding: 1px 6px; font-size: .9em; font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; }
.content.quote { border-inline-start: 3px solid var(--accent); padding-inline-start: 12px; }
.content.pending { color: var(--muted); }
.content .note-weak { color: var(--muted); font-size: 12.5px; }
.code { margin: 10px 0 14px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: #070c18; direction: ltr; text-align: left; }
.code-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 12px; background: #0e1628; color: var(--muted); font-size: 12.5px; font-family: ui-monospace, Menlo, monospace; }
.copy-code { background: transparent; border: 0; color: var(--muted); cursor: pointer; font-family: 'Vazirmatn', sans-serif; font-size: 12.5px; }
.copy-code:hover { color: #fff; }
.code pre { margin: 0; padding: 14px 16px; overflow-x: auto; font-size: 13.5px; line-height: 1.6; }
.code pre code { background: none; padding: 0; font-size: inherit; }
.cursor::after { content: ''; display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); margin-inline-start: 6px; vertical-align: middle; animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; transform: scale(.7); } }
.dots::after { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); animation: pulse 1s ease-in-out infinite; }
.think { margin: 0 0 12px; border-inline-start: 2px solid var(--line); padding-inline-start: 12px; }
.think summary { cursor: pointer; color: var(--muted); font-size: 14px; list-style: none; }
.think summary::-webkit-details-marker { display: none; }
.think.live summary { background: linear-gradient(90deg, var(--muted), #fff, var(--muted)); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimmer 1.6s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.think-body { color: var(--muted); font-size: 14px; white-space: pre-wrap; margin-top: 6px; max-height: 320px; overflow: auto; }
.sources { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.sources a { font-size: 12.5px; background: var(--panel); border: 1px solid var(--line); border-radius: 99px; padding: 2px 10px; color: var(--ink-2); }
.actions { display: flex; gap: 2px; margin-top: 6px; }
.actions button { background: transparent; border: 0; color: var(--muted); cursor: pointer; padding: 5px 6px; border-radius: 8px; display: grid; place-items: center; }
.actions button:hover { background: var(--panel); color: #fff; }
.actions .meta { color: #56637d; font-size: 11.5px; align-self: center; margin-inline-start: 6px; }

.composer-wrap { padding: 0 14px calc(10px + env(safe-area-inset-bottom)); background: var(--bg); }
.composer { width: min(var(--col), 100%); margin: 0 auto; background: var(--panel); border: 1px solid var(--line); border-radius: 26px; padding: 10px 10px 8px 10px; box-shadow: 0 10px 40px -20px #000; transition: border-color .15s; }
.composer:focus-within { border-color: var(--line-2); }
.composer textarea { width: 100%; resize: none; border: 0; outline: 0; background: transparent; color: var(--ink); font: inherit; padding: 6px 10px; max-height: 220px; line-height: 1.7; }
.composer textarea::placeholder { color: #6f7b95; }
.composer-row { display: flex; align-items: center; gap: 6px; }
.composer-row .sp { flex: 1; min-width: 0; }
.status { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status.err { color: #ff97a6; }
.tool { display: inline-flex; align-items: center; gap: 6px; background: transparent; border: 1px solid var(--line); border-radius: 99px; padding: 5px 12px; cursor: pointer; color: var(--ink-2); font-size: 13px; white-space: nowrap; }
.tool:hover { background: var(--panel-2); }
.tool[aria-pressed=true] { background: var(--accent-soft); border-color: rgba(30,136,255,.5); color: #8cc4ff; }
.send { flex: none; width: 38px; height: 38px; border-radius: 50%; border: 0; background: #fff; color: #000; cursor: pointer; display: grid; place-items: center; }
.send:disabled { background: #2a3550; color: #6f7b95; cursor: default; }
.send.stop { background: #fff; }
.disclaimer { text-align: center; color: var(--muted); font-size: 12px; margin: 8px auto 0; width: min(var(--col), 100%); line-height: 1.6; }

.picker { position: relative; }
.picker-btn { display: inline-flex; align-items: center; gap: 4px; background: transparent; border: 1px solid var(--line); border-radius: 99px; padding: 5px 10px 5px 12px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.picker-btn:hover { background: var(--panel-2); }
.picker-menu { position: absolute; bottom: calc(100% + 8px); inset-inline-start: 0; width: min(330px, 86vw); background: #0d1424; border: 1px solid var(--line-2); border-radius: 16px; padding: 6px; box-shadow: 0 20px 50px -10px #000; z-index: 30; }
.tier { display: grid; grid-template-columns: 1fr auto; text-align: start; width: 100%; background: transparent; border: 0; border-radius: 11px; padding: 10px 12px; cursor: pointer; color: var(--ink); gap: 2px 10px; }
.tier:hover { background: var(--panel-2); }
.tier-name { font-weight: 600; font-size: 14.5px; }
.tier-desc { grid-column: 1; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.tier-check { grid-row: 1 / span 2; grid-column: 2; align-self: center; color: var(--accent); opacity: 0; }
.tier[aria-selected=true] .tier-check { opacity: 1; }
.tier-tag { font-style: normal; font-size: 11px; color: #8cc4ff; background: var(--accent-soft); border-radius: 99px; padding: 0 8px; margin-inline-start: 6px; }
.tier-tag:empty { display: none; }

@media (max-width: 860px) {
  .app, .app.collapsed { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; inset-block: 0; inset-inline-start: 0; width: min(300px, 84vw); z-index: 50; transform: translateX(100%); transition: transform .22s ease; padding: 10px !important; border-inline-end: 1px solid #0f1830 !important; }
  html[dir=ltr] .side { transform: translateX(-100%); }
  .app.side-open .side { transform: none; }
  .app.side-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 40; }
  .app .only-collapsed { display: grid !important; }
  .desk-only { display: none !important; }
  .chips { grid-template-columns: 1fr; }
  .chips .chip:nth-child(n+3) { display: none; }
  .thread { padding: 4px 14px 24px; }
  .msg.user .bubble { max-width: 88%; }
  .msg.bot { gap: 10px; }
  .composer-wrap { padding-inline: 8px; }
  .status { display: none; }
}

/* ---------- v3 ---------- */
.hist-search { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); }
.hist-search input { flex: 1; min-width: 0; background: transparent; border: 0; outline: 0; color: var(--ink); padding: 8px 0; font: inherit; font-size: 14px; }
.hist-search:focus-within { border-color: var(--accent); }
.hist-item .hbtn { opacity: 0; border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 3px 5px; border-radius: 6px; line-height: 1; display: grid; place-items: center; }
.hist-item .hbtn.del { font-size: 17px; }
.hist-item:hover .hbtn, .hist-item.active .hbtn, .hist-item:focus-within .hbtn { opacity: 1; }
.hist-item .hbtn:hover { color: var(--ink); background: var(--panel-2); }
.hist-item .hbtn.del:hover { color: #ff97a6; }
@media (pointer: coarse) { .hist-item .hbtn { opacity: .8; } }
.rename { flex: 1; min-width: 0; background: var(--bg); border: 1px solid var(--accent); border-radius: 6px; color: var(--ink); font: inherit; font-size: 14px; padding: 2px 6px; }
a.account { color: inherit; text-decoration: none !important; }
a.account:hover { background: var(--panel); }
.account .gear { color: var(--muted); flex: none; }
.top-title { color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; max-width: 40vw; }
.tool svg { flex: none; }
.tool.soon { opacity: .7; }
.tool.soon em { font-style: normal; font-size: 10.5px; color: #8cc4ff; background: var(--accent-soft); border-radius: 99px; padding: 0 6px; }
.usage { color: var(--muted); font-size: 12px; white-space: nowrap; }
.usage.low { color: #ffb86b; }
.mic { flex: none; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: transparent; color: var(--ink-2); cursor: pointer; display: grid; place-items: center; }
.mic:hover { background: var(--panel-2); }
.mic.on { background: #ff4d6a; border-color: #ff4d6a; color: #fff; animation: pulse 1.2s ease-in-out infinite; }
.composer-row { flex-wrap: wrap; }
.gen-img { margin: 4px 0 10px; max-width: min(520px, 100%); }
.gen-img img { width: 100%; height: auto; border-radius: 14px; display: block; border: 1px solid var(--line); background: var(--panel); }
.gen-img figcaption { color: var(--muted); font-size: 11.5px; margin-top: 4px; }
.gen-img .img-ph { width: min(420px, 100%); aspect-ratio: 1; border-radius: 14px; background: linear-gradient(110deg, var(--panel) 30%, var(--panel-2) 50%, var(--panel) 70%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
.content.img-caption { color: var(--muted); font-size: 14px; }
.actions .act-fb[aria-pressed=true] { color: var(--accent); }
.actions .countdown { color: #ffb86b; }
.chip { display: flex; flex-direction: column; gap: 2px; }
.chip em { font-style: normal; font-size: 11.5px; color: var(--accent); font-weight: 600; }
/* light theme (chat-specific hard-coded colours) */
html[data-theme=light] .side { border-inline-end-color: var(--line); }
html[data-theme=light] .hist-item.active { background: #dde8fb; color: var(--ink); }
html[data-theme=light] .msg.user .bubble { background: #e6eefc; }
html[data-theme=light] .content code { background: #eef2f8; }
html[data-theme=light] .code { background: #f7f9fd; }
html[data-theme=light] .code-head { background: #eef2f8; }
html[data-theme=light] .picker-menu { background: #fff; }
html[data-theme=light] .send { background: #0b1220; color: #fff; }
html[data-theme=light] .send:disabled { background: #d8dfeb; color: #8a96ad; }
html[data-theme=light] .composer { box-shadow: 0 10px 40px -24px rgba(10,20,40,.35); }
html[data-theme=light] .side-foot { border-top-color: var(--line); }
html[data-theme=light] .icon-btn:hover, html[data-theme=light] .link-btn:hover { color: var(--ink); }
html[data-theme=light] .chip:hover, html[data-theme=light] .hist-item:hover { color: var(--ink); }
@media (max-width: 860px) {
  .usage { order: 10; width: 100%; text-align: center; }
  .tool span { font-size: 12.5px; }
  .top-title { max-width: 46vw; }
}
html[data-theme=light] .actions button:hover, html[data-theme=light] .copy-code:hover, html[data-theme=light] .tier-name { color: var(--ink); }
html[data-theme=light] .scrim { background: rgba(0,0,0,.3); }
.topbar .title { white-space: nowrap; }
/* artifacts panel */
.app.art-open { grid-template-columns: var(--side-w) minmax(0, 1fr) minmax(360px, 46%); }
.app.art-open.collapsed { grid-template-columns: 0 minmax(0, 1fr) minmax(360px, 50%); }
.art-panel { display: flex; flex-direction: column; min-width: 0; min-height: 0; border-inline-start: 1px solid var(--line); background: var(--bg-2); }
.art-head { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-bottom: 1px solid var(--line); min-height: 54px; flex-wrap: wrap; }
.art-name { font-size: 14px; max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.art-files { background: var(--panel); color: var(--ink); border: 1px solid var(--line-2); border-radius: 8px; padding: 3px 6px; max-width: 160px; }
.art-tabs { display: inline-flex; border: 1px solid var(--line-2); border-radius: 999px; padding: 2px; }
.art-tabs button { border: 0; background: transparent; color: var(--ink-2); padding: 3px 12px; border-radius: 999px; cursor: pointer; font-size: 13px; }
.art-tabs button[aria-selected=true] { background: var(--accent); color: #fff; }
.art-head .sp { flex: 1; }
.art-body { flex: 1; min-height: 0; overflow: auto; }
.art-preview { height: 100%; }
.art-preview iframe { width: 100%; height: 100%; min-height: 420px; border: 0; background: #fff; display: block; }
.art-md { padding: 18px 22px; }
.art-code { margin: 0; padding: 14px 16px; font: 13px/1.6 ui-monospace, 'SF Mono', Menlo, Consolas, monospace; white-space: pre; text-align: left; }
.art-table { border-collapse: collapse; margin: 12px; font-size: 13.5px; }
.art-table th, .art-table td { border: 1px solid var(--line-2); padding: 5px 10px; text-align: start; }
.art-table th { background: var(--panel-2); }
.code-tools { display: flex; gap: 10px; }
.actions .act-zip { display: flex; gap: 2px; align-items: center; } .actions .act-zip small { font-size: 10.5px; }
.hl-k { color: #c792ea; font-weight: 600; } .hl-s { color: #c3e88d; } .hl-n { color: #f78c6c; } .hl-c { color: #6b7894; } .hl-t { color: #82aaff; font-weight: 600; } .hl-a { color: #ffcb6b; }
html[data-theme=light] .hl-k { color: #7c3aed; } html[data-theme=light] .hl-s { color: #16803c; } html[data-theme=light] .hl-n { color: #c2410c; } html[data-theme=light] .hl-t { color: #1d4ed8; } html[data-theme=light] .hl-a { color: #a16207; }
@media (max-width: 860px) {
  .app.art-open, .app.art-open.collapsed { grid-template-columns: minmax(0, 1fr); }
  .art-panel { position: fixed; inset: 0; z-index: 60; border: 0; }
}

/* ---------- v4: tables, notices, file cards, question boxes ---------- */
.content hr { border: 0; border-top: 1px solid var(--line-2); margin: 16px 0; }
.content del { opacity: .7; }
.content li > ul, .content li > ol { margin: 4px 0 4px; }
.content li { margin: 3px 0; }
.content a { color: #8cc4ff; text-underline-offset: 3px; }
.content strong { font-weight: 700; color: var(--ink); }
.content h3 { font-size: 1.22em; } .content h4 { font-size: 1.1em; } .content h5, .content h6 { font-size: 1em; }
.content .table-wrap { overflow-x: auto; margin: 4px 0 14px; border: 1px solid var(--line-2); border-radius: 12px; }
.content table { border-collapse: collapse; width: 100%; font-size: 14px; }
.content th, .content td { padding: 8px 12px; border-bottom: 1px solid var(--line); text-align: start; vertical-align: top; }
.content th { background: var(--panel-2); font-weight: 700; white-space: nowrap; }
.content tr:last-child td { border-bottom: 0; }
.content blockquote p:last-child { margin-bottom: 0; }
.notice { font-size: 12.5px; color: #ffd28a; background: rgba(255, 176, 32, .08); border: 1px solid rgba(255, 176, 32, .25); border-radius: 10px; padding: 6px 10px; margin: 4px 0 8px; line-height: 1.7; }
.code.folded { display: none; }
.fcard { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; align-items: center; border: 1px solid var(--line-2); background: rgba(30, 136, 255, .07); border-radius: 14px; padding: 12px 14px; margin: 6px 0 10px; }
.fcard .fic { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; background: var(--accent-soft); color: #8cc4ff; grid-row: span 1; }
.fcard.fk-word .fic { color: #7fb0ff; } .fcard.fk-pdf .fic { color: #ff8f8f; background: rgba(255, 90, 90, .12); }
.fcard .finfo { min-width: 0; } .fcard .finfo b { display: block; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: start; }
.fcard .finfo small { color: var(--muted); font-size: 12.5px; }
.fcard .facts { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; }
.fbtn { border: 1px solid var(--line-2); background: transparent; color: var(--ink-2); border-radius: 99px; padding: 5px 13px; font: inherit; font-size: 13px; cursor: pointer; }
.fbtn:hover { background: var(--panel-2); color: var(--ink); }
.fbtn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.fbtn.primary:hover { filter: brightness(1.1); }
.fbtn.ghost { border-style: dashed; }
.fbtn:disabled { opacity: .55; cursor: default; }
.qbox { border: 1px solid var(--line-2); border-radius: 14px; padding: 12px 14px; margin: 6px 0 10px; background: var(--panel); }
.qbox.preparing { color: var(--muted); font-size: 13.5px; }
.qbox.raw pre { white-space: pre-wrap; margin: 0; font-size: 13px; }
.qgroup + .qgroup { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.qtitle { font-weight: 600; margin-bottom: 8px; line-height: 1.7; }
.qopts { display: flex; flex-wrap: wrap; gap: 8px; }
.qopt { border: 1px solid var(--line-2); background: var(--bg-2, transparent); color: var(--ink); border-radius: 12px; padding: 8px 14px; font: inherit; font-size: 14px; cursor: pointer; text-align: start; line-height: 1.5; transition: background .12s, border-color .12s; }
.qopt:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-soft); }
.qopt.on { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); box-shadow: inset 0 0 0 1px var(--accent); }
.qopt.other { color: var(--muted); border-style: dashed; }
.qopt:disabled { cursor: default; opacity: .6; } .qopt.on:disabled { opacity: 1; }
.qother { display: flex; gap: 8px; margin-top: 8px; }
.qother input { flex: 1; min-width: 0; background: var(--bg, #0b1220); border: 1px solid var(--line-2); border-radius: 10px; color: var(--ink); padding: 8px 12px; font: inherit; font-size: 14px; }
.qother input:focus { outline: none; border-color: var(--accent); }
.qsend { margin-top: 12px; }
.qdone { margin-top: 10px; color: var(--muted); font-size: 13px; white-space: pre-line; }
.art-doc { background: #fff; color: #111827; margin: 14px; border-radius: 6px; padding: 28px 32px; box-shadow: 0 6px 24px -8px #000; }
.art-doc h3, .art-doc h4, .art-doc h5 { color: #0a3d91; } .art-doc a { color: #0a4fb8; } .art-doc th { background: #e3ecfa; } .art-doc code { background: #f2f4f7; color: #111; }
.art-doc .table-wrap { border-color: #9aa7bd; } .art-doc td, .art-doc th { border-bottom-color: #cbd5e1; } .art-doc strong { color: #111827; }
html[data-theme=light] .notice { color: #8a5300; background: #fff6e5; border-color: #ffd08a; }
html[data-theme=light] .content a { color: #0a4fb8; }
html[data-theme=light] .fcard .fic { color: var(--accent); }
html[data-theme=light] .qbox { background: #f7f9fd; }
html[data-theme=light] .qother input { background: #fff; }
html[dir=rtl] .fcard .finfo b { text-align: right; }

select.tool#imgSize { background: transparent; color: var(--ink-2); border: 1px solid var(--line); border-radius: 99px; padding: 4px 8px; font: inherit; font-size: 13px; }
.train-note { display: flex; gap: 10px; align-items: center; justify-content: space-between; font-size: 12.5px; color: var(--ink-2); background: var(--accent-soft); border: 1px solid rgba(30,136,255,.3); border-radius: 12px; padding: 7px 12px; margin: 0 auto 8px; max-width: 760px; line-height: 1.7; }
.train-note a { color: #8cc4ff; } .train-note button { flex: none; background: transparent; border: 1px solid var(--line-2); color: var(--ink); border-radius: 99px; padding: 3px 10px; cursor: pointer; font: inherit; font-size: 12px; }

/* ---------- v6 (2026-11-20): ChatGPT-style sidebar items, avatar menu, support form; no decorative effects ---------- */
.side-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border-radius: 10px; border: 0; background: transparent; color: var(--ink-2); cursor: pointer; font: inherit; font-size: 14.5px; white-space: nowrap; text-align: start; text-decoration: none !important; }
.side-item:hover { background: var(--panel); color: var(--ink); }
.side-item svg { flex: none; color: var(--muted); }
.side-item[aria-pressed=true] { background: var(--accent-soft); color: var(--ink); }
.side-item[aria-pressed=true] svg { color: var(--accent); }
.new-chat { border: 0; padding: 9px 12px; font-weight: 600; }
.new-chat + .side-item { margin-top: 2px; }
.side-head + .new-chat { margin-top: 0; }
.hist-search { margin-top: 6px; }
.side-foot { gap: 2px; }
.side-foot .link-btn.danger { align-self: flex-start; margin: 2px 6px; }
.top-signin { margin-inline-start: 4px; }
.acct { position: relative; margin-inline-start: 4px; }
.av-btn { position: relative; width: 38px; height: 38px; border-radius: 50%; border: 0; padding: 3px; background: transparent; cursor: pointer; display: grid; place-items: center; }
.av-btn:hover, .av-btn[aria-expanded=true] { background: var(--panel); }
.av-btn .av { width: 32px; height: 32px; border-radius: 50%; background: var(--panel-2); color: var(--accent); display: grid; place-items: center; overflow: hidden; font-weight: 700; font-size: 15px; }
.av-btn .av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.av-btn .dot { position: absolute; top: 3px; inset-inline-end: 3px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); border: 2px solid var(--bg); }
.menu { position: absolute; top: calc(100% + 6px); inset-inline-end: 0; z-index: 70; min-width: 230px; max-width: min(300px, 92vw); background: var(--panel); border: 1px solid var(--line-2); border-radius: 16px; padding: 6px; box-shadow: 0 16px 40px -12px rgba(0,0,0,.6); }
.menu-head { padding: 8px 10px 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; line-height: 1.4; }
.menu-head b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-head small { color: var(--muted); font-size: 12px; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 10px; background: transparent; color: var(--ink-2); font: inherit; font-size: 14.5px; cursor: pointer; text-align: start; text-decoration: none !important; }
.menu-item:hover { background: var(--panel-2); color: var(--ink); }
.menu-item svg { flex: none; color: var(--muted); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.menu hr:last-child, .menu hr:has(+ [hidden]:last-child) { display: none; }
.sup-dlg { width: min(520px, 94vw); max-height: 88dvh; overflow-y: auto; }
.sup-dlg .muted { color: var(--muted); font-size: 14px; margin: 0 0 12px; }
.sup-form { display: flex; flex-direction: column; gap: 10px; }
.sup-form input, .sup-form textarea { width: 100%; box-sizing: border-box; background: var(--bg); color: var(--ink); border: 1px solid var(--line-2); border-radius: 12px; padding: 10px 12px; font: inherit; font-size: 15px; }
.sup-form input:focus, .sup-form textarea:focus { outline: 0; border-color: var(--accent); }
.sup-form textarea { resize: vertical; min-height: 96px; line-height: 1.7; }
.sup-row { display: flex; align-items: center; gap: 10px; }
.sup-msg { flex: 1; font-size: 13.5px; color: var(--muted); }
.sup-msg.ok { color: #6fd39a; } .sup-msg.err { color: #ff97a6; }
.sup-guest p { margin: 0 0 12px; color: var(--ink-2); }
.sup-hist h3 { font-size: 15px; margin: 18px 0 8px; }
.sup-item { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; }
.sup-item p { margin: 2px 0 8px; white-space: pre-wrap; word-wrap: break-word; }
.sup-reply { background: var(--accent-soft); border-radius: 10px; padding: 8px 10px; font-size: 14.5px; white-space: pre-wrap; }
.sup-reply b { display: block; font-size: 12.5px; color: var(--accent); margin-bottom: 2px; }
.sup-reply.wait { background: transparent; color: var(--muted); font-size: 13px; padding: 0; }
@media (max-width: 860px) {
  .topbar { padding: 6px 8px; }
  .top-signin { padding: 6px 14px; }
}

/* v7: active poll / question box (admin agent) */
.poll-bar { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 10px 44px 10px 16px; background: rgba(30,136,255,.09); border-bottom: 1px solid rgba(30,136,255,.28); color: var(--ink); font-size: 14.5px; }
[dir=rtl] .poll-bar { padding: 10px 16px 10px 44px; }
.poll-bar .poll-q { font-weight: 600; }
.poll-bar .ann-x { position: absolute; top: 6px; inset-inline-end: 8px; }
.poll-bar .poll-body { display: flex; flex-wrap: wrap; gap: 8px; }
.poll-bar .poll-opt { position: relative; overflow: hidden; display: inline-flex; align-items: center; gap: 10px; padding: 6px 14px; border-radius: 999px; border: 1px solid rgba(30,136,255,.45); background: transparent; color: inherit; font: inherit; cursor: pointer; }
.poll-bar .poll-opt::before { content: ""; position: absolute; inset: 0; width: var(--pc, 0%); background: rgba(30,136,255,.22); pointer-events: none; }
[dir=rtl] .poll-bar .poll-opt::before { inset-inline-start: 0; }
.poll-bar .poll-opt > * { position: relative; }
.poll-bar .poll-opt.on { border-color: rgb(30,136,255); font-weight: 600; }
.poll-bar .poll-opt em { font-style: normal; opacity: .75; font-size: 13px; }
.poll-bar .poll-opt:disabled { opacity: .6; cursor: default; }
.poll-bar .poll-form { display: flex; gap: 8px; flex: 1; min-width: 0; }
.poll-bar .poll-form input { flex: 1; min-width: 0; padding: 7px 12px; border-radius: 10px; border: 1px solid rgba(127,140,170,.35); background: rgba(0,0,0,.15); color: inherit; font: inherit; }
.poll-bar .poll-status { opacity: .75; }
.poll-bar .poll-status:empty { display: none; }

/* v8: image generation and video are "coming soon" */
.side-item.soon { opacity: .7; }
.soon-badge { font-style: normal; font-size: 10.5px; color: #8cc4ff; background: var(--accent-soft); border-radius: 99px; padding: 0 6px; margin-inline-start: 6px; }
