:root{color-scheme:dark;--bg:#313338;--panel:#2b2d31;--sidebar:#1e1f22;--line:#404249;--text:#f2f3f5;--muted:#adb3be;--accent:#40e0c3;--accent-deep:#098976;--accent-hover:#6af0d8;--accent-ink:#08332c;--green:#40e0c3}
*{box-sizing:border-box}body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;background:var(--bg);color:var(--text)}button,input,textarea{font:inherit}button,a,input,textarea{-webkit-tap-highlight-color:transparent}button{cursor:pointer}button:disabled{cursor:default;opacity:.45}a{color:#84f0da}button:focus-visible,a:focus-visible{outline:2px solid #84f0da;outline-offset:3px}input:focus-visible,textarea:focus-visible{outline:2px solid var(--accent);outline-offset:2px}[hidden]{display:none!important}
.auth-body{min-height:100vh;min-height:100dvh;display:grid;place-items:center;padding:26px 20px;background:radial-gradient(ellipse at top,#204c47 0%,#232428 52%,#17181b 100%)}.auth-card{width:min(100%,448px);background:#2b2d31;padding:32px;border:1px solid #434650;border-radius:16px;box-shadow:0 16px 50px #0006;text-align:center}.brand-mark,.server-icon{display:grid;place-items:center;background:var(--accent-deep);color:#fff;font-weight:800;border-radius:14px}.brand-mark{width:58px;height:58px;margin:0 auto 18px;font-size:28px}h1{margin:0;font-size:26px;letter-spacing:.2px}.muted{color:var(--muted);margin:9px 0 26px;font-size:14px}.auth-form{display:flex;flex-direction:column;text-align:left}.auth-form label{font-size:13px;color:#e0e3e9;font-weight:650;margin:16px 0 8px}.auth-form>label:first-of-type{margin-top:0}.auth-form input{width:100%;min-width:0;border:1px solid #464952;border-radius:7px;background:#1e1f22;padding:12px;color:var(--text);outline:none}.auth-form input:focus{border-color:var(--accent)}.auth-form .field-help{font-size:11px;font-weight:400;color:var(--muted);margin:7px 0 0;line-height:1.55}.id-input{position:relative}.id-input>span{position:absolute;top:12px;left:13px;color:#969eac}.id-input>input{padding-left:31px}.primary-btn{margin-top:22px;border:0;border-radius:7px;background:var(--accent-deep);color:white;padding:13px 16px;font-weight:700;cursor:pointer}.primary-btn:hover{background:#68ebd2}.switch{font-size:13px;color:var(--muted);margin:23px 0 0}.switch a{color:#8cebd9;text-decoration:none}.switch a:hover{text-decoration:underline}.tiny-note{font-size:11px;line-height:1.6;color:#969ca7;margin:24px 0 0}.notice{padding:12px;border-radius:7px;font-size:13px;margin:12px 0 18px;text-align:left;line-height:1.5}.notice.error{background:#4a2428;color:#ffb9c0}.notice.success{background:#173f2c;color:#a6f0bf}
.app-shell{height:100vh;height:100dvh;display:flex;overflow:hidden}.sidebar{width:270px;flex-shrink:0;background:var(--sidebar);display:flex;flex-direction:column;border-right:1px solid #15161b}.server-title{min-height:76px;padding:17px 18px;display:flex;align-items:center;gap:12px;border-bottom:1px solid #303238}.server-icon{width:40px;height:40px;flex-shrink:0;border-radius:13px;font-size:20px}.server-name{min-width:0;flex:1}.server-title strong{display:block;font-size:16px;letter-spacing:.1px}.server-title span{display:block;font-size:11px;color:var(--muted);margin-top:4px}.chat-navigation{overflow-y:auto;overscroll-behavior:contain;padding:0 8px 20px;flex:1}.sidebar-section{font-size:10px;letter-spacing:1px;font-weight:750;color:#a1a8b4;margin:26px 9px 10px}.section-with-action{display:flex;align-items:center;justify-content:space-between;margin-top:21px;margin-bottom:8px;min-height:30px}.add-chat-btn{display:grid;place-items:center;min-width:32px;min-height:32px;font-size:25px;line-height:1;background:#31353f;border:1px solid #464b59;border-radius:8px;color:#bdfff0}.add-chat-btn:hover{background:var(--accent-deep);border-color:var(--accent-deep);color:#fff}.channel-list{display:grid;gap:4px}.channel{width:100%;display:flex;align-items:center;gap:11px;padding:11px 10px;border:1px solid transparent;border-radius:8px;color:#c1c6d0;background:transparent;text-align:left}.channel:hover{background:#2a2c34;color:white}.channel.active{background:#353944;color:white;border-color:#4c5264}.channel-icon{width:33px;height:33px;display:grid;place-items:center;flex-shrink:0;font-size:15px;font-weight:650;border-radius:10px;background:#32353f;color:#aaf3e5}.channel-icon.family-symbol{font-size:25px;font-weight:400;background:transparent;color:#a9b0bf}.channel-icon.self-symbol{background:#27413d;color:#89d5be;font-size:20px}.channel.active .channel-icon:not(.self-symbol):not(.family-symbol){background:#187f73;color:#fff}.channel-copy{min-width:0;flex:1}.channel-copy strong{font-size:13px;font-weight:650;display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.channel-copy small{font-size:11px;color:#a7afbe;display:block;margin-top:4px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.channel.active .channel-copy small{color:#bdc5d6}.unread-dot{width:7px;height:7px;flex-shrink:0;background:#40e0c3;border-radius:50%}.sidebar-hint{margin:14px 11px 0;font-size:12px;line-height:1.6;color:#9099a8}.sidebar-bottom{margin-top:auto;background:#25272e;padding:15px 14px;display:flex;align-items:center;gap:10px;border-top:1px solid #32353f}.profile-avatar{width:34px;height:34px;flex-shrink:0;border-radius:50%;display:grid;place-items:center;background:#455247;color:#b6e3bd;font-weight:700}.user-label{min-width:0;flex:1;color:var(--text);text-decoration:none}.user-label:hover strong{color:#a2f4e3}.user-label strong{font-size:13px;display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.user-label span{font-size:11px;color:var(--muted);display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-top:4px}.logout-btn{background:transparent;border:0;border-radius:6px;color:#b5bac1;font-size:24px;cursor:pointer;padding:5px 8px}.logout-btn:hover{color:white;background:#373a45}
.chat-main{position:relative;min-width:0;flex:1;display:flex;flex-direction:column}.chat-header{min-height:76px;flex-shrink:0;border-bottom:1px solid #22242b;display:flex;align-items:center;gap:13px;padding:12px 24px;background:#303239;box-shadow:0 1px 0 #0001}.header-symbol{font-size:24px;color:#aaf3e5;background:#414757;width:38px;height:38px;flex-shrink:0;display:grid;place-items:center;border-radius:11px}.header-symbol.family-symbol{font-size:28px;background:transparent;color:#9ba5b6}.header-symbol.self-symbol{background:#2d4742;color:#89d5be}.header-copy{min-width:0;flex:1}.header-copy strong{display:block;font-size:15px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.header-copy p{font-size:11px;color:var(--muted);margin:5px 0 0;line-height:1.4;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.live-status{font-size:11px;color:var(--muted);display:flex;align-items:center;gap:6px;white-space:nowrap}.live-status>span:first-child{width:7px;height:7px;border-radius:50%;background:#9296a2;display:inline-block;flex-shrink:0}.live-status.connected>span:first-child{background:var(--green)}.icon-btn{border:0;background:transparent;color:#c1c8d5;font-size:25px;border-radius:8px;display:grid;place-items:center;width:36px;height:36px;flex-shrink:0}.icon-btn:hover{color:#fff;background:#404551}.sidebar-toggle,.sidebar-close,.header-new-chat{display:none}.sidebar-backdrop{display:none}
.messages{flex:1;overflow-y:auto;overscroll-behavior:contain;padding:26px max(24px,calc((100% - 900px)/2));display:flex;flex-direction:column;gap:0}.welcome{margin:auto 0 18px;padding:28px 0 24px;max-width:590px}.welcome-symbol{width:64px;height:64px;border-radius:20px;background:#404653;display:grid;place-items:center;font-size:31px;font-weight:600;margin-bottom:20px;color:#b5f4e8}.welcome.self-welcome .welcome-symbol{background:#2e4a43;color:#92dcc5}.welcome h2{font-size:26px;letter-spacing:-.5px;margin:0 0 10px;line-height:1.2;overflow-wrap:anywhere}.welcome p{font-size:14px;color:#b4bbc8;margin:0;line-height:1.65;max-width:480px}.welcome .privacy-label{margin-top:18px;display:inline-flex;padding:7px 10px;border-radius:6px;background:#2a4038;color:#a4dec4;font-size:11px;font-weight:550}.message{display:flex;gap:12px;padding:9px 0;border-radius:5px}.message:hover{background:#2e3035}.avatar{width:36px;height:36px;border-radius:12px;display:grid;place-items:center;background:linear-gradient(145deg,#6470c9,#8a68b6);font-size:14px;font-weight:700;flex-shrink:0}.message.mine .avatar{background:linear-gradient(145deg,#447f76,#627daf)}.message-content{min-width:0;flex:1}.message-meta{display:flex;align-items:baseline;gap:8px;flex-wrap:wrap;line-height:1.4}.message-meta strong{font-size:13px;overflow-wrap:anywhere}.message-meta strong.self-name{color:#9becdc}.message-meta .message-account{font-size:10px;color:#a1aab9}.message-meta time{font-size:10px;color:#929aaa;white-space:nowrap}.message-body{white-space:pre-wrap;overflow-wrap:anywhere;margin:4px 0 0;font-size:14px;line-height:1.6;color:#e0e3ea}.chat-state{margin:auto;max-width:440px;text-align:center;font-size:14px;color:var(--muted);line-height:1.6}.chat-state.error{color:#efb3bb}.chat-state .secondary-btn{margin-top:8px}.secondary-btn{border:1px solid #626a7d;background:#3d4351;color:#e4e9ff;border-radius:7px;padding:9px 14px;font-size:13px}.secondary-btn:hover{background:#4b5262}.chat-state a{display:inline-block;margin:8px;color:#a5f2e0}
.composer{position:relative;margin:0 24px 24px;background:#3d414c;border:1px solid #4b5261;border-radius:11px;padding:14px 60px 29px 16px;max-width:950px;width:calc(100% - 48px);align-self:center}.composer:focus-within{border-color:#37bfa9}.composer textarea{display:block;width:100%;resize:none;max-height:140px;min-height:25px;border:0;outline:0;background:transparent;color:var(--text);line-height:1.5;font-size:14px;scrollbar-width:thin}.composer textarea:focus-visible{outline:0}.composer textarea::placeholder{color:#a5adbc}.send-btn{position:absolute;right:12px;top:11px;border:0;background:var(--accent-deep);color:white;width:36px;height:36px;border-radius:8px;font-size:18px;cursor:pointer}.send-btn:hover:not(:disabled){background:#6af0d8}.composer-hint{position:absolute;bottom:8px;left:16px;font-size:10px;color:#a2aaba}.toast{position:absolute;bottom:112px;left:50%;transform:translateX(-50%);background:#4d303d;color:#ffe1e8;padding:12px 16px;border:1px solid #85596c;border-radius:9px;font-size:13px;line-height:1.5;opacity:0;pointer-events:none;transition:opacity .2s;max-width:min(90%,480px);z-index:5;box-shadow:0 6px 24px #0003}.toast.show{opacity:1}
.search-dialog{width:min(480px,calc(100vw - 32px));max-height:min(690px,calc(100dvh - 40px));border:1px solid #555d70;border-radius:17px;padding:26px;background:#2c303a;color:var(--text);box-shadow:0 24px 100px #0008;overflow:auto}.search-dialog::backdrop{background:#0d101bcc;backdrop-filter:blur(4px)}.dialog-heading{display:flex;gap:16px;align-items:flex-start;justify-content:space-between}.eyebrow{margin:0 0 9px;font-size:10px;letter-spacing:1.3px;color:#86f2dc;font-weight:750}.dialog-heading h2{margin:0;font-size:24px;letter-spacing:-.4px}.dialog-heading .icon-btn{margin:-8px -10px 0 0}.dialog-description{font-size:13px;color:#b2bbcb;line-height:1.65;margin:15px 0 22px}.search-label{display:block;font-size:12px;font-weight:650;color:#d8deec;margin-bottom:9px}.search-field{display:flex;align-items:center;gap:10px;border:1px solid #667397;border-radius:9px;padding:0 12px;background:#21252e}.search-field:focus-within{border-color:#89ecd8;box-shadow:0 0 0 2px #40e0c322}.search-field>span{font-size:24px;color:#98ecdd}.search-field input{width:100%;min-width:0;border:0;padding:13px 0;background:transparent;color:#f4f5fb;outline:none;font-size:14px}.search-field input:focus-visible{outline:0}.search-field input::placeholder{color:#99a3b6}.search-status{font-size:12px;color:#a7b1c4;margin:16px 0 9px;line-height:1.6;min-height:19px}.search-status.error{color:#ffc1cc}.search-results{display:grid;gap:6px;max-height:285px;overflow-y:auto;padding:3px;margin:-3px}.search-result{width:100%;display:flex;align-items:center;gap:12px;padding:12px;border:1px solid #454e60;border-radius:10px;background:#343a46;color:#eef1fa;text-align:left}.search-result:hover{background:#404963;border-color:#379f90}.search-result:disabled{opacity:.6}.result-avatar{width:40px;height:40px;border-radius:12px;background:#327f76;display:grid;place-items:center;flex-shrink:0;color:#fff;font-weight:650}.result-copy{min-width:0;flex:1}.result-copy strong{font-size:14px;display:block;overflow-wrap:anywhere}.result-copy small{display:block;margin-top:5px;font-size:12px;color:#bddbd4;overflow-wrap:anywhere}.result-action{font-size:12px;color:#a0f7e2;flex-shrink:0}.dialog-footnote{border-top:1px solid #485061;margin:22px 0 0;padding-top:15px;color:#99a5bb;font-size:11px;line-height:1.65}
@media(min-width:701px){.sidebar-backdrop{display:none!important}}
@media(max-width:900px) and (min-width:701px){.sidebar{width:240px}.chat-header{padding:12px 18px}.messages{padding:22px 20px}.live-status{font-size:10px}}
@media(max-width:700px){.sidebar{position:fixed;left:0;top:0;bottom:0;width:min(290px,86vw);z-index:21;transform:translateX(-100%);transition:transform .18s ease;box-shadow:12px 0 40px #0005;visibility:hidden}.sidebar.open{transform:translateX(0);visibility:visible}.sidebar-close,.sidebar-toggle,.header-new-chat{display:grid}.sidebar-close{width:28px;margin-right:-6px}.sidebar-backdrop:not([hidden]){display:block;position:fixed;inset:0;border:0;background:#080b16a8;z-index:20}.server-title{min-height:72px}.chat-header{padding:12px 12px;min-height:72px;gap:9px}.header-symbol{width:33px;height:33px;font-size:19px;border-radius:9px}.header-symbol.family-symbol{font-size:25px}.header-copy strong{font-size:14px}.header-copy p{font-size:10px;max-width:45vw}.live-status{font-size:0;gap:0}.live-status>span:first-child{width:7px;height:7px}.header-new-chat{font-size:26px;width:30px}.sidebar-toggle{width:30px;font-size:22px}.messages{padding:20px 16px}.welcome h2{font-size:23px}.welcome p{font-size:13px}.composer{width:calc(100% - 24px);margin:0 12px 12px;padding:13px 56px 27px 13px}.composer textarea{font-size:16px}.composer-hint{font-size:9px;left:13px}.toast{bottom:102px}.message-meta{gap:5px}.message-meta .message-account{max-width:100%;overflow-wrap:anywhere}.search-dialog{padding:22px;width:calc(100vw - 24px)}.auth-card{padding:28px 24px}.search-field input{font-size:16px}}
@media(prefers-reduced-motion:reduce){.sidebar,.toast{transition:none}}

.chat-notices{padding:10px 24px 0}.chat-notices .notice{margin:0 0 8px}

/* GTchat account settings — icon between the account name and sign out. */
.settings-btn{flex:0 0 34px;width:34px;height:34px;display:grid;place-items:center;background:transparent;border:0;border-radius:8px;color:#b8c0ce;padding:0}
.settings-btn:hover,.settings-btn:focus-visible{color:#fff;background:#414653}
.sidebar-bottom>form{flex-shrink:0}
.sidebar-bottom{gap:7px}
.logout-btn{padding:5px 6px}
.settings-dialog{width:min(520px,calc(100vw - 28px));max-height:min(760px,calc(100dvh - 28px));border:1px solid #555e73;border-radius:18px;padding:26px;background:#2c303a;color:var(--text);box-shadow:0 24px 100px #000a;overflow-y:auto}
.settings-dialog::backdrop{background:#0d101bcc;backdrop-filter:blur(4px)}
.settings-dialog .dialog-heading .icon-btn{margin:-8px -9px 0 0}
.settings-description{margin:10px 0 15px;font-size:13px;color:#c3cbda}
.settings-description span{color:#8cebd9}
.settings-profile-link{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:20px;border:1px solid #49546d;border-radius:10px;padding:11px 13px;color:#cdd5ff;background:#353a47;text-decoration:none;font-size:12px;font-weight:600}
.settings-profile-link:hover{background:#40485c;color:white}
.settings-list{display:grid;gap:9px}
.settings-panel{background:#323744;border:1px solid #4b5365;border-radius:11px;overflow:hidden}
.settings-panel[open]{border-color:#677596;background:#313743}
.settings-panel summary{list-style:none;display:flex;align-items:center;gap:13px;min-height:76px;padding:14px;cursor:pointer}
.settings-panel summary::-webkit-details-marker{display:none}
.settings-panel summary:hover{background:#3c4352}
.setting-symbol{flex-shrink:0;width:37px;height:37px;display:grid;place-items:center;border-radius:11px;background:#25574f;color:#b1f2e5;font-weight:800;font-size:19px}
.setting-summary{min-width:0;flex:1}
.setting-summary strong{display:block;font-size:13px;color:#edf0fa}
.setting-summary small{display:block;font-size:11px;margin-top:5px;line-height:1.35;color:#a6beb8}
.settings-chevron{font-size:18px;color:#abb8cb;transition:transform .15s ease}
.settings-panel[open] .settings-chevron{transform:rotate(180deg)}
.danger-panel .setting-symbol{background:#643d46;color:#ffd0d8}
.settings-form{display:flex;flex-direction:column;gap:0;border-top:1px solid #4c5669;padding:6px 16px 17px}
.settings-form>label:not(.settings-confirm){font-size:12px;color:#d9e1ef;font-weight:600;margin:14px 0 7px}
.settings-form>input{width:100%;background:#202630;border:1px solid #5b6782;padding:11px 12px;border-radius:8px;color:#f7f7ff;min-width:0;font-size:14px}
.settings-form>input:focus{outline:none;border-color:#65e3cd;box-shadow:0 0 0 2px #40e0c322}
.settings-help{margin:12px 0 0;font-size:12px;line-height:1.6;color:#b4becc}
.settings-primary,.settings-danger{margin-top:17px;width:100%;border:1px solid transparent;border-radius:9px;padding:12px 14px;color:#fff;background:var(--accent-deep);font-weight:700;font-size:13px}
.settings-primary:hover:not(:disabled){background:#68ebd2}
.settings-danger{background:#8d3d4a;border-color:#a55664}
.settings-danger:hover:not(:disabled){background:#aa4758}
.settings-chat-label{margin:14px 0 0;color:#cad2e2;font-size:12px;line-height:1.45}
.settings-chat-label strong{color:#fff}
.settings-confirm{display:flex;align-items:flex-start;gap:10px;margin-top:18px;font-size:12px;line-height:1.5;color:#cbd3e1;cursor:pointer}
.settings-confirm input{width:17px;height:17px;flex:0 0 auto;margin:1px 0 0;accent-color:#40e0c3}
.settings-warning{margin:13px 0 2px;padding:12px;background:#4a303b;border:1px solid #714452;border-radius:9px;font-size:12px;line-height:1.6;color:#ffd7df}
.settings-feedback{font-size:12px;line-height:1.5;margin:0}
.settings-feedback:not(:empty){margin-top:12px;padding:10px;border-radius:8px}
.settings-feedback.error{color:#ffc5cf;background:#4e313b}
.settings-feedback.success{color:#b0f3c7;background:#1b4235}
@media(max-width:700px){.settings-dialog{padding:22px;width:calc(100vw - 24px)}.settings-form>input{font-size:16px}.sidebar-bottom{gap:7px}}
@media(prefers-reduced-motion:reduce){.settings-chevron{transition:none}}

/* GTchat: balanced icon geometry and turquoise-green interactive elements. */
:root{--button-color:var(--accent);--button-hover:var(--accent-hover)}
a,.switch a,.settings-profile-link{color:#96efd9}
button:focus-visible,a:focus-visible{outline-color:var(--accent);outline-offset:3px}
/* Both footer controls have identical boxes and optical alignment. */
.sidebar-bottom{align-items:center;gap:7px}
.sidebar-bottom>form{display:grid;place-items:center;margin:0;padding:0;flex:0 0 36px}
.settings-btn,.logout-btn{box-sizing:border-box;flex:0 0 36px;width:36px;height:36px;min-width:36px;min-height:36px;display:grid;place-items:center;margin:0;padding:0;border:1px solid #32665e;border-radius:9px;background:#204840;color:#90f3df;line-height:1;font-size:22px;appearance:none;vertical-align:middle;transition:background-color .15s,color .15s,border-color .15s}
.settings-btn .settings-gear{width:22px;height:22px;display:block;flex-shrink:0;overflow:visible;transform:none}
.settings-btn:hover,.settings-btn:focus-visible,.logout-btn:hover,.logout-btn:focus-visible{background:var(--button-color);color:var(--accent-ink);border-color:var(--button-color)}
.settings-btn:active,.logout-btn:active{background:var(--accent-deep);color:#fff}
/* Consistent, bright teal action surfaces across login, chat, and settings. */
.primary-btn,.send-btn,.add-chat-btn,.secondary-btn,.settings-primary,.settings-danger{
  background:var(--button-color);color:var(--accent-ink);border-color:var(--button-color);font-weight:700;
  transition:background-color .15s,border-color .15s,transform .15s;
}
.primary-btn:hover:not(:disabled),.send-btn:hover:not(:disabled),.add-chat-btn:hover:not(:disabled),.secondary-btn:hover:not(:disabled),.settings-primary:hover:not(:disabled),.settings-danger:hover:not(:disabled){background:var(--button-hover);border-color:var(--button-hover);color:var(--accent-ink)}
.primary-btn:active:not(:disabled),.send-btn:active:not(:disabled),.add-chat-btn:active:not(:disabled),.secondary-btn:active:not(:disabled),.settings-primary:active:not(:disabled),.settings-danger:active:not(:disabled){transform:translateY(1px)}
.add-chat-btn{width:34px;height:34px;min-width:34px;min-height:34px;line-height:1;font-size:25px}
.send-btn{display:grid;place-items:center;line-height:1}
/* Destructive actions retain a small red caution marker, with teal buttons. */
.settings-danger{box-shadow:inset 4px 0 #b45f6a}
/* Pale teal icon-only surfaces and selection accents. */
.icon-btn{color:#a2f0df}
.icon-btn:hover{background:#20594f;color:#b9fff1}
.header-new-chat{background:var(--button-color);color:var(--accent-ink)}
.header-new-chat:hover{background:var(--button-hover);color:var(--accent-ink)}
.channel.active{background:#21453f;border-color:#317b6d}
.channel.active .channel-icon:not(.self-symbol):not(.family-symbol){background:#168a78;color:#fff}
.composer:focus-within{border-color:#4fcbb3}
.settings-dialog,.search-dialog{border-color:#356c63}
.settings-panel[open]{border-color:#40aa95}
.settings-profile-link{border-color:#397969;background:#224f46}
.settings-profile-link:hover{background:#2a695d;color:#d7fff7}
.setting-symbol{background:#235a4f;color:#b6f8e8}
.settings-confirm input{accent-color:var(--accent)}
.search-result{border-color:#3a695f}
.search-result:hover{background:#295950;border-color:#4cbaa6}
.result-avatar{background:#227e70}
.result-action{color:#aaf1e1}
@media (prefers-reduced-motion:reduce){.settings-btn,.logout-btn,.primary-btn,.send-btn,.add-chat-btn,.secondary-btn,.settings-primary,.settings-danger{transition:none}}

/* Recovery links share the turquoise GTchat theme. */
.settings-inner-link{color:#8ef6db;text-decoration:underline;text-underline-offset:2px}
.auth-form input[type=email]{font-size:16px}

/* Offline recovery-code page */
.recovery-card { max-width: 480px; }
.backup-code { background: var(--surface, #122c2e); border: 1px solid #1f9e8b; border-radius: 14px; padding: 17px 10px; text-align: center; margin: 20px 0 12px; }
.backup-code code { display: block; user-select: all; overflow-wrap: anywhere; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: clamp(13px, 4vw, 19px); line-height: 1.6; font-weight: 700; letter-spacing: .5px; }
.button-link { display: block; text-align: center; text-decoration: none; margin-top: 18px; }
.profile-recovery { border-top: 1px solid rgba(121, 155, 154, .3); padding-top: 17px; margin-top: 25px; }
.profile-recovery h2 { font-size: 19px; margin-bottom: 8px; }


/* GTchat iPhone layout refresh — all changes in this block are scoped to phones.
   Desktop appearance and chat behaviour are left intact. */
@media (max-width: 700px) {
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  body.chat-body { overflow: hidden; }
  .app-shell {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
  }
  .chat-main { min-height: 0; }

  /* The compact title bar should not consume valuable conversation space. */
  .chat-header {
    min-height: 60px;
    height: 60px;
    padding: 7px 12px;
    gap: 9px;
  }
  .sidebar-toggle {
    width: 38px;
    height: 42px;
    font-size: 21px;
    margin-left: -5px;
  }
  .header-symbol {
    width: 30px;
    height: 30px;
    font-size: 18px;
    border-radius: 9px;
  }
  .header-symbol.family-symbol { font-size: 23px; }
  .header-copy strong { font-size: 14px; line-height: 1.2; }
  .header-copy p {
    max-width: none;
    font-size: 10px;
    margin-top: 3px;
  }
  .live-status { flex: 0 0 7px; }
  .live-status>span:first-child { width: 7px; height: 7px; }
  .header-new-chat {
    width: 38px;
    height: 38px;
    font-size: 25px;
    border-radius: 10px;
    flex-shrink: 0;
  }

  /* Chat body: more natural empty-chat state and readable message list. */
  .messages {
    min-height: 0;
    padding: 15px 14px;
    -webkit-overflow-scrolling: touch;
  }
  .welcome {
    margin: clamp(24px, 7vh, 60px) 0 20px;
    padding: 0;
    max-width: 100%;
  }
  .welcome-symbol {
    width: 52px;
    height: 52px;
    font-size: 26px;
    border-radius: 15px;
    margin-bottom: 18px;
  }
  .welcome h2 {
    font-size: clamp(20px, 5.6vw, 24px);
    line-height: 1.25;
    letter-spacing: -.35px;
    margin-bottom: 9px;
  }
  .welcome p { font-size: 13px; line-height: 1.55; }
  .message { gap: 10px; padding: 8px 0; }
  .avatar { width: 32px; height: 32px; border-radius: 10px; }
  .message-body { font-size: 14px; line-height: 1.52; }

  /* One-line message composer, comfortable send target, and no desktop
     Enter/Shift+Enter hint on a touch keyboard. */
  .composer {
    flex-shrink: 0;
    width: calc(100% - 24px);
    max-width: none;
    margin: 0 12px calc(10px + env(safe-area-inset-bottom, 0px));
    padding: 10px 53px 10px 13px;
    min-height: 54px;
    border-radius: 14px;
    display: flex;
    align-items: center;
  }
  .composer textarea {
    min-height: 24px;
    max-height: min(130px, 30dvh);
    font-size: 16px;
    line-height: 1.45;
  }
  .composer-hint { display: none; }
  .send-btn {
    width: 38px;
    height: 38px;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    border-radius: 11px;
  }
  .send-btn:active:not(:disabled) { transform: translateY(-50%); }
  .toast { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }

  /* Full-height sliding menu, with scrollable channels and a footer above
     the iPhone home indicator rather than under it. */
  .sidebar {
    width: min(306px, 89vw);
    max-width: 100%;
    height: 100%;
    min-height: 0;
    box-shadow: 10px 0 36px #0007;
  }
  .server-title { min-height: 67px; padding: 11px 14px; gap: 11px; }
  .server-icon { width: 40px; height: 40px; border-radius: 12px; }
  .server-title strong { font-size: 17px; }
  .server-title span { font-size: 11px; }
  .sidebar-close { width: 38px; height: 38px; margin-right: -6px; }
  .chat-navigation {
    min-height: 0;
    padding: 0 10px 16px;
    -webkit-overflow-scrolling: touch;
  }
  .sidebar-section { margin: 22px 8px 10px; font-size: 10px; }
  .section-with-action { min-height: 36px; margin-top: 18px; margin-bottom: 5px; }
  .channel { gap: 10px; padding: 10px 9px; min-height: 54px; }
  .channel-icon { width: 32px; height: 32px; }
  .channel-copy strong { font-size: 13px; }
  .channel-copy small { font-size: 11px; }
  .add-chat-btn { width: 38px; height: 38px; min-width: 38px; min-height: 38px; font-size: 25px; }
  .sidebar-hint { margin: 12px 8px 0; font-size: 12px; line-height: 1.5; }
  .sidebar-bottom {
    flex-shrink: 0;
    min-height: 70px;
    padding: 11px 11px calc(11px + env(safe-area-inset-bottom, 0px));
    gap: 8px;
  }
  .profile-avatar { width: 36px; height: 36px; }
  .user-label strong { font-size: 13px; }
  .user-label span { font-size: 11px; }
  .settings-btn, .logout-btn, .sidebar-bottom>form {
    width: 38px; height: 38px; min-width: 38px; min-height: 38px;
    flex-basis: 38px;
  }

  /* Settings/search remain usable on small displays and with the keyboard. */
  .search-dialog, .settings-dialog {
    width: calc(100% - 24px);
    max-width: 520px;
    max-height: calc(100dvh - 30px - env(safe-area-inset-bottom, 0px));
    padding: 19px 17px;
    border-radius: 16px;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
  .dialog-heading h2 { font-size: 21px; }
  .settings-panel summary { min-height: 62px; padding: 11px; }
  .settings-description, .dialog-description { line-height: 1.5; }
  .settings-form { padding-left: 12px; padding-right: 12px; }
}

@media (max-width: 360px) {
  .chat-header { gap: 6px; padding-left: 8px; padding-right: 8px; }
  .header-symbol { width: 28px; height: 28px; }
  .header-new-chat { width: 36px; height: 36px; }
  .sidebar { width: min(290px, 92vw); }
  .sidebar-bottom { gap: 5px; padding-left: 9px; padding-right: 9px; }
  .settings-btn, .logout-btn, .sidebar-bottom>form {
    width: 36px; height: 36px; min-width: 36px; min-height: 36px; flex-basis: 36px;
  }
}

@media (max-width: 700px) and (max-height: 520px) {
  .welcome { margin-top: 14px; }
  .welcome-symbol { width: 42px; height: 42px; margin-bottom: 10px; }
  .welcome h2 { font-size: 19px; }
  .welcome p { font-size: 12px; }
  .chat-header { min-height: 54px; height: 54px; }
}


/* Mobile icon alignment polish for iPhone/WebView */
.icon-svg{width:20px;height:20px;display:block;overflow:visible;stroke:currentColor;stroke-width:2.15;stroke-linecap:round;stroke-linejoin:round;fill:none;pointer-events:none}
.plus-svg{width:21px;height:21px}
.send-svg{width:20px;height:20px;transform:translateX(1px)}
.logout-svg{width:20px;height:20px}
.add-chat-btn,.send-btn,.logout-btn,.header-new-chat{display:grid;place-items:center;padding:0}
.add-chat-btn .icon-svg,.send-btn .icon-svg,.logout-btn .icon-svg,.header-new-chat .icon-svg{margin:0 auto}
.sidebar-bottom>form{display:grid;place-items:center}

@media (max-width: 700px) {
  .chat-header {
    grid-template-columns:auto auto 1fr auto;
  }
  .header-new-chat { display:none !important; }
  .section-with-action {
    align-items:center;
  }
  .section-with-action > span {
    display:flex;
    align-items:center;
    min-height:38px;
  }
  .add-chat-btn {
    width:40px;
    height:40px;
    min-width:40px;
    min-height:40px;
    border-radius:12px;
  }
  .add-chat-btn .plus-svg {
    width:22px;
    height:22px;
  }
  .sidebar-bottom {
    align-items:center;
  }
  .logout-btn {
    width:38px;
    height:38px;
    min-width:38px;
    min-height:38px;
    border-radius:10px;
  }
  .logout-btn .logout-svg {
    width:20px;
    height:20px;
  }
  .composer {
    padding-right:56px;
  }
  .send-btn {
    width:40px;
    height:40px;
    right:8px;
    border-radius:12px;
  }
  .send-btn .send-svg {
    width:20px;
    height:20px;
    transform:none;
  }
}

/* GTchat voice & video calls. Does not alter regular message layout. */
.call-actions {display:flex;align-items:center;gap:6px;flex-shrink:0}
.call-actions[hidden],.call-overlay[hidden],.call-control[hidden],.call-videos[hidden]{display:none!important}
.call-icon-button {display:grid;place-items:center;width:38px;height:38px;flex:0 0 38px;border-radius:11px;border:1px solid #37786b;background:#24544a;color:#a6fbea;cursor:pointer;padding:0}
.call-icon-button:hover {background:#36ddc0;color:#102c29}
.call-icon-button:disabled{opacity:.45;cursor:not-allowed}
.call-icon-button svg {width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.call-overlay {position:fixed;inset:0;background:rgba(8,13,20,.86);z-index:110;display:flex;align-items:center;justify-content:center;padding:18px;box-sizing:border-box}
.call-card {position:relative;width:min(100%,460px);max-height:calc(100dvh - 36px);overflow-y:auto;display:flex;flex-direction:column;align-items:center;text-align:center;gap:12px;border:1px solid #35665d;border-radius:22px;background:#252a30;box-shadow:0 18px 70px #0009;padding:25px 18px 23px;color:#f5faf9}
.call-top {display:flex;align-items:center;gap:9px;font-size:12px;color:#aeb6c0;font-weight:650;align-self:flex-start}
.call-mark {background:#0d8978;color:white;display:grid;place-items:center;border-radius:8px;width:30px;height:30px;font-size:12px}
.call-peer-avatar {display:grid;place-items:center;background:#225950;border-radius:50%;width:76px;height:76px;color:#b6fff0;font-weight:750;font-size:32px;margin-top:10px}
.call-card h2 {font-size:23px;line-height:1.2;margin:0;overflow-wrap:anywhere}
.call-card #call-state {color:#a8b7c0;min-height:20px;margin:0 0 4px;font-size:14px}
.call-videos {position:relative;width:100%;height:min(52vh,340px);min-height:180px;border-radius:15px;background:#121b20;overflow:hidden}
#call-remote-video{width:100%;height:100%;display:block;object-fit:cover}
#call-local-video{position:absolute;right:10px;bottom:10px;width:27%;height:35%;object-fit:cover;border:2px solid #91f5de;border-radius:10px;background:#24312e;transform:scaleX(-1)}
.call-controls{display:flex;flex-wrap:wrap;justify-content:center;gap:10px;width:100%}
.call-control {background:#314a48;border:1px solid #45786e;color:#d5f9f0;min-width:92px;min-height:45px;padding:10px 14px;border-radius:11px;font-weight:700;cursor:pointer}
.call-control:hover{background:#3d6a5e}
.call-control.call-accept{background:#35dcc2;border-color:#35dcc2;color:#103a33}
.call-control.call-hangup{background:#c84059;border-color:#c84059;color:white}
.call-control.is-off{background:#57515a;color:#f6c9cd;border-color:#77616a}
.call-hint {font-size:11px;color:#92a2ad;line-height:1.5;max-width:330px;margin:4px auto 0}
@media(max-width:700px){
 .chat-header{gap:7px}
 .header-copy p{max-width:36vw}
 .call-actions{gap:4px}
 .call-icon-button{width:34px;height:34px;flex-basis:34px;border-radius:9px}
 .call-icon-button svg{width:18px;height:18px}
 .call-overlay{padding:10px;padding-bottom:calc(10px + env(safe-area-inset-bottom,0px));}
 .call-card{padding:18px 12px;border-radius:18px;max-height:calc(100dvh - 20px - env(safe-area-inset-bottom,0px))}
 .call-peer-avatar{width:65px;height:65px;font-size:28px}
 .call-videos{height:min(44dvh,310px)}
 .call-controls{gap:7px}
 .call-control{min-width:80px;min-height:44px;padding:9px}
}
@media(max-width:360px){.call-icon-button{width:31px;height:31px;flex-basis:31px}}

/* Photo messages, aligned with the original turquoise design. */
/* The actual file input receives the user gesture: required by some iOS WKWebView versions. */
.photo-file-input{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer;font-size:16px;z-index:2}
.photo-file-input:disabled{cursor:default}
.composer{padding-left:58px}
.photo-btn{position:absolute;left:9px;top:50%;transform:translateY(-50%);width:38px;height:38px;
 border:0;border-radius:10px;background:transparent;color:#8cebd5;display:grid;place-items:center;cursor:pointer}
.photo-btn:not(.is-disabled):hover,.photo-btn:focus-within{background:#22584e;color:#c5ffef}
.photo-btn.is-disabled{opacity:.4;cursor:default}
.photo-btn svg{width:22px;height:22px;display:block}
.message-photo-link{display:block;width:fit-content;max-width:min(320px,100%);margin:7px 0 1px;border-radius:12px;overflow:hidden;border:1px solid #48565c}
.message-photo-link img{display:block;width:auto;height:auto;max-height:300px;max-width:100%;object-fit:contain;background:#293238}
.language-select{width:100%;min-height:42px;border:1px solid #506b69;border-radius:9px;
 background:#303641;color:#f2f8f7;padding:9px 11px;font-size:15px}
.language-select:focus-visible{outline:2px solid #40d8bf;outline-offset:2px}
.settings-language-card{padding:13px 14px 12px;border:1px solid #3f5051;border-radius:12px;
 background:#292e34;display:grid;gap:8px}
.settings-language-card label{color:#d8e7e4;font-size:13px;font-weight:650}
.language-auth-switch{margin:17px 0 2px;display:flex;align-items:center;gap:12px}
.language-auth-switch label{white-space:nowrap;color:#b3bfc4;font-size:12px}
.language-auth-switch .language-select{width:auto;flex:1}
@media(max-width:700px){.composer{padding-left:53px}.photo-btn{left:7px;width:38px;height:38px}
 .message-photo-link{max-width:min(270px,100%)}.message-photo-link img{max-height:250px}}


/* Photo preview: GTchat dark/teal modal shared by Safari and iOS app. */
.photo-btn{overflow:hidden}
.photo-preview-dialog{width:min(490px,calc(100vw - 24px));max-height:calc(100dvh - 26px);overflow-y:auto;
 border:1px solid #3b7069;border-radius:18px;background:#292f38;color:#f5f7fa;padding:22px;
 box-shadow:0 24px 80px #000a}
.photo-preview-dialog::backdrop{background:#0c101cda;backdrop-filter:blur(5px)}
.photo-preview-destination{font-size:13px;color:#b9c8cc;margin:12px 0}
.photo-preview-frame{display:flex;align-items:center;justify-content:center;min-height:160px;
 max-height:min(48dvh,390px);overflow:hidden;background:#1c242b;border:1px solid #44575b;border-radius:12px}
.photo-preview-frame img{display:block;max-width:100%;max-height:min(46dvh,380px);height:auto;width:auto;object-fit:contain}
.photo-preview-filename{overflow-wrap:anywhere;color:#a1afb9;font-size:12px;margin:10px 0 0}
.photo-preview-status{font-size:12px;min-height:17px;color:#b8dcd4;margin:10px 0}
.photo-preview-status.error{color:#ffb5bf}
.photo-preview-actions{display:flex;gap:10px;margin-top:13px}
.photo-preview-actions button{flex:1;min-height:44px;border-radius:10px;padding:10px 12px;font-size:14px}
.photo-preview-actions button:disabled{opacity:.55;cursor:progress}
@media(max-width:700px){.photo-preview-dialog{padding:16px;border-radius:16px}.photo-preview-frame{max-height:45dvh}
 .photo-preview-frame img{max-height:43dvh}}

/* GTchat iPhone/iPad fix (2026-10): prevent Safari and WKWebView automatic
   magnification when an editable control receives focus. iOS auto-zooms
   controls whose computed font size is below 16 CSS pixels. Keep pinch zoom
   enabled for accessibility rather than using maximum-scale=1. */
@media screen and (max-width: 1024px) {
  input[type="text"],
  input[type="password"],
  input[type="email"],
  input[type="search"],
  input[type="url"],
  input[type="tel"],
  input[type="number"],
  input:not([type]),
  textarea,
  select {
    font-size: 17px !important;
  }
}

/* Invite-only groups: keep the original GTchat dark/turquoise appearance. */
[hidden]{display:none !important}
.new-chat-tabs{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:20px 0 8px}
.new-chat-tab{border:1px solid #45675f;color:#b9e8df;background:#293d3a;border-radius:10px;min-height:42px;padding:9px 6px;font-size:13px;font-weight:650}
.new-chat-tab.active{color:#102722;background:#54d9be;border-color:#54d9be}
.group-field{display:block;width:100%;box-sizing:border-box;resize:vertical;margin:0 0 15px;padding:12px 13px;border:1px solid #667397;border-radius:9px;background:#21252e;color:#f4f5fb;outline:none;font:inherit;font-size:16px}
.group-field:focus{border-color:#70dfc8}
.group-helper{font-size:12px;color:#a6b5b9;line-height:1.5;margin:5px 0 15px}
.group-submit{width:100%}
.channel-icon.group-symbol{background:#245d53;color:#b1ffea}
@media(max-width:700px){.group-field,.new-chat-tab{font-size:17px}}
