/* Ten UX principles: visible hierarchy, related controls and reachable actions. */
.icon-button,.header-actions>.icon-button,.mobile-back,.menu-heading button,
.composer .attach-button,.composer .send-button,.bot-creator #close-modal{
 min-width:44px;min-height:44px;width:44px;height:44px;flex-shrink:0;
}
.button,.approval-actions .button,.team-menu .filters button,.pending-request button,.upload-chip button{min-height:44px}
.modal-body summary,.signin-details summary,.typing-activity>summary,.job-activity summary{
 min-height:44px;padding-block:12px;cursor:pointer;
}
.modal-head h2:focus{outline:none}
.action-feedback{font-size:14px;line-height:1.5;color:var(--muted);margin:16px 0 0}
.action-feedback.action-error{color:var(--text);border-left:3px solid var(--accent);padding-left:12px}
.settings-section{margin:24px 0 0;padding-top:24px;border-top:1px solid var(--line)}
.settings-section h3{font-size:15px;font-weight:600;margin:0 0 18px}
.settings-section label{display:block;margin:18px 0 8px}
.settings-section .field{margin-top:0}
.settings-section .modal-actions{margin-bottom:0}
.settings-links{display:flex;flex-wrap:wrap;gap:10px}
.bot-name-label{font-size:14px;color:var(--muted);margin:0 0 10px;text-align:center}
.bot-appearance{margin:18px 0 20px;border-block:1px solid var(--line);text-align:center}

.bot-shapes,.bot-colors{gap:12px;justify-content:center;margin:12px auto 20px}
.bot-shapes{grid-template-columns:repeat(4,46px)}
.bot-colors{grid-template-columns:repeat(5,44px)}
.bot-shapes legend,.bot-colors legend{font-size:13px;color:var(--muted);margin-bottom:14px;text-align:left}
.color-choice{width:44px;height:44px;padding:9px}
.color-choice:nth-of-type(n+7){transform:none}
.bot-create-note{font-size:12px}
.welcome-tool-search{width:100%;margin:0 0 14px;text-align:left}
.welcome-tool-search label{display:block;font-size:13px;color:var(--welcome-muted);margin-bottom:8px}
.welcome-tool-search input{padding:12px 16px;min-height:48px}
.welcome-tool-results{width:100%}
.welcome-tool-count{font-size:13px;color:var(--welcome-muted);min-height:20px;margin:12px 0}
.welcome-step-label{font-size:12px;color:var(--welcome-muted);margin:0 0 12px;text-align:center}
.welcome-tool-empty{font-size:14px;line-height:1.5;color:var(--welcome-muted);padding:24px 0}
@media(max-width:360px){.bot-colors{gap:8px;grid-template-columns:repeat(5,44px)}.bot-shapes{gap:12px}.header-actions{gap:0}.conversation-header{gap:6px}.composer{gap:7px}}

/* Quiet, native-feeling chat inspired by Jadenn's messaging references. */
:root{--bg:#000;--sidebar:#000;--bubble:#232323;--chat-sent:#595959;--chat-sent-ink:#fff;--chat-glass:#000000e8;--working-base:#a2a2aa;--working-light:#f6f6f8}
[data-theme=light]{--bg:#fafaf8;--sidebar:#f4f4f1;--bubble:#e9e9e5;--chat-sent:#deded9;--chat-sent-ink:#242424;--chat-glass:#fafaf8ed;--working-base:#66666b;--working-light:#242426}
.conversation-header{border:0;background:transparent;padding:14px 24px;gap:10px;min-height:80px;height:80px;z-index:3}
.chat-identity{display:flex;align-items:center;gap:9px;min-width:0;max-width:calc(100% - 110px);height:46px;padding:5px 14px 5px 9px;border:1px solid var(--line-soft);border-radius:28px;background:var(--chat-glass);text-align:left;backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px)}
.chat-identity .header-person{display:block;flex:initial}.chat-name{display:block;font-size:17px;font-weight:550;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.chat-identity .avatar{width:30px;height:30px;flex-shrink:0}
.header-actions{margin-left:auto}.header-actions>.icon-button,.conversation-header .mobile-back{border:1px solid var(--line-soft);border-radius:50%;background:var(--chat-glass);color:var(--text);backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px)}
.message-feed{gap:12px;padding-top:20px}.bubble{padding:11px 15px;border-radius:23px;font-size:17px;line-height:1.4;letter-spacing:-.2px;max-width:min(88%,60ch)}.user .bubble{background:var(--chat-sent);color:var(--chat-sent-ink);border-radius:23px;max-width:84%}.message-group.user{margin:9px 0}.date-separator{font-size:12px;margin:18px 0;color:var(--faint)}
.compose-area{background:var(--bg);padding:12px 24px max(15px,env(safe-area-inset-bottom))}.composer{border:0;border-radius:0;background:none;padding:0;gap:10px;min-height:46px;align-items:flex-end}.composer:focus-within{border:0}.composer .attach-button{border:1px solid var(--line-soft);background:transparent;width:46px;height:46px;min-width:46px;min-height:46px;border-radius:50%;margin:0;color:var(--text)}
.message-field{display:flex;align-items:flex-end;gap:6px;flex:1;min-width:0;border:1px solid var(--line);border-radius:26px;padding:0 2px 0 15px;min-height:46px}.message-field:focus-within{border-color:var(--faint)}.composer textarea{min-height:44px;max-height:132px;margin:0;padding:10px 0;line-height:24px;font-size:17px;scrollbar-width:none}.composer textarea::-webkit-scrollbar{display:none}.composer .send-button{margin:0;border:6px solid var(--bg);background:#f5f5f5;color:#111;border-radius:50%;width:44px;height:44px;min-width:44px;min-height:44px}.composer .send-button:disabled{opacity:.32}.composer .send-button svg{width:21px;height:21px}
.bubble.working-update{padding:8px 2px;background:transparent;min-width:0;max-width:100%;border-radius:0}.working-line{gap:10px;min-width:0;font-size:16px;line-height:1.4}.working-line .avatar{width:30px;height:30px;flex-shrink:0}.working-shimmer{color:var(--working-base);overflow-wrap:anywhere}
@supports(background-clip:text){.working-shimmer{background:linear-gradient(100deg,var(--working-base) 35%,var(--working-light) 49%,var(--working-base) 63%);background-size:250% 100%;background-clip:text;-webkit-background-clip:text;color:transparent;animation:working-sweep 2.8s linear infinite}}
@keyframes working-sweep{from{background-position:150% 0}to{background-position:-100% 0}}
[data-character-motion=off] .working-shimmer{animation:none;background:none;color:var(--working-base)}
@media(prefers-reduced-motion:reduce){.working-shimmer{animation:none;background:none;color:var(--working-base)}}
@media(max-width:760px){.conversation-header{padding:10px 16px;min-height:72px;height:72px;gap:8px}.chat-identity{max-width:calc(100% - 104px);height:44px;padding-right:12px}.chat-name{font-size:16px}.message-feed{padding:18px 16px 14px;gap:10px}.bubble{font-size:17px;line-height:1.4;padding:11px 15px;max-width:91%}.user .bubble{max-width:85%}.compose-area{padding:10px 16px max(12px,env(safe-area-inset-bottom))}.conversation-header .mobile-back{margin:0;min-width:44px;width:44px}.composer{gap:10px}.intro-message .bubble{max-width:91%}}

.typing-response .working-update{width:fit-content;max-width:100%;padding:8px 2px}.typing-response .working-line{height:auto;min-height:30px;justify-content:flex-start}.working-line{white-space:normal}.composer textarea:placeholder-shown{white-space:nowrap;text-overflow:ellipsis;overflow-x:hidden}

.sidebar-header .profile-button{flex:0 0 44px;width:44px;height:44px;min-width:44px;padding:0;margin:0;justify-content:center}.sidebar-header .profile-avatar{width:40px;height:40px}.sidebar-header .profile-copy{position:absolute!important;width:1px!important;height:1px!important;overflow:hidden!important;clip-path:inset(50%)!important;white-space:nowrap!important}.sidebar-header #profile-more{display:none}

/* Keep native scrolling, without visible scrollbar tracks or thumbs. */
html,body,*{scrollbar-width:none!important;-ms-overflow-style:none!important}
*::-webkit-scrollbar{display:none!important;width:0!important;height:0!important}

.modal-head{touch-action:pan-x pinch-zoom}
/* Settings follow the quiet, grouped mobile layout. */
#modal.settings-sheet,#modal.settings-detail{width:min(540px,calc(100vw - 24px));max-height:calc(100dvh - 24px);border:0;border-radius:32px;background:var(--bg);box-shadow:0 24px 90px #0006;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
#modal.settings-sheet .modal-head,#modal.settings-detail .modal-head{position:sticky;top:0;z-index:2;min-height:88px;padding:16px 20px;background:var(--bg);border:0}
#modal.settings-sheet .modal-head h2{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
#modal.settings-sheet #close-modal{margin-right:auto;margin-left:0}
#modal.settings-sheet .icon-button,#modal.settings-detail .icon-button{width:46px;height:46px;border:1px solid var(--line);border-radius:50%;background:var(--bg);flex:none}
#modal.settings-detail .modal-head h2{font-size:18px;font-weight:500;flex:1;text-align:center}
#modal.settings-sheet .modal-body{padding:12px 20px 30px}
#modal.settings-detail .modal-body{padding:12px 20px 28px}
.settings-group{border-radius:20px;background:var(--surface);overflow:hidden;margin:0 0 28px}
.setting-row{position:relative;display:flex;width:100%;align-items:center;gap:12px;min-height:58px;padding:16px 20px;color:var(--text);text-decoration:none;text-align:left;font:inherit;font-size:17px;line-height:1.3;background:transparent;border:0;border-radius:0}
.setting-row+.setting-row::before{content:"";position:absolute;top:0;left:20px;right:0;height:1px;background:var(--line)}
button.setting-row:hover,a.setting-row:hover{background:var(--surface-hover)}
button.setting-row:active,a.setting-row:active{background:var(--surface-hover)}
.setting-copy{flex:1;min-width:0;overflow-wrap:anywhere}
.setting-copy>span{display:block}
.setting-copy small{display:block;font-size:14px;line-height:1.35;color:var(--muted);margin-top:4px}
.setting-value{font-size:15px;color:var(--muted);max-width:52%;text-align:right;overflow-wrap:anywhere;font-variant-numeric:tabular-nums}
.setting-chevron{font-size:26px;line-height:1;color:var(--faint);flex:none}
.setting-profile{padding-top:20px;padding-bottom:20px}
.setting-avatar{display:grid;place-items:center;flex:none;width:48px;height:48px;border-radius:50%;background:var(--surface-hover);color:var(--muted);font-weight:600;font-size:19px}
#modal .settings-group-label{font-size:13px;font-weight:400;color:var(--muted);margin:0 20px 10px}
.setting-switch{position:relative;flex:none;width:52px;height:32px;border-radius:20px;border:0;background:#55565a;color:transparent!important;font-size:0!important;transition:background .16s;min-height:0;padding:0}
.setting-switch::after{content:"";position:absolute;width:26px;height:26px;left:3px;top:3px;border-radius:50%;background:#fff;box-shadow:0 1px 3px #0003;transition:transform .16s}
.setting-switch[aria-checked=true]{background:#30c95a}
.setting-switch[aria-checked=true]::after{transform:translateX(20px)}
.setting-switch:disabled{opacity:.45}
.setting-row:focus-visible,.setting-switch:focus-visible{outline:2px solid var(--text);outline-offset:-3px}
#sign-out.setting-row{color:#f19a9a}
#sign-out .setting-chevron{display:none}
.settings-brand{display:flex;align-items:center;flex-direction:column;gap:8px;padding:18px 0 10px;font-size:19px}
.settings-brand img{border-radius:18px;margin-bottom:8px}
.settings-brand small{font-size:13px;color:var(--muted)}
.settings-email{font-size:14px;color:var(--muted);margin-top:16px;overflow-wrap:anywhere}
#notification-hint:empty{display:none}
@media(max-width:600px){#modal.settings-sheet,#modal.settings-detail{width:100%;max-height:calc(100dvh - env(safe-area-inset-top) - 12px);margin:auto 0 0;border-radius:30px 30px 0 0}#modal.settings-sheet .modal-body{padding-bottom:calc(30px + env(safe-area-inset-bottom))}.setting-row{font-size:17px;padding:15px 18px}.setting-profile{padding-top:20px;padding-bottom:20px}.setting-copy small{font-size:14px}.setting-value{font-size:15px}.setting-zone{font-size:13px}}
@media(prefers-reduced-motion:reduce){.setting-switch,.setting-switch::after{transition:none}}
#modal.settings-sheet,#modal.settings-detail{max-width:calc(100vw - 24px)}
.setting-switch::before{content:"";position:absolute;inset:-6px 0;border-radius:24px}
@media(max-width:600px){#modal.settings-sheet,#modal.settings-detail{max-width:100vw}}

/* Optional titles beside bot names. */
.bot-name-card{background:var(--surface);border-radius:22px;overflow:hidden;margin-bottom:18px}
.bot-creator .bot-name-card .field{border:0;border-radius:0;background:transparent;margin:0;text-align:center;box-shadow:none}
.bot-creator .bot-name-card .bot-name{height:64px}
.bot-creator .bot-name-card .bot-title{height:52px;border-top:1px solid var(--line);font-size:16px;color:var(--muted)}
.bot-name-card .field:focus-visible{outline:2px solid var(--text);outline-offset:-3px}
.row-identity,.chat-identity .header-person{display:flex;flex-direction:row;align-items:center;gap:7px;min-width:0}
.row-identity{flex:1;overflow:hidden}.row-identity .row-name{flex:0 1 auto;min-width:0}
.bot-title-tag{display:inline-block;flex:0 0 auto;min-width:0;max-width:100px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;border-radius:6px;padding:3px 6px;background:var(--surface);color:var(--muted);font-size:11px;font-weight:500;line-height:1.3;letter-spacing:0}
.chat-identity .bot-title-tag{background:var(--surface);max-width:100px}.chat-identity .chat-name{min-width:0;flex:0 1 auto}
@media(max-width:360px){.chat-identity .bot-title-tag{max-width:70px}.row-identity{gap:5px}}

/* Keep controls inside the visible screen as the iOS keyboard opens/closes. */
.messenger{grid-template-rows:minmax(0,1fr)}
.conversation-header{flex-shrink:0}
@media(max-width:760px){
 #app.messenger{position:fixed;inset:auto 0 auto;top:var(--chat-top,0px);height:var(--chat-height,100dvh);min-height:0;width:100%}
 #app .conversation{min-height:0;overflow:hidden}
 #app .message-scroll{flex:1 1 0;min-height:0}
 #app .compose-area{flex:0 0 auto}
}
/* Hold a left swipe to peek at message times; vertical scrolling stays native. */
#message-feed{touch-action:pan-y pinch-zoom}
#message-feed>[data-timed-message]{position:relative;translate:calc(-1 * var(--time-drag,0px)) 0;transition:translate .18s ease-out}
.message-time{position:absolute;left:100%;bottom:12px;width:80px;padding-left:8px;font-size:11px;line-height:18px;color:var(--muted);white-space:nowrap;opacity:0;pointer-events:none}
#message-feed.revealing-times>[data-timed-message]{transition:none}
#message-feed.revealing-times .message-time{opacity:1}
@media(hover:hover){#message-feed>[data-timed-message]:hover .message-time{opacity:1;left:auto;right:0;bottom:100%;width:auto}}
@media(prefers-reduced-motion:reduce){#message-feed>[data-timed-message],.message-time{transition:none}}
#message-feed>.approval-card[data-timed-message]{overflow:visible}
