/* Three-A experience: meaningful pictures, quiet conversations, reversible presets. */
.demo-strip { display:none; }
.page-telegram.main { height:calc(100dvh - 66px); }
#workspace-background img { opacity:.12; }
:root[data-background-strength=clear] #workspace-background img { opacity:.18; }
:root[data-theme=dark] #workspace-background img { opacity:.08; }
:root[data-theme=dark][data-background-strength=clear] #workspace-background img { opacity:.12; }
[data-scene-image] > img { width:100%; height:100%; object-fit:cover; object-position:50% 50%; }
:root[data-desktop-fit=contain] [data-scene-image]:not([data-scene-image=ambient]) > img { object-fit:contain; }
:root[data-desktop-fit=subject] [data-scene-image]:not([data-scene-image=ambient]) > img { object-position:var(--image-desktop-position); }
.home-cover { position:relative; min-height:310px; border-radius:calc(var(--radius) + 6px); overflow:hidden; background:var(--subtle); border:1px solid var(--line); isolation:isolate; }
.home-cover-image { position:absolute; inset:0; z-index:-2; }
.home-cover::after { content:''; position:absolute; inset:0; background:linear-gradient(90deg,rgba(9,24,36,.8) 0%,rgba(9,24,36,.42) 48%,rgba(9,24,36,.04) 100%); z-index:-1; }
.home-cover-copy { color:#fff; padding:34px; max-width:650px; }
.home-cover-copy .eyebrow { color:#fff; font-size:10px; margin-bottom:18px; }
.home-cover h1 { color:#fff; font-size:38px; line-height:1.45; white-space:pre-line; font-weight:550; letter-spacing:-.03em; margin-bottom:26px; }
.home-cover .button { min-height:44px; }
.home-cover .button:not(.primary) { color:var(--text); background:var(--surface); }
:root[data-wallpaper=none] .home-cover { background:var(--surface); }
:root[data-wallpaper=none] .home-cover::after { background:none; }
:root[data-wallpaper=none] .home-cover-copy,:root[data-wallpaper=none] .home-cover h1 { color:var(--text); }
:root[data-wallpaper=none] .home-cover-copy .eyebrow { color:var(--muted); }
.home-resume,.home-chats { background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); padding:22px; }
.resume-grid { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.resume-card { display:flex; align-items:center; gap:14px; min-width:0; padding:18px; border:1px solid var(--line); border-radius:var(--radius); background:var(--canvas); }
.resume-card > span { flex:1; min-width:0; }
.resume-card strong { display:block; font-size:15px; overflow-wrap:anywhere; }
.resume-card small { display:block; color:var(--muted); font-size:11px; margin-top:6px; }
.resume-card > svg:first-child { color:var(--accent); }
.home-chat-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
.home-chat { display:flex; align-items:center; gap:10px; min-width:0; padding:14px 0; }
.home-chat > span:nth-child(2) { min-width:0; flex:1; }
.home-chat strong { display:block; font-size:13px; }
.home-chat small { display:block; font-size:11px; color:var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; margin-top:5px; }
.home-chat-avatar { display:grid; place-items:center; width:40px; height:40px; flex-shrink:0; border-radius:50%; background:var(--accent-soft); color:var(--accent); font-size:12px; }
.home-layout .overview-tiles { padding:12px 0; }
.tg-timeline-stage { flex:1; min-height:0; position:relative; overflow:hidden; isolation:isolate; }
.tg-timeline-stage .tg-timeline { position:relative; height:100%; z-index:1; }
.tg-scene-image { position:absolute; inset:0; z-index:0; background:var(--canvas); }
.tg-scene-image > img { opacity:.86; }
:root[data-background-strength=clear] .tg-scene-image > img { opacity:1; }
.tg-scene-image::after { content:''; position:absolute; inset:0; background:rgba(245,248,250,.12); pointer-events:none; }
:root[data-theme=dark] .tg-scene-image::after { background:rgba(8,16,25,.3); }
.tg-workspace[data-layout=flat] .tg-bubble { background:var(--surface); padding:14px; border:1px solid var(--line); border-radius:var(--radius); }
.tg-bubble { position:relative; }
.tg-message { margin-bottom:14px; }
.tg-message.joined { margin-top:-8px; }
.tg-message.joined .tg-bubble { border-top-left-radius:5px; }
.tg-message.outgoing.joined .tg-bubble { border-top-right-radius:5px; }
.tg-message-text { padding-right:23px; }
.tg-message-menu { position:absolute; right:1px; top:0; width:36px; height:36px; min-height:36px; padding:7px; opacity:0; color:var(--muted); z-index:2; }
.tg-message:hover .tg-message-menu,.tg-message:focus-within .tg-message-menu { opacity:1; }
.tg-message-meta { padding-right:3px; }
.tg-thread-header .icon-button { min-width:40px; }
.tg-thread-tools[hidden] { display:none; }
.tg-thread-tools { padding-top:4px; padding-bottom:4px; }
.tg-thread-tools > select { margin-left:auto; }
.tg-reading-status { min-height:32px; font-size:10px; }
.tg-reading-status .button { min-height:32px; }
.tg-composer-hint { display:none; }
.tg-composer { padding-bottom:12px; }
.reader-details { margin-top:32px; border-top:1px solid var(--line); color:var(--text); }
.reader-details > summary { cursor:pointer; min-height:48px; padding:14px 0; font-size:13px; color:var(--muted); }
.reader-focus .detail-actions { display:none; }
.reader-focus .detail-toolbar { box-shadow:none; }
#reader-tools-toggle { margin-left:auto; font-size:12px; }
.appearance-presets { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }
.preset-card { display:flex; flex-direction:column; align-items:stretch; gap:8px; text-align:left; border:1px solid var(--line); border-radius:12px; background:var(--surface); padding:10px; min-width:0; }
.preset-card[aria-pressed=true] { outline:2px solid var(--accent); outline-offset:1px; background:var(--accent-soft); }
.preset-card strong { font-size:13px; }
.preset-card small { color:var(--muted); font-size:10px; line-height:1.6; }
.preset-art { height:58px; display:flex; flex-direction:column; gap:4px; padding:9px; border-radius:7px; overflow:hidden; }
.preset-art i { display:block; width:65%; height:6px; background:#fff; border-radius:3px; }
.preset-art i:nth-child(2) { width:90%; }
.preset-art i:nth-child(3) { width:45%; }
.art-clean { background:#d9e6ef; }
.art-picture { background:linear-gradient(150deg,#acc9e0 20%,#c1d4c7 55%,#6b8c99 55%); }
.art-study { background:#e8dfca; }
.art-study i { background:#c0b59f; }
.appearance-preview-toolbar { display:flex; justify-content:space-between; gap:8px; margin:16px 0 10px; flex-wrap:wrap; }
.appearance-preview-toolbar > div { display:flex; gap:3px; }
.appearance-preview-toolbar .button { font-size:11px; padding:8px 10px; min-height:40px; }
.appearance-preview-toolbar .button[aria-pressed=true] { background:var(--accent-soft); color:var(--accent); }
.appearance-scene { height:200px; position:relative; border:1px solid var(--line); overflow:hidden; border-radius:12px; background:var(--canvas); isolation:isolate; }
.appearance-scene[data-device=mobile] { width:190px; height:235px; margin:0 auto; }
.preview-scene-image { position:absolute; inset:0; z-index:-1; }
.preview-cover-title { position:absolute; inset:auto 0 0; padding:44px 16px 18px; color:#fff; background:linear-gradient(transparent,rgba(9,24,36,.88)); }
.preview-cover-title small { display:block; font-size:8px; margin-bottom:10px; }
.preview-cover-title strong { font-size:21px; line-height:1.6; font-weight:550; }
.preview-chat { display:flex; flex-direction:column; gap:18px; padding:24px 14px; }
.preview-chat span { background:var(--surface); color:var(--text); font-size:12px; border:1px solid var(--line); border-radius:var(--radius); padding:12px; width:88%; }
.preview-chat span + span { margin-left:auto; background:var(--accent-soft); }
.preview-paper { margin:14px; padding:20px; min-height:180px; background:var(--paper-surface); color:var(--paper-text); font-family:var(--font-reader); font-size:12px; line-height:2; }
.preview-paper strong { font-size:17px; }
.preview-paper p { margin-top:14px; }
.appearance-status { min-height:42px; margin:12px 0; }
dialog:has(.appearance-presets) { display:flex; flex-direction:column; }
dialog:has(.appearance-presets):not([open]) { display:none; }
dialog:has(.appearance-presets) > .dialog-head { flex-shrink:0; }
dialog:has(.appearance-presets) > .dialog-form { min-height:0; overflow:auto; overscroll-behavior:contain; padding:3px; }
dialog:has(.appearance-presets) > .dialog-actions { position:static; flex-shrink:0; margin:12px 0 0; padding:12px 0 0; border-top:1px solid var(--line); background:var(--surface); }
.appearance-advanced,.appearance-focus { border-top:1px solid var(--line); padding-top:6px; margin-top:16px; }
.appearance-advanced > summary,.appearance-focus > summary { min-height:44px; padding:10px 0; cursor:pointer; font-size:13px; }
.focus-picker { height:180px; position:relative; overflow:hidden; background:var(--subtle); border:1px solid var(--line); border-radius:10px; cursor:crosshair; }
.focus-picker img { display:block; width:100%; height:100%; object-fit:contain; }
.focus-picker > .help { display:block; padding:48px 20px; text-align:center; }
.focus-marker { position:absolute; width:22px; height:22px; border:2px solid #fff; outline:2px solid #15517f; border-radius:50%; transform:translate(-50%,-50%); pointer-events:none; }
:root[data-mobile-fit=contain] .appearance-scene[data-device=mobile] [data-scene-image] > img { object-fit:contain; object-position:50% 50%; }
:root[data-mobile-fit=subject] .appearance-scene[data-device=mobile] [data-scene-image] > img { object-fit:cover; object-position:var(--image-mobile-position); }
:root[data-mobile-fit=cover] .appearance-scene[data-device=mobile] [data-scene-image] > img { object-fit:cover; object-position:50% 50%; }
@media (max-width:760px) {
  .page-telegram.main { height:calc(100dvh - 127px - env(safe-area-inset-bottom,0px)); }
  .is-chatting .shell > .topbar { display:none; }
  .is-chatting .page-telegram.main { height:calc(100dvh - 67px - env(safe-area-inset-bottom,0px)); }
  .home-layout { gap:20px; }
  .home-cover { min-height:280px; }
  .home-cover::after { background:linear-gradient(0deg,rgba(9,24,36,.86),rgba(9,24,36,.1)); }
  .home-cover-copy { padding:30px 20px 20px; }
  .home-cover h1 { font-size:31px; margin-bottom:22px; }
  .home-cover-copy .eyebrow { margin-bottom:12px; }
  .home-cover .welcome-actions { gap:7px; }
  .home-cover .button { font-size:11px; padding:10px; }
  .home-resume,.home-chats { padding:18px; }
  .resume-grid,.home-chat-grid { grid-template-columns:1fr; }
  .resume-card { padding:14px; }
  .home-chat { border-bottom:1px solid var(--line); }
  .home-chat:last-child { border-bottom:0; }
  :root[data-mobile-fit=contain] [data-scene-image]:not([data-scene-image=ambient]) > img { object-fit:contain; object-position:50% 50%; }
  :root[data-mobile-fit=subject] [data-scene-image]:not([data-scene-image=ambient]) > img { object-fit:cover; object-position:var(--image-mobile-position); }
  :root[data-mobile-fit=cover] [data-scene-image]:not([data-scene-image=ambient]) > img { object-fit:cover; object-position:50% 50%; }
  .tg-message-menu { opacity:1; min-height:44px; height:44px; width:38px; right:0; }
  .tg-message-text { padding-right:24px; }
  .tg-thread-header { min-height:64px; }
  .tg-thread-header .icon-button { width:38px; min-width:38px; }
  .tg-thread-title { min-width:0; }
  .tg-composer { padding-bottom:10px; }
  .tg-compose-line textarea { min-height:48px; }
  .is-reading .detail-panel { padding-bottom:110px; overflow:visible; }
  .reader-focus .detail-panel { padding-bottom:32px; }
  .preset-card { padding:8px; }
  .preset-card strong { font-size:12px; }
  .preset-card small { font-size:10px; }
  .appearance-scene[data-device=mobile] { height:220px; width:180px; }
  .dialog-head .eyebrow { display:none; }
  .dialog-head { margin-bottom:12px; }
}
:root[data-desktop-fit=contain] .appearance-scene[data-device=desktop] [data-scene-image] > img { object-fit:contain; object-position:50% 50%; }
:root[data-desktop-fit=subject] .appearance-scene[data-device=desktop] [data-scene-image] > img { object-fit:cover; object-position:var(--image-desktop-position); }
:root[data-desktop-fit=cover] .appearance-scene[data-device=desktop] [data-scene-image] > img { object-fit:cover; object-position:50% 50%; }
@media (max-height:600px) and (max-width:999px) {
  .tg-thread-tools:not([hidden]) { display:flex; }
  .tg-reading-status { min-height:32px; }
}
