/* SafeDrop layout, independently deployed. Controllers remain unchanged. */
:root[data-theme=telegram]{color-scheme:light;--bg:#edf4f8;--panel:#fff;--panel-2:#f3f6f8;--text:#192f40;--muted:#738592;--line:#e6edf1;--accent:#3398db;--accent-2:#227cb7}
html[data-theme=telegram] body{background:#eaf2f6;color:#192f40;font:14px/1.4 -apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif}
html[data-theme=telegram] .chat-shell{grid-template-columns:310px minmax(0,1fr)}
html[data-theme=telegram] .sidebar{background:#fff;border-right:1px solid #e3ebef;padding:16px;gap:12px;min-width:0}
html[data-theme=telegram] .sidebar>header{padding:0;width:100%;margin:0;gap:8px}
.sd-wordmark{font-size:21px;letter-spacing:-.6px;font-weight:700}.sd-wordmark b{color:#3398db}
html[data-theme=telegram] .brand{color:#172f41;font-size:22px}.brand img{width:32px;height:32px}
html[data-theme=telegram] #settings-chat{display:none}
html[data-theme=telegram] .sd-new{margin-left:auto;width:auto;min-width:0;padding:8px;font-size:11px;border-radius:9px;background:#e8f4fc;color:#2187c7;box-shadow:none}
html[data-theme=telegram] .room-search{width:100%;margin:0;min-height:40px;background:#f1f5f8;border:0;border-radius:10px;padding:8px 12px}
html[data-theme=telegram] .room-search input{width:100%;background:transparent;color:#213a4b;border:0;padding:0;min-width:0}
.sd-shortcuts{display:flex;gap:5px;flex-wrap:wrap}.sd-shortcuts button{flex:1;padding:7px 4px!important;min-width:0;width:auto!important;font-size:11px!important;border-radius:8px!important}
.sd-list-heading{font-size:12px;font-weight:600;color:#7b8c98}.sd-filters select{width:100%;border:0;background:#f2f6f8;border-radius:9px;color:#476373}
html[data-theme=telegram] #rooms{width:100%;margin:0;flex:1;overflow-y:auto}
html[data-theme=telegram] .room-entry{width:100%;margin:0;position:relative}
html[data-theme=telegram] .room-item{width:100%;border:0;background:transparent;border-radius:10px;color:#192f40;padding:12px 8px;min-width:0}
html[data-theme=telegram] .room-item.active{background:#e6f3fc}html[data-theme=telegram] .avatar{background:#dceef9;color:#258bca;border:0}
html[data-theme=telegram] .sidebar-bottom{width:100%;padding:10px 0 0;margin:0;border-top:1px solid #e6edf1}
html[data-theme=telegram] .profile{width:100%;margin:0;padding:8px 0;cursor:pointer;border:0;background:transparent}
html[data-theme=telegram] .options-button{width:100%;margin:0;padding:10px;background:#edf5fa;color:#2787c2;border:0;border-radius:9px;box-shadow:none;text-align:center}
html[data-theme=telegram] #sidebar-options-panel{background:#fff;padding:8px;border:1px solid #e5edf2;border-radius:12px;max-height:45vh;overflow-y:auto}
html[data-theme=telegram] #sidebar-options-panel button{width:100%;margin:0;text-align:left}
html[data-theme=telegram] .conversation,html[data-theme=telegram] #active-room{background:#eaf2f7;min-width:0}
html[data-theme=telegram] .room-header{background:#fff;padding:12px 22px;border-bottom:1px solid #e0e9ee;gap:12px}
html[data-theme=telegram] .room-heading h2{color:#192f40;font-size:16px}html[data-theme=telegram] .room-heading small{color:#82929d}
html[data-theme=telegram] .room-action-panel{background:#fff;border:1px solid #dce8ef;border-radius:12px;box-shadow:0 8px 30px #163a5520}
html[data-theme=telegram] #messages{padding:24px 6%;background:radial-gradient(circle at 20% 80%,#fff6,transparent 55%),#eaf2f7}
html[data-theme=telegram] .bubble{background:#fff;color:#1d3546;border:0;border-radius:14px;box-shadow:0 1px 3px #2147600a;max-width:min(76%,600px)}
html[data-theme=telegram] .message.mine .bubble,html[data-theme=telegram] .message.own .bubble,html[data-theme=telegram] .bubble.mine{background:#dceffb}
html[data-theme=telegram] #compose{background:#fff;border-top:1px solid #e0e9ee;padding:12px 22px;position:relative}
html[data-theme=telegram] #message-input{background:#f3f7fa;border:0;border-radius:12px;color:#193547;min-height:44px}
html[data-theme=telegram] #send{background:#3398db;color:#fff;border:0;border-radius:50%;width:44px;height:44px}
html[data-theme=telegram] dialog{background:#fff;color:#193547;border:1px solid #d8e5ee;border-radius:16px}html[data-theme=telegram] input,html[data-theme=telegram] select,html[data-theme=telegram] textarea{background:#f5f8fa;color:#193547;border-color:#dce7ee}
html[data-theme=telegram] .primary{background:#3398db;color:#fff;border:0;box-shadow:none}html[data-theme=telegram] .secondary{background:#f0f6fa;color:#267eaf;border:1px solid #deebf3}
.sd-profile-status{margin-top:22px}.sd-profile-status .presence-control,.sd-profile-status .status-timing{width:100%!important;max-width:none!important;margin:8px 0!important;background:transparent!important;color:inherit!important}.sd-profile-status select{min-width:120px!important;width:auto!important}.sd-compose-tools{position:relative;width:32px;margin-bottom:6px}.sd-compose-tools summary{cursor:pointer;font-size:24px;list-style:none;color:#5990af}.sd-compose-popover{position:absolute;bottom:34px;left:0;display:flex;flex-direction:column;gap:7px;background:white;border:1px solid #dfeaf1;border-radius:12px;padding:10px;z-index:30;min-width:180px}.sd-recommendations .room-banners{display:flex;flex-wrap:wrap;margin:8px 0}.sd-recommendations summary{cursor:pointer;padding:8px}
html[data-theme=telegram] .auth-shell{background:#edf5fa}html[data-theme=telegram] .intro{background:#e8f4fb;color:#214257}html[data-theme=telegram] .auth-panel{background:#fff;color:#193547}html[data-theme=telegram] .auth-card{color:#193547}
@media(max-width:760px){html[data-theme=telegram] .chat-shell{grid-template-columns:minmax(0,1fr)}html[data-theme=telegram] .sidebar{width:100%;padding:14px}html[data-theme=telegram] .room-header{padding:10px;gap:8px}html[data-theme=telegram] #compose{padding:10px}html[data-theme=telegram] #messages{padding:16px 12px}html[data-theme=telegram] .bubble{max-width:90%}.sd-wordmark{font-size:20px}}
html[data-theme=telegram] #conversations-toggle{display:none!important}html[data-theme=telegram] #rooms .room-entry{width:100%!important;margin:0!important}html[data-theme=telegram] .compose-row{background:#f3f7fa;border:0;border-radius:12px}html[data-theme=telegram] .retention-bar{background:#f7fafc;color:#8495a0;border-color:#e0e9ee}html[data-theme=telegram] .extra-room-tools{background:#fff;border-color:#e2ebf1}

html[data-theme=telegram] .expiry-strip{background:#f7fafc;color:#8495a0;border-color:#e0e9ee}html[data-theme=telegram] .room-action-panel .extra-room-tools{display:flex;flex-direction:column;gap:6px;padding:0;width:100%}html[data-theme=telegram] .room-action-panel .extra-room-tools button{width:100%;text-align:left}

.sd-compose-tools{margin-bottom:0;flex-shrink:0}.sd-compose-popover #attach{width:100%!important;font:inherit;height:auto!important;border-radius:8px!important}

/* App-wide settings share the original controls; no duplicate forms or inputs. */
#sd-app-settings{width:min(560px,calc(100vw - 24px));max-height:85dvh;padding:20px;overflow:auto}
#sd-app-settings>header{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:16px}
#sd-app-settings>header h2{margin:0;font-size:21px}
#sd-app-settings [hidden]{display:none!important}
.sd-settings-group{border-top:1px solid var(--line,#dfe8ee)}
.sd-settings-group>summary{display:grid;grid-template-columns:28px minmax(0,1fr) 20px;align-items:center;gap:12px;min-height:58px;cursor:pointer;list-style:none;font-size:15px;font-weight:600}
.sd-settings-group>summary::-webkit-details-marker{display:none}
.sd-row-icon{color:var(--accent,#3398db);text-align:center;font-size:20px}
.sd-row-chevron{color:var(--muted,#788d9b);font-size:25px;text-align:right}
.sd-settings-group[open] .sd-row-chevron{transform:rotate(90deg)}
.sd-settings-body{padding:0 0 18px 40px;display:flex;flex-direction:column;gap:12px}
.sd-settings-body section{margin:0;padding:0}
.sd-settings-body h3{font-size:14px;margin:14px 0 8px}
.sd-settings-body label:not(.check){display:flex;flex-direction:column;gap:6px;min-width:0;margin:0}
.sd-settings-body input:not([type=checkbox]),.sd-settings-body select{max-width:100%;width:100%;min-width:0;box-sizing:border-box}
.sd-settings-body label.check{display:flex;align-items:center;gap:12px;margin:6px 0}
.sd-settings-body input[type=checkbox]{appearance:none;flex-shrink:0;width:36px;height:21px;border:0;border-radius:12px;background:var(--muted,#a1afba);position:relative;cursor:pointer}
.sd-settings-body input[type=checkbox]::after{content:'';position:absolute;top:3px;left:3px;width:15px;height:15px;background:white;border-radius:50%;transition:transform .15s}
.sd-settings-body input[type=checkbox]:checked{background:var(--accent,#3398db)}
.sd-settings-body input[type=checkbox]:checked::after{transform:translateX(15px)}
.sd-settings-body input[type=checkbox]:focus-visible{outline:2px solid var(--accent,#3398db);outline-offset:3px}
.sd-settings-body input[type=range]{appearance:auto}
.sd-settings-row{display:flex!important;align-items:center;gap:12px;width:100%!important;margin:0!important;text-align:left!important;font:inherit!important;min-height:42px;padding:10px 12px!important;border-radius:9px!important;white-space:normal!important;height:auto!important}
.sd-settings-row[data-icon]::before{content:attr(data-icon);font-size:20px;color:var(--accent,#3398db)}
#sd-app-settings #profile-open{background:transparent;border:0;padding-left:0!important;margin-bottom:8px!important}
#sd-app-settings #sidebar-options-panel{display:flex!important;flex-direction:column;gap:8px;border:0;box-shadow:none;padding:0;max-height:none;background:transparent}
#sd-app-settings .profile-alerts{display:flex;flex-direction:column;gap:10px}
#sd-app-settings .profile-alerts .hidden{display:none!important}
#sd-app-settings .sd-google-account{display:flex;flex-direction:column;gap:8px}
#sd-app-settings .sd-google-account .hidden{display:none!important}
#sd-app-settings .sd-account-danger,.sd-conversation-danger{border-top:1px solid var(--line,#dfe8ee);padding-top:16px;margin-top:10px}
.sd-conversation-danger button,.sd-account-danger button{color:#c04444!important}
#sd-app-settings .password-settings{border:0;background:transparent}
#sd-app-settings .fine{font-size:12px;line-height:1.5;margin:4px 0;color:var(--muted,#738592)}
#sd-app-settings label,#sd-app-settings label>span,#sd-app-settings h3{color:var(--text,#193547);opacity:1}
#sd-app-settings #notify-toggle{display:flex;align-items:center;gap:12px;width:100%;background:transparent;border:0;text-align:left;padding:10px 0;color:inherit}
#sd-app-settings #notify-toggle::after{content:'';margin-left:auto;flex-shrink:0;width:36px;height:21px;border-radius:12px;background:radial-gradient(circle at 10px 50%,white 7px,transparent 8px),var(--muted,#a1afba)}
#sd-app-settings #notify-toggle[aria-checked=true]::after{background:radial-gradient(circle at 26px 50%,white 7px,transparent 8px),var(--accent,#3398db)}
.sd-chat-options{font-size:26px!important;min-width:40px!important;line-height:1!important;padding:8px!important}
.sd-profile-status .presence-control,.sd-profile-status .status-timing{display:flex!important;flex-wrap:wrap;gap:10px;align-items:center}
.sd-profile-status .status-timing select,.sd-profile-status .presence-control select{min-width:0!important;max-width:100%!important}
@media(max-width:480px){#sd-app-settings{padding:16px;max-height:90dvh}.sd-settings-body{padding-left:0}.sd-settings-group>summary{min-height:56px}.room-action-panel{max-width:calc(100vw - 24px);max-height:70dvh;overflow:auto}}

/* The conversation list is the primary content of the compact sidebar. */
.chat-shell{grid-template-columns:304px minmax(0,1fr)}
html[data-theme=telegram] .chat-shell{grid-template-columns:304px minmax(0,1fr)}
.sd-compact-sidebar{padding:0!important;gap:0!important;min-height:0}
.sd-compact-sidebar>header{padding:22px!important;margin:0!important;min-height:80px;gap:10px!important}
.sd-compact-sidebar .brand{font-size:22px}
.sd-compact-sidebar .sd-new{width:36px!important;height:36px!important;min-width:36px!important;font-size:25px!important;line-height:1;padding:0!important;background:var(--panel-2,#e8f4fd)!important;color:var(--accent,#258ed0)!important}
.sd-compact-sidebar .room-search{display:flex;align-items:center;gap:10px;padding:8px 13px!important;width:auto!important;margin:0 18px 16px!important;border-radius:11px!important;min-height:42px}
.sd-sidebar-tabs{display:flex;gap:4px;margin:0 20px;border-bottom:1px solid var(--line,#e5ecf1);align-items:stretch}
.sd-sidebar-tabs button{border:0!important;box-shadow:none!important;background:transparent!important;color:var(--muted,#82909f);padding:0 5px 13px!important;margin:0!important;border-radius:0!important;font-size:11px!important;min-width:0!important;width:auto!important;white-space:nowrap;position:relative;min-height:32px;flex:1}
.sd-sidebar-tabs button.active{color:var(--accent,#3199d6)}
.sd-sidebar-tabs button.active::after{content:'';position:absolute;bottom:-1px;left:4px;right:4px;height:3px;background:var(--accent,#3199d6);border-radius:3px}
.sd-sidebar-tabs .badge{font-size:9px;min-width:15px;height:15px;padding:0 4px;background:var(--accent,#3199d6);color:white;display:inline-flex;align-items:center;justify-content:center;margin-left:3px}
.sd-sidebar-tabs .badge[hidden]{display:none!important}
.sd-notes-shortcut{display:flex!important;align-items:center;gap:12px;width:calc(100% - 32px)!important;margin:16px 16px 8px!important;padding:13px 12px!important;min-height:56px;border:0!important;box-shadow:none!important;border-radius:11px!important;background:var(--panel-2,#f3f8fc)!important;color:var(--text,#3b6f96)!important;text-align:left;font-size:13px!important}
.sd-notes-shortcut::before{content:attr(data-icon);display:grid;place-items:center;flex-shrink:0;width:32px;height:32px;border-radius:9px;font-size:20px;color:var(--accent,#3199d6);background:var(--bg,#e3eff8)}
.sd-compact-sidebar .sd-list-heading{margin:12px 26px 10px;font-size:10px;letter-spacing:1px;color:var(--muted,#9aa8b5)}
.sd-compact-sidebar #rooms{width:auto!important;margin:0!important;padding:0 10px;min-height:0;flex:1;overflow-y:auto}
.sd-compact-sidebar .room-item{padding:14px 12px!important;border-radius:12px;gap:12px}
.sd-compact-sidebar .room-copy strong{font-size:13px;line-height:1.4}
.sd-compact-sidebar .room-copy small{font-size:11.5px;line-height:1.5}
.sd-compact-sidebar .contact-status{display:none}
.sd-compact-sidebar .room-entry{margin:2px 0!important}
.sd-compact-sidebar .room-remove{opacity:0;transition:opacity .15s}
.sd-compact-sidebar .room-entry:hover .room-remove,.sd-compact-sidebar .room-entry:focus-within .room-remove{opacity:1}
.sd-compact-sidebar .sidebar-bottom{display:grid;grid-template-columns:minmax(0,1fr) 36px;gap:12px;padding:12px 18px 18px!important;margin:0!important;border-top:1px solid var(--line,#edf1f4)}
.sd-sidebar-tools{grid-column:1/-1;display:flex;align-items:center;gap:9px;background:transparent;border:0;box-shadow:none;color:var(--muted,#7c8e9f);padding:5px 7px;min-height:30px;text-align:left;font-size:12px}
.sd-sidebar-tools>span:first-child{font-size:19px}.sd-tools-chevron{margin-left:auto;font-size:19px}
.sd-compact-sidebar .profile{width:100%!important;padding:4px 5px!important;gap:11px;margin:0!important;grid-column:1;grid-row:2;align-items:center;min-width:0}
.sd-compact-sidebar .profile .avatar{width:38px;height:38px;min-width:38px;font-size:12px}
.sd-compact-sidebar .profile strong{font-size:12px}
.sd-self-status{font-size:11px!important;color:var(--muted,#7c98a6)}
.sd-compact-sidebar .sd-settings-gear{grid-column:2;grid-row:2;align-self:center;width:34px!important;min-width:34px!important;height:34px!important;padding:0!important;margin:0!important;font-size:21px!important;border-radius:10px!important;background:var(--panel-2,#f1f6fa)!important;color:var(--accent,#6e8da6)!important}
@media(hover:none){.sd-compact-sidebar .room-remove{opacity:1}}
@media(max-width:760px){.chat-shell,html[data-theme=telegram] .chat-shell{grid-template-columns:minmax(0,1fr)}}
