/* iPhone-inspired archive presentation. Pattern credited in THIRD_PARTY.md. */
:root{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;--blue:#007aff;--muted:#8e8e93;--ink:#000;--line:#d9d9de;--hover:#f2f2f7;--outgoing:#e1ffc7;--incoming:#fff;--wall:#d6e2e6;--message-size:16px;--bubble-radius:17px}
body{color:var(--ink);-webkit-font-smoothing:antialiased}.sidebar{width:340px;border-right:1px solid #00000016;background:var(--surface)}.ios-navigation{height:49px;display:flex;justify-content:space-between;align-items:center;padding:0 20px;color:var(--blue);flex-shrink:0}.ios-navigation strong{color:var(--ink);font-size:17px;visibility:hidden}.ios-navigation>button{font-size:16px;padding:0}.large-title{font-size:34px;letter-spacing:-1.1px;line-height:1.15;margin:5px 20px 16px;font-weight:750}.side-top{height:auto;padding:0 16px 14px;gap:0}.side-top>#menu{display:none}.searchbox{border-radius:11px;height:36px;background:#7676801f;padding:0 9px}.searchbox input{font-size:16px}.tabs{height:39px;padding:0 17px;gap:12px;border-bottom:.5px solid var(--line)}.tabs button{font-size:14px;border-width:2px}.tabs button span{display:none}.archive-label{font-size:11px;letter-spacing:.2px}.chat-row{border-radius:0;padding:13px 16px;gap:12px;position:relative}.chat-row:after{content:'';position:absolute;bottom:0;left:88px;right:0;height:.5px;background:var(--line)}.chat-row.active{background:#007aff0d;color:var(--ink)}.chat-row .avatar{width:60px;height:60px;font-size:26px;background:linear-gradient(150deg,#a99be2,#7970ce)}.chat-summary strong{font-size:17px}.chat-summary p{color:var(--muted);font-size:15px;margin-top:5px}.chat-row time{color:var(--muted);font-size:12px;opacity:1}#chat-list{padding:0;flex:none}.avatar{background:linear-gradient(150deg,#a99be2,#7970ce)}#sidebar-shortcuts{padding:25px 16px;flex:1;overflow:auto}.shortcut-label{font-size:12px;color:var(--muted);padding:0 8px 8px;text-transform:uppercase;letter-spacing:.6px}.shortcut-row{display:flex;align-items:center;width:100%;text-align:left;gap:12px;padding:11px 8px;font-size:15px;border-radius:10px}.shortcut-row:hover{background:var(--hover)}.shortcut-row>span:first-child{width:29px;height:29px;display:grid;place-items:center;background:#007aff;color:white;border-radius:7px}.shortcut-row em{margin-left:auto;color:var(--muted);font-size:13px;font-style:normal}.shortcut-row svg{width:19px;height:19px;stroke:currentColor;fill:none;stroke-width:1.7}.shortcut-hint{font-size:12px;line-height:1.5;color:var(--muted);padding:16px 8px}.side-bottom{border:0;padding:9px 16px;font-size:11px;order:9}#ios-tabs{display:flex;border-top:.5px solid var(--line);height:66px;padding:8px 4px;background:var(--surface);flex-shrink:0;order:10}#ios-tabs button{flex:1;font-size:10px;color:var(--muted);display:flex;flex-direction:column;align-items:center;gap:4px}#ios-tabs button.active{color:var(--blue)}#ios-tabs svg{width:24px;height:24px;stroke:currentColor;fill:none;stroke-width:1.7}
.conversation{background-image:none;background:linear-gradient(135deg,#c5dce3 0%,#dce5d7 48%,#d4e2e4 100%);isolation:isolate}.conversation:before{content:'';position:absolute;inset:0;background:url('/static/telegram-pattern.svg') center/450px;opacity:.075;z-index:-1;pointer-events:none}.chat-header{height:62px;min-height:62px;padding:0 18px;background:#ffffffec;backdrop-filter:blur(22px);box-shadow:0 .5px 0 #0002}.chat-person{position:absolute;left:50%;transform:translateX(-50%);display:flex;flex-direction:column;gap:0;max-width:50%;align-items:center;text-align:center}.chat-person>span:last-child{min-width:0;max-width:100%}.chat-person strong{font-size:17px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.chat-person small{font-size:12px;margin-top:3px}.chat-person .avatar{display:none}.header-actions{margin-left:auto;gap:4px}.header-actions .icon{color:var(--blue)}#info{display:none}.mobile-back{display:flex;color:var(--blue);font-size:32px;margin:0;width:32px}#demo-banner{position:absolute;top:70px;right:13px;z-index:2;padding:4px 9px;border-radius:10px;background:#ffffffb5;border:0;font-size:10px;color:#70858b;font-weight:400;pointer-events:none}#demo-banner span{display:none}.filterbar{display:none}#messages{padding:24px max(22px,calc((100% - 720px)/2)) 25px}.day{background:#879d9f8f;font-size:12px;padding:4px 10px;margin:12px auto 17px;backdrop-filter:blur(8px)}.message-row{margin:3px 0;gap:4px}.bubble{max-width:min(460px,84%);border-radius:var(--bubble-radius) var(--bubble-radius) var(--bubble-radius) 5px;padding:7px 11px 5px;box-shadow:0 .5px 1px #00000018}.out .bubble{border-radius:var(--bubble-radius) var(--bubble-radius) 5px var(--bubble-radius)}.bubble p{font-size:var(--message-size);line-height:1.3;margin:1px 0 2px;letter-spacing:-.15px}.meta{font-size:10px;margin-left:10px;gap:4px;color:#899a8a;min-height:14px}.meta>button:last-child{display:none}.checks{font-size:12px}.message-tools{opacity:0}.message-row:hover .message-tools{opacity:1}.message-tools button{color:#6d8185;font-size:20px}.bubble.has-photo{max-width:330px;border-radius:16px;padding:2px}.bubble .media-image{border-radius:14px;max-height:300px}.album-bubble{max-width:380px!important}.reply{font-size:13px;border-left-width:2px;border-radius:4px;background:#007aff0c}.reply strong{font-size:13px;color:#007aff}.reactions{margin-top:4px}.reaction{font-size:13px;padding:3px 7px}.deleted-label{font-size:10px;color:#9a7864}.voice-player{min-width:250px;padding:3px 0;gap:9px}.play-button{background:#007aff;width:40px;height:40px}.waveform i{background:#007aff55}.waveform i.played{background:#007aff}.speed,.voice-time{color:#698e9a}.round-player{width:225px;height:225px}.round-bubble{max-width:260px!important}.round-bubble>p{font-size:12px}.service span{background:#879d9f8f;padding:5px 11px}.archive-footer{width:100%;margin:0;border-radius:0;min-height:60px;background:#f6f7f9f0;border-top:.5px solid #0002;box-shadow:none;padding:10px max(18px,calc((100% - 720px)/2));gap:9px;color:var(--muted);backdrop-filter:blur(20px)}.archive-footer>span:nth-child(2){flex:1;border-radius:18px;background:var(--surface);border:1px solid var(--line);height:35px;display:flex;align-items:center;padding:0 13px;font-size:14px}.archive-footer small{display:none}.archive-footer #export{font-size:0;margin:0;width:34px;padding:0}.archive-footer #export svg{stroke:var(--blue);width:25px;height:25px}.archive-footer #lock-icon svg{stroke:var(--blue)}.to-bottom{bottom:76px;width:36px;height:36px;font-size:22px;right:20px}.empty{background:#ffffffbd;border-radius:20px;color:#75868b}.empty h2{font-size:22px;color:var(--ink)}
#workspace-panel{width:370px;flex-shrink:0;background:var(--surface);border-left:.5px solid var(--line);display:flex;flex-direction:column;z-index:5;overflow:hidden}.workspace-header{height:62px;min-height:62px;display:flex;align-items:center;justify-content:space-between;padding:0 16px;border-bottom:.5px solid var(--line)}.workspace-header h2{font-size:17px;margin:0}.workspace-header button{color:var(--blue);font-size:16px}.workspace-body{padding:15px;overflow:auto;flex:1}.workspace-body input,.workspace-body select,.workspace-body textarea,.note-editor textarea,.note-editor input{font:inherit;background:var(--hover);color:var(--ink);border:0;border-radius:10px;padding:10px;width:100%;min-width:0}.workspace-body input[type=search]{font-size:16px}.field-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:12px 0}.field-grid label{font-size:11px;color:var(--muted);display:block}.field-grid label input,.field-grid select{margin-top:5px;font-size:13px}.search-count{font-size:12px;color:var(--muted);margin:17px 2px 10px}.result-row{width:100%;padding:13px 1px;display:block;border-bottom:.5px solid var(--line);text-align:left}.result-row>span{display:flex;justify-content:space-between;color:var(--blue);font-size:12px;gap:8px}.result-row time{color:var(--muted);font-size:11px}.result-row p{font-size:14px;line-height:1.4;margin:5px 0;white-space:pre-wrap;overflow-wrap:anywhere}.result-row small{font-size:11px;color:var(--muted)}.result-row mark{background:#ffdf73;color:#000;border-radius:2px}.workspace-segments{display:flex;gap:2px;background:var(--hover);border-radius:9px;padding:3px;margin-bottom:15px}.workspace-segments button{flex:1;padding:7px 2px;font-size:12px;border-radius:7px}.workspace-segments button.active{background:var(--surface);box-shadow:0 1px 4px #0002}.media-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:3px}.media-tile{aspect-ratio:1;position:relative;padding:0;overflow:hidden;background:var(--hover)}.media-tile img,.media-tile video{width:100%;height:100%;object-fit:cover}.media-tile span{position:absolute;bottom:5px;right:5px;background:#0006;color:white;border-radius:4px;font-size:10px;padding:2px 4px}.panel-empty{text-align:center;padding:45px 15px;color:var(--muted);font-size:14px;line-height:1.5}.panel-empty b{display:block;color:var(--ink);font-size:18px;margin-bottom:8px}.panel-more{display:block;color:var(--blue);width:100%;padding:16px}.settings-group{background:var(--hover);border-radius:11px;overflow:hidden;margin:10px 0 25px}.settings-row{padding:14px;display:flex;width:100%;align-items:center;justify-content:space-between;text-align:left;font-size:15px;border-bottom:.5px solid var(--line);gap:10px}.settings-row:last-child{border:0}.settings-row span{color:var(--muted);font-size:13px}.settings-row select{width:auto;padding:4px;background:none}.settings-label{font-size:12px;text-transform:uppercase;color:var(--muted);letter-spacing:.5px;margin:10px 14px}.settings-note{font-size:12px;color:var(--muted);line-height:1.6;padding:0 14px}.archive-profile{text-align:center;padding:15px 0 25px}.archive-profile .avatar{width:86px;height:86px;font-size:36px}.archive-profile h2{margin:12px 0 5px;font-size:23px}.archive-profile p{font-size:13px;color:var(--muted);margin:0}.message-row.annotated .bubble:before{content:'★';font-size:10px;color:var(--blue);position:absolute;left:-15px;top:8px}.message-note{font-size:10px;color:var(--blue);padding-top:4px;clear:both}.selected-message .bubble{outline:2px solid var(--blue)}.selecting .message-row{cursor:pointer}.selecting .message-row:before{content:'';width:20px;height:20px;border:1.5px solid #8fa3aa;border-radius:50%;flex-shrink:0}.selecting .selected-message:before{content:'✓';background:var(--blue);border-color:var(--blue);color:white;text-align:center;line-height:18px;font-size:13px}#selection-bar{min-height:54px;background:var(--surface);display:flex;align-items:center;gap:12px;padding:10px 18px;border-top:.5px solid var(--line)}#selection-bar button{color:var(--blue);font-size:14px}#selection-bar strong{flex:1;text-align:center;font-size:13px}#action-menu{position:fixed;z-index:30;width:245px;background:#fffffff5;backdrop-filter:blur(30px);border-radius:14px;box-shadow:0 8px 50px #0003;overflow:hidden;border:.5px solid #0001}#action-menu button{display:flex;align-items:center;justify-content:space-between;width:100%;text-align:left;padding:13px 16px;border-bottom:.5px solid #0001;font-size:15px}#action-menu button:hover{background:#00000007}#action-menu svg{width:19px;height:19px;stroke:currentColor;stroke-width:1.7;fill:none}.note-editor textarea{min-height:140px;resize:vertical}.note-editor label{display:block;font-size:13px;color:var(--muted);margin-bottom:15px}.note-editor input,.note-editor textarea{display:block;margin-top:8px}.note-editor .primary{width:100%;border-radius:12px}.note-preview{border-left:3px solid var(--blue);padding:6px 12px;color:var(--muted);font-size:13px;max-height:100px;overflow:auto;margin-bottom:20px}#lightbox{inset:0;max-width:none;max-height:none;width:100vw;height:100dvh;background:#07090deb;color:white;border-radius:0;padding:0}#lightbox::backdrop{background:#000}#lightbox header{height:65px;padding:12px 22px;margin:0;font-size:15px}#lightbox header button,#lightbox a{color:#fff;text-decoration:none}#lightbox-content{height:calc(100% - 155px);display:flex;align-items:center;justify-content:center;overflow:hidden}#lightbox-content img,#lightbox-content video{max-height:100%;max-width:100%;object-fit:contain;border-radius:0}#lightbox footer{height:90px;display:flex;align-items:center;justify-content:space-between;gap:15px;padding:12px 22px}#lightbox footer button{font-size:38px;padding:0 12px}#lightbox-caption{font-size:14px;text-align:center;max-height:65px;overflow:auto}dialog{border-radius:16px}dialog h2{font-size:18px}.details-panel{display:none!important}.compact .message-row{margin:1px 0}.compact .bubble{padding-top:4px;padding-bottom:3px}.no-pattern .conversation:before{display:none}
body.dark{--surface:#1c1c1e;--ink:#fff;--line:#38383a;--hover:#2c2c2e;--blue:#0a84ff;--muted:#98989f;--incoming:#252527;--outgoing:#244e37;color:var(--ink)}body.dark .conversation{background:linear-gradient(140deg,#17232a,#1c2d27)}body.dark .conversation:before{filter:invert(1);opacity:.05}body.dark .chat-header,body.dark .archive-footer{background:#1c1c1ef2}body.dark #action-menu{background:#252527f5}body.dark .chat-row.active{background:#007aff1c}body.dark #demo-banner{background:#1c1c1ea8}body.dark .reaction{color:#b8ddab}body.dark .settings-group{background:#2c2c2e}body.dark .checks{color:#80bd78}
@media(max-width:1150px){#workspace-panel{position:absolute;right:0;top:0;bottom:0;box-shadow:-10px 0 40px #0002}.sidebar{width:300px}}
@media(max-width:700px){.sidebar{width:100%}.ios-navigation strong{visibility:hidden}.ios-navigation{height:45px}.large-title{margin-top:4px;margin-bottom:17px;font-size:35px}.side-top{padding-bottom:12px}.chat-header{height:58px;min-height:58px;padding:0 8px}.chat-person{max-width:55%}.chat-person strong{font-size:17px}.chat-person small{font-size:11px}.header-actions #chat-search{display:none}.header-actions #more{width:40px;height:40px}.chat-header .mobile-back{width:60px;justify-content:flex-start;gap:1px;font-size:34px}.mobile-back:after{content:'Чаты';font-size:16px}.header-actions svg{width:22px}#messages{padding:21px 10px 16px}.bubble{max-width:86%;padding:6px 10px 4px}.bubble p{font-size:var(--message-size);line-height:1.3}.has-photo{max-width:280px!important}.album-bubble{max-width:310px!important}.voice-player{min-width:225px}.archive-footer{width:100%;margin:0;padding:9px 12px calc(9px + env(safe-area-inset-bottom));min-height:57px;border-radius:0}.archive-footer>span:nth-child(2){font-size:13px}.to-bottom{bottom:72px;right:12px}#demo-banner{top:65px;right:8px;font-size:9px;padding:3px 7px}#workspace-panel{width:100%;box-shadow:none}.workspace-header{height:56px;min-height:56px}.workspace-body{padding:16px}.round-player{width:210px;height:210px}.message-tools{display:none}.day{margin-top:10px;font-size:11px}.media-grid{gap:3px}#selection-bar{padding:10px;gap:5px}#selection-bar button{font-size:12px}.message-row.annotated .bubble:before{left:auto;right:3px;top:-6px}#ios-tabs{height:calc(64px + env(safe-area-inset-bottom));padding-bottom:env(safe-area-inset-bottom)}#lightbox header{padding:10px 15px}#lightbox footer{padding:10px}.file-card{min-width:190px}.file-card strong{max-width:200px}.sidebar .side-bottom{display:none}}
.archive-profile .avatar svg{width:38px;height:38px;stroke:currentColor;stroke-width:1.4;fill:none}.note-card{background:var(--hover);border-radius:12px;padding:5px 13px;margin-bottom:12px}.note-card>p{font-size:14px;line-height:1.5;white-space:pre-wrap;overflow-wrap:anywhere}.note-card>small{color:var(--blue);font-size:12px}.service.selected-message span{outline:2px solid var(--blue)}.archive-footer>span{cursor:pointer}
.header-actions #more .avatar{width:36px;height:36px;font-size:16px}.header-actions #more{width:40px;height:40px}.header-actions #more:hover{background:none}

/* Media spoilers remain opt-in while the saved file stays available. */
.media-spoiler{position:relative;overflow:hidden;border-radius:14px;cursor:pointer}
.media-spoiler:not(.revealed)>:not(.media-spoiler-cover){filter:blur(22px);pointer-events:none}
.media-spoiler-cover{position:absolute;inset:0;display:grid;place-items:center;background:#61758b99;color:white;font-weight:600;backdrop-filter:blur(10px)}
.media-spoiler.revealed>.media-spoiler-cover{display:none}
.archive-timer{font-size:12px;line-height:1.4;padding:6px 8px;color:var(--muted,#667788);max-width:280px}
.profile-switcher{display:flex;align-items:center;gap:10px;width:calc(100% - 24px);margin:0 12px 12px;padding:10px;border:0;border-radius:12px;background:var(--panel,#f0f2f5);text-align:left;color:inherit}
.profile-switcher>span:nth-child(2){flex:1;min-width:0}.profile-switcher strong,.profile-switcher small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.profile-switcher small{font-size:11px;color:#77818d;margin-top:3px}
.profile-avatar{display:inline-flex;width:38px;height:38px;flex:0 0 38px;align-items:center;justify-content:center;border-radius:50%;background:#668fdb;color:white;font-size:18px}
.identity-card{display:flex;align-items:center;gap:12px;padding:16px 0}.identity-card>div{flex:1;min-width:0}.identity-card h2{font-size:21px;margin:4px 0;overflow-wrap:anywhere}.identity-card small{font-size:10px;color:#77818d;letter-spacing:.06em}.identity-card p{font-size:12px;margin:0;color:#77818d}.identity-card button{background:none;border:0;color:#1684ef;padding:8px}
.identity-explainer{font-size:13px;line-height:1.55;color:#77818d;margin:0 0 20px}.connection-card{border:1px solid #8899aa30;border-radius:16px;padding:16px;margin:14px 0;background:var(--panel-bg,transparent)}.connection-card header{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}.connection-card h3{font-size:16px;margin:0}.connection-card p{font-size:13px;line-height:1.5;color:#77818d}.connection-status{font-size:11px;background:#8b95a51c;color:#77818d;border-radius:8px;padding:5px 8px}.connection-status.online{color:#188858;background:#21ad7017}.connection-error{color:#c34b42!important}.wide{width:100%;margin:8px 0}.account-qr{display:block;margin:14px auto;background:white;max-width:100%}
.tracked-chat{display:flex;gap:8px;align-items:center;justify-content:space-between;border-bottom:1px solid #8899aa20;padding:14px 0}.tracked-chat strong{font-size:14px}.tracked-chat small{display:block;font-size:11px;color:#77818d;margin-top:4px}.source-badges{display:flex;gap:4px;flex-wrap:wrap}.source-badges b,.source-badges i{font-size:10px;font-style:normal;font-weight:500;border-radius:6px;padding:4px 6px;background:#1684ef12;color:#1684ef}.source-badges i{color:#77818d;background:#77818d12}
.profile-choice{display:flex;align-items:center;gap:12px;background:transparent;color:inherit;border:1px solid #8899aa30;border-radius:14px;width:100%;padding:14px;margin:10px 0;text-align:left}.profile-choice>span:nth-child(2){flex:1}.profile-choice small{display:block;color:#77818d;font-size:11px;margin-top:5px}.profile-choice.current{border-color:#1684ef;background:#1684ef08}.profile-choice>span:last-child{font-size:11px;color:#1684ef}
.chat-choice{display:flex;align-items:center;gap:12px;padding:14px 4px;border-bottom:1px solid #8899aa25}.chat-choice[hidden]{display:none}.chat-choice input{width:20px;height:20px;accent-color:#1684ef}.chat-choice strong{font-size:14px}.chat-choice small{display:block;color:#77818d;margin-top:4px;font-size:12px}.chat-picker-search{box-sizing:border-box;width:100%;padding:12px;border-radius:10px;border:1px solid #8899aa40;background:transparent;color:inherit}.picker-footer{display:flex;align-items:center;justify-content:space-between;gap:10px;position:sticky;bottom:0;padding:14px 0;background:var(--panel-bg,#fff)}.picker-footer span{font-size:13px;color:#77818d}
.profile-switcher{background:var(--hover);color:var(--ink)}.picker-footer{background:var(--surface);border-top:1px solid var(--line)}
.profile-switcher small,.identity-card small,.identity-card p,.identity-explainer,.connection-card p,.tracked-chat small,.chat-choice small,.picker-footer span{color:var(--muted)}
.bot-discovery{padding:14px;border:1px solid var(--line);border-radius:14px;margin-bottom:18px;background:var(--hover)}.bot-discovery>strong{font-size:16px}.bot-discovery p,.bot-discovery li{font-size:13px;line-height:1.5}.bot-discovery p{color:var(--muted)}.bot-discovery summary{cursor:pointer;color:var(--blue);font-size:14px;padding:10px 0}.bot-discovery ol{padding-left:20px}.bot-discovery li{margin:10px 0}.bot-discovery .settings-row{padding:12px 0;color:var(--blue)}
.bot-check-result:not(:empty){padding:14px;border-radius:12px;background:var(--hover);margin:12px 0;font-size:14px;line-height:1.5}.bot-check-result p{margin:8px 0}.bot-check-result button{color:var(--blue)}button:disabled{opacity:.6;cursor:wait}
.history-job progress{width:100%;height:8px;accent-color:var(--blue)}.history-controls{display:flex;gap:12px;flex-wrap:wrap;margin:15px 0}.history-controls button{color:var(--blue);padding:7px 0}.history-job label{display:block;font-size:12px;margin-top:14px}.history-job input,.history-job select{margin-top:6px}#history-summary{font-size:13px;line-height:1.5;padding:12px;background:var(--hover);border-radius:12px}
/* Navigation stays reachable while only the conversation list scrolls. */
.sidebar{min-height:0}.sidebar>#chat-list{flex:1 1 auto;min-height:90px;overflow-y:auto}.sidebar>#sidebar-shortcuts{flex:0 0 auto;overflow:visible;padding:8px 10px;display:grid;grid-template-columns:1fr 1fr;gap:2px;border-top:1px solid var(--line)}
#sidebar-shortcuts .shortcut-label,#sidebar-shortcuts .shortcut-hint{display:none}#sidebar-shortcuts .shortcut-row{padding:7px 5px;font-size:12px;gap:6px}#sidebar-shortcuts .shortcut-row>span:first-child{width:23px;height:23px;flex-shrink:0}#sidebar-shortcuts .shortcut-row em{font-size:10px}
.sidebar>#account-connections,.sidebar>#history-progress,.sidebar>#deletion-inbox{flex-shrink:0;padding:10px 15px;font-size:13px}.sidebar>#deletion-inbox{display:none}.sidebar .large-title{font-size:28px;margin-bottom:10px}.sidebar .side-top{padding-bottom:8px}.sidebar .chat-row{padding:10px 12px}.sidebar .chat-row .avatar{width:46px;height:46px;font-size:21px}.sidebar .chat-summary strong{font-size:15px}.sidebar .chat-summary p{font-size:13px}
.chat-source-strip{flex-shrink:0;background:var(--surface);border-bottom:1px solid var(--line);padding:9px 16px;display:flex;align-items:center;gap:9px;flex-wrap:wrap;font-size:12px}.chat-source-strip button{color:var(--blue);margin-left:auto;font-size:12px}.chat-source-strip .source-badges{align-items:center}.chat-source-strip small{color:var(--muted)}
.history-total{font-size:27px;color:var(--ink);font-weight:650;margin:12px 0 4px}.history-job details{margin-top:16px;border-top:1px solid var(--line);padding-top:12px}.history-job summary{color:var(--blue);cursor:pointer;font-size:13px}.history-job .history-controls button{border:1px solid var(--line);padding:8px 11px;border-radius:8px}.chat-source-line{display:block;font-size:10px;color:var(--blue);margin-top:5px}
@media(max-height:700px){.sidebar .ios-navigation{height:32px}.sidebar .large-title{font-size:24px}.sidebar .profile-switcher{padding:7px;margin-bottom:6px}#ios-tabs{height:50px}.sidebar .side-bottom{display:none}}
.history-percentage{font-size:25px;font-weight:650;color:var(--blue);margin:12px 0}.period-presets{display:flex;gap:8px;margin:14px 0}.period-presets button{padding:8px 10px;background:var(--hover);border-radius:8px;color:var(--blue)}.period-controls input[type=checkbox]{width:18px;height:18px;margin-right:6px}.period-controls [hidden],.history-job label[hidden]{display:none!important}.period-controls input[type=datetime-local]{font-size:13px;padding:10px 6px}
/* Consistent archive controls, separated from the message appearance. */
#workspace-panel{width:400px}.workspace-header{padding:0 20px}.workspace-body{padding:20px}.workspace-body .primary{border-radius:12px;min-height:44px;font-size:14px;font-weight:600;box-shadow:none}.workspace-body .settings-row{font-size:14px;min-height:44px;padding:13px 12px;border-radius:9px}.workspace-body .settings-row:hover{background:var(--hover)}.workspace-body .connection-card{padding:18px;border-color:var(--line);border-radius:14px}.workspace-body .settings-group{background:var(--surface);border:1px solid var(--line)}.workspace-body button:focus-visible, .workspace-body input:focus-visible{outline:2px solid var(--blue);outline-offset:2px}
.panel-intro{font-size:13px;line-height:1.6;color:var(--muted);margin:0 0 16px}.panel-intro strong{color:var(--ink)}.refined-search input{height:44px;font-size:16px!important}.search-filters{border-bottom:1px solid var(--line);padding:14px 0}.search-filters summary{color:var(--muted);cursor:pointer;font-size:13px}.search-hit,.saved-card{border:1px solid var(--line);border-radius:12px;background:var(--surface);padding:15px;margin:0 0 10px;width:100%;text-align:left}.search-hit:hover{background:var(--hover)}.search-hit time{display:block;font-size:11px;color:var(--muted);margin-bottom:8px}.search-hit strong{font-size:13px;color:var(--blue)}.search-hit p,.saved-card p{font-size:14px;line-height:1.5;white-space:pre-wrap;overflow-wrap:anywhere;margin:7px 0}.search-hit>span{font-size:11px;color:var(--muted)}.search-hit mark{background:#ffce6266;color:var(--ink);border-radius:3px}.saved-meta{display:flex;flex-direction:column;gap:4px}.saved-meta strong{font-size:14px}.saved-meta time{font-size:11px;color:var(--muted)}.saved-thumbnail{width:100%;max-height:170px;object-fit:cover;border-radius:8px;margin-top:10px}.saved-actions{display:flex;justify-content:space-between;gap:8px;margin-top:13px}.saved-actions button{font-size:12px;color:var(--blue);background:var(--hover);border-radius:8px;padding:10px}.saved-card blockquote{margin:10px 0;padding-left:10px;border-left:2px solid var(--blue);font-size:12px;color:var(--muted)}#lightbox-actions button{font-size:14px;padding:10px 14px;border-radius:10px;background:#ffffff20;color:white}#lightbox header{gap:10px;flex-wrap:wrap;height:auto;min-height:65px}#lightbox-caption{line-height:1.5}.chat-row[hidden]{display:none!important}
@media(max-width:700px){#workspace-panel{width:100%}.workspace-body{padding:16px}#lightbox-count{display:none}#lightbox-actions button{padding:8px;font-size:12px}.saved-actions button{min-height:42px}}
.media-tile:is(:has(video),.has-video):before{content:'▶';position:absolute;inset:0;display:grid;place-items:center;color:var(--blue);font-size:25px;background:var(--hover);pointer-events:none}.media-tile:is(:has(video),.has-video)>span{z-index:1}
.history-source{display:flex;flex-direction:column;gap:6px;margin:0 0 20px;padding:14px 16px;border-radius:12px;background:var(--hover)}.history-source>span{font-size:11px;color:var(--muted)}.history-source strong{font-size:15px}.history-source small{font-size:12px;line-height:1.5;color:var(--muted)}.history-chat-group{border:1px solid var(--line);border-radius:14px;margin:12px 0;overflow:hidden}.history-chat-group>summary{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:16px;font-size:15px;font-weight:600;cursor:pointer;list-style:none}.history-chat-group>summary:after{content:'⌄';color:var(--muted)}.history-chat-group>summary small{font-size:11px;font-weight:400;color:var(--muted);margin-left:auto}.history-chat-group[open]>summary{border-bottom:1px solid var(--line)}.history-chat-group .history-job{margin:0;border:0!important;border-radius:0!important;padding:16px!important}.history-numbers{display:grid;grid-template-columns:1fr 1fr;gap:16px}.history-numbers>div{display:flex;flex-direction:column;gap:5px}.history-numbers strong{font-size:27px;letter-spacing:-.8px}.history-numbers span{font-size:11px;color:var(--muted)}.coverage-state{font-size:13px!important;font-weight:600;color:var(--ink)!important;margin:18px 0 4px}.coverage-state.complete{color:#35af78!important}.coverage-time{font-size:11px!important;margin:5px 0;color:var(--muted)}.history-task{padding:14px;background:var(--hover);border-radius:10px;margin-top:16px}.history-task>div{display:flex;justify-content:space-between;gap:10px;font-size:12px}.history-task b{color:var(--blue)}.history-task progress{margin:12px 0 6px}.history-task small{font-size:11px;color:var(--muted)}.history-explanation p{font-size:12px!important}.history-dashboard .history-controls{gap:8px;margin-bottom:4px}.history-dashboard #history-summary{background:none;padding:0;color:var(--muted);font-size:12px}.connection-dashboard .identity-card{padding:4px 0 14px}.connection-dashboard .identity-explainer{font-size:12px;margin-bottom:14px}.connection-dashboard .connection-card{margin:12px 0}.connection-dashboard .connection-card p{font-size:12px}.connection-optional{background:var(--hover)!important;border:0!important}.connected-chats{margin-top:20px}.connected-chats>summary{font-size:14px;color:var(--blue);cursor:pointer;padding:12px 0}.connected-chats .connection-card{border:0;padding:0}
.media-tile.preview-ready:is(:has(video),.has-video):before{inset:8px auto auto 8px;width:28px;height:28px;border-radius:50%;background:#0008;color:white;font-size:13px;z-index:1}
.media-tile.preview-failed:is(:has(video),.has-video):before{content:'▶';background:transparent}
.media-tile-placeholder{position:absolute;inset:0;background:linear-gradient(145deg,#25313b,#151d25)}.media-tile-placeholder:after{content:'';position:absolute;inset:25%;border-radius:50%;background:#ffffff0b}
.media-tile>img,.media-tile>.media-tile-preview{position:absolute;inset:0;z-index:0;width:100%;height:100%;object-fit:cover}.media-tile>.media-tile-preview{opacity:0;transition:opacity .2s ease}.media-tile.preview-playing>.media-tile-preview{opacity:1}.media-tile.preview-playing:before{opacity:0}.media-tile.preview-loading:before{content:'···';letter-spacing:2px}.media-tile>span:last-child{z-index:2}
@media(prefers-reduced-motion:reduce){.media-tile>.media-tile-preview{transition:none}}
.history-job-list{margin-top:18px;border-top:1px solid var(--line);padding-top:12px}
.history-job-list h4{margin:0 0 10px;font-size:13px}
.history-job-item{display:flex;align-items:center;gap:6px;padding:10px 0;border-top:1px solid var(--line)}
.history-job-item:first-child{border-top:0}
.history-job-item>div{display:flex;flex:1;min-width:0;flex-direction:column;gap:3px}
.history-job-item strong{font-size:12px;font-weight:600}
.history-job-item small,.history-job-item span{font-size:11px;color:var(--muted)}
.history-job-item button{flex:none;padding:7px 9px;border:1px solid var(--line);border-radius:8px;color:var(--blue);font-size:12px}
.history-source [data-history-account-check]{align-self:flex-start;border:0;background:transparent;color:var(--blue);padding:4px 0;font:inherit;font-size:12px;cursor:pointer}.history-source [data-history-account-check]:disabled{opacity:.5;cursor:default}.history-source [data-history-account-feedback]:empty{display:none}
body.dark .conversation{background:radial-gradient(ellipse at 67% 25%,#1b1c2b 0%,transparent 62%),linear-gradient(145deg,#101219,#171522 72%,#131721)}
body.dark .conversation:before{filter:invert(1) sepia(.5) saturate(1.4) hue-rotate(190deg);opacity:.075}
