/* Scoped full-viewport Protocol and saved friends. */
body:has(#protocol-screen){overflow:hidden!important}
#protocol-screen,#protocol-screen *{box-sizing:border-box}
#protocol-screen{position:fixed;inset:0;z-index:12000;display:grid;grid-template-rows:clamp(50px,12dvh,76px) minmax(0,1fr) clamp(62px,18dvh,112px);gap:0;padding:max(0px,var(--safe-top,env(safe-area-inset-top,0px))) max(4px,var(--safe-right,env(safe-area-inset-right,0px))) max(4px,var(--safe-bottom,env(safe-area-inset-bottom,0px))) max(4px,var(--safe-left,env(safe-area-inset-left,0px)));overflow:hidden;background:#06131f;color:#edf6fc;font-family:'Arial Narrow','Roboto Condensed',Arial,Helvetica,sans-serif;font-size:clamp(12px,3dvh,18px);isolation:isolate}
#protocol-screen:before{content:'';position:absolute;inset:0;z-index:-2;background:url('/assets/protocol-hero-v1.png') center 40%/cover no-repeat}
#protocol-screen:after{content:'';position:absolute;inset:0;z-index:-1;pointer-events:none;background:linear-gradient(180deg,#04101b30 10%,transparent 45%,#020c1c99 85%)}
#protocol-screen button{font:inherit;color:inherit;cursor:pointer;touch-action:manipulation;border-radius:0;min-width:0;margin:0;box-shadow:none;letter-spacing:0;transition:filter .12s,transform .12s}
#protocol-screen button:hover{filter:brightness(1.17)}
#protocol-screen button:active{transform:translateY(1px);filter:brightness(.92)}
#protocol-screen button:focus-visible{outline:2px solid #fff2a7;outline-offset:-4px}
#protocol-screen svg{width:1.7em;height:1.7em;flex:0 0 auto;filter:drop-shadow(0 1px 2px #0008)}
#protocol-screen .protocol-header{position:relative;display:grid;grid-template-columns:1fr auto 1fr;align-items:center;padding:2px clamp(5px,1vw,20px);gap:8px;background:linear-gradient(180deg,#16384df5,#041320f5 82%,#304d5e);border-bottom:2px solid #a18a4c;box-shadow:0 3px 10px #0008;z-index:2}
#protocol-screen .protocol-back{justify-self:start;display:grid;place-items:center;width:clamp(44px,6vw,64px);height:90%;padding:0;border:5px solid transparent;border-image:url('/assets/reference-ui/frame-silver-v1.svg') 22 / 5px / 0 stretch;background:linear-gradient(#234a65,#071a2a)}
#protocol-screen .protocol-title{display:flex;align-items:center;justify-content:center;gap:5px;height:100%;position:relative}
#protocol-screen h1{margin:0;font-size:clamp(22px,6.2dvh,43px);font-weight:900;letter-spacing:.025em;line-height:1;text-shadow:0 2px #10293f,0 3px 6px #000}
#protocol-screen .protocol-emblem{height:95%;color:#ffe07d;display:grid;place-items:center;background:linear-gradient(#1265c0 50%,#f2c541 50%);clip-path:polygon(50% 0,98% 15%,90% 72%,50% 100%,10% 72%,2% 15%);padding:1px 3px;aspect-ratio:.8}
#protocol-screen .protocol-emblem svg{width:100%;height:90%}
#protocol-screen .protocol-title-wing{position:absolute;width:30%;height:58%;top:49%;left:-28%;background:linear-gradient(#0b75d7 50%,#f6d450 50%);clip-path:polygon(0 0,100% 25%,100% 100%,15% 70%);filter:drop-shadow(0 2px 2px #0009)}
#protocol-screen .protocol-title-wing:last-child{left:auto;right:-28%;transform:scaleX(-1)}
#protocol-screen .protocol-wallet{justify-self:end;display:flex;gap:4px;align-items:center;max-width:100%;font-size:clamp(10px,2.7dvh,17px);font-weight:700}
#protocol-screen .protocol-wallet>span{display:flex;align-items:center;gap:4px;padding:3px 6px;border:1px solid #62869d;border-radius:3px;background:#03121eea;white-space:nowrap}
#protocol-screen .protocol-wallet img{width:1.2em;height:1.2em;object-fit:contain}
#protocol-screen .protocol-wallet .cash-hud>span{background:#168744;border:1px solid #8fe99e;border-radius:3px;padding:0 3px;color:white}
#protocol-screen .protocol-hero{min-height:0;display:grid;grid-template-rows:minmax(0,1fr) auto;padding:clamp(8px,2.5dvh,28px) clamp(14px,5.6vw,110px) clamp(10px,3dvh,28px);gap:clamp(6px,2dvh,20px)}
#protocol-screen .protocol-information{align-self:center;display:flex;align-items:center;gap:clamp(10px,2vw,24px);margin-left:16%;width:57%;max-width:760px;padding:clamp(10px,3.1dvh,26px) clamp(10px,2vw,26px);background:linear-gradient(115deg,#061827ed,#123a55d9);border:1px solid #91b0bc;border-left:3px solid #c5a75c;box-shadow:inset 0 0 0 3px #08182544,0 8px 24px #0005;clip-path:polygon(2% 0,98% 0,100% 8%,100% 92%,98% 100%,2% 100%,0 92%,0 8%)}
#protocol-screen .protocol-group-shield{color:#e0e6e2;border:2px solid #e3cc87;background:linear-gradient(135deg,#1e3744,#07121b);clip-path:polygon(50% 0,100% 12%,95% 75%,50% 100%,5% 75%,0 12%);padding:12px 6px;flex:0 0 clamp(48px,11dvh,90px)}
#protocol-screen .protocol-group-shield svg{width:100%;height:auto}
#protocol-screen .protocol-kicker{display:block;color:#e8c872;font-size:clamp(8px,1.9dvh,12px);font-weight:800;letter-spacing:.16em;margin:0 0 4px}
#protocol-screen .protocol-information h2{font-size:clamp(17px,4.8dvh,30px);line-height:1.12;margin:0 0 6px;font-weight:800;letter-spacing:0}
#protocol-screen .protocol-information p{font-size:clamp(11px,3dvh,19px);line-height:1.35;margin:0;color:#e0eaf0;max-width:45em}
#protocol-screen .protocol-major-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:clamp(8px,2vw,26px);align-items:stretch;min-height:clamp(48px,14dvh,80px)}
#protocol-screen .protocol-action{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;padding:2px 6px;border:6px solid transparent;border-image:var(--protocol-frame) 22 / 6px / 0 stretch;background:var(--protocol-button);box-shadow:0 2px 10px #0008,inset 0 0 10px #ffffff0b}
#protocol-screen .protocol-green{--protocol-frame:url('/assets/reference-ui/frame-green-v1.svg');--protocol-button:linear-gradient(#265117f2,#092a0af5);color:#ecffc9}
#protocol-screen .protocol-blue{--protocol-frame:url('/assets/reference-ui/frame-blue-v1.svg');--protocol-button:linear-gradient(#165184f2,#071b39f5);color:#e2f5ff}
#protocol-screen .protocol-gold{--protocol-frame:url('/assets/reference-ui/frame-gold-v1.svg');--protocol-button:linear-gradient(#745015f2,#2e2008f5);color:#fff1bd}
#protocol-screen .protocol-action-label{display:flex;gap:6px;align-items:center;justify-content:center;width:100%;font-size:clamp(12px,3.6dvh,23px);white-space:nowrap;font-weight:800;line-height:1.05}
#protocol-screen .protocol-action-label svg{height:1.3em;width:1.3em}
#protocol-screen .protocol-action small{font-size:clamp(8px,2.1dvh,13px);font-weight:800;letter-spacing:.14em;line-height:1.2;color:#f0dfa4}
#protocol-screen .protocol-tabs{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:3px;min-height:0;padding:5px 6px;background:linear-gradient(#153d56f2,#05111dfc);border:2px solid #66889e;border-bottom-color:#c2aa66;box-shadow:0 -2px 10px #0008;z-index:1}
#protocol-screen .protocol-tabs button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;border:4px solid transparent;border-image:url('/assets/reference-ui/frame-silver-v1.svg') 22 / 4px / 0 stretch;padding:1px;background:linear-gradient(#12374f,#061a29);font-size:clamp(10px,2.8dvh,18px);line-height:1.05;font-weight:700}
#protocol-screen .protocol-tabs svg{width:clamp(20px,6dvh,42px);height:clamp(20px,6dvh,42px);color:#d4e5ea}
#protocol-screen .protocol-tabs small{font-size:clamp(6.5px,1.7dvh,10px);font-weight:700;letter-spacing:.02em;color:#b9c9d3;white-space:nowrap}
#protocol-screen .protocol-tabs .is-selected{border-image-source:url('/assets/reference-ui/frame-gold-v1.svg');background:radial-gradient(ellipse at top,#94752b,#3c2d0f 80%);color:#fff1a8;box-shadow:0 0 12px #e9bf3355}
#protocol-screen .protocol-tabs .is-selected svg{color:#fff0ad}
#protocol-screen .protocol-coming-soon{position:absolute;inset:0;z-index:5;background:#020b16c9;backdrop-filter:blur(4px);display:grid;place-items:center;padding:12px}
#protocol-screen .protocol-coming-soon section{width:min(390px,75vw);max-height:100%;padding:clamp(12px,4dvh,30px);text-align:center;background:linear-gradient(135deg,#183c53,#071725);border:8px solid transparent;border-image:url('/assets/reference-ui/frame-gold-v1.svg') 22 / 8px / 0 stretch;box-shadow:0 15px 50px #0009}
#protocol-screen .protocol-small-emblem{color:#e8c66e;height:clamp(24px,8dvh,48px);margin-bottom:5px}
#protocol-screen .protocol-small-emblem svg{height:100%;width:auto}
#protocol-screen .protocol-coming-soon h2{font-size:clamp(22px,6dvh,36px);color:#ffe6a0;margin:6px 0}
#protocol-screen .protocol-coming-soon p:not(.protocol-kicker){font-size:clamp(12px,3dvh,18px);line-height:1.4;margin:8px 0 16px}
#protocol-screen [data-protocol-dismiss]{min-height:44px;width:100%;padding:8px;border:5px solid transparent;border-image:url('/assets/reference-ui/frame-blue-v1.svg') 22 / 5px / 0 stretch;background:linear-gradient(#184c70,#081d31);font-weight:800;font-size:clamp(11px,2.8dvh,16px)}
@media(max-height:350px){#protocol-screen .protocol-information{padding:7px 12px;width:60%;margin-left:12%}#protocol-screen .protocol-kicker{display:none}#protocol-screen .protocol-group-shield{flex-basis:42px;padding:7px 5px}#protocol-screen .protocol-information h2{font-size:16px;margin-bottom:3px}#protocol-screen .protocol-information p{font-size:10px}#protocol-screen .protocol-title-wing{display:none}#protocol-screen .protocol-tabs{padding:3px}#protocol-screen .protocol-tabs button{font-size:10px}#protocol-screen .protocol-major-actions{min-height:44px}#protocol-screen .protocol-action-label{font-size:11px}}
@media(prefers-reduced-motion:reduce){#protocol-screen button{transition:none}}
/* Explicit header tracks prevent intrinsic SVG dimensions expanding the short landscape header. */
#protocol-screen .protocol-header{grid-template-rows:minmax(0,1fr);min-height:0}
#protocol-screen .protocol-title{min-height:0;min-width:0;max-height:100%}
#protocol-screen .protocol-emblem{height:100%;width:clamp(25px,8dvh,52px);min-height:0;flex:0 0 auto;aspect-ratio:auto}
#protocol-screen .protocol-emblem svg{width:100%;height:100%;min-width:0;min-height:0}
#protocol-screen .protocol-back{min-height:0;height:100%}
#protocol-screen .protocol-tabs button{font-size:clamp(11px,3dvh,18px)}
#protocol-screen .protocol-tabs small{font-size:clamp(7px,1.9dvh,11px)}

/* Connected Protocol: each tab owns a scrollable content area. */
#protocol-screen.protocol-social{grid-template-rows:clamp(48px,9dvh,72px) auto minmax(0,1fr) clamp(54px,11dvh,82px);font-family:Arial,Helvetica,sans-serif}
#protocol-screen.protocol-social:after{background:linear-gradient(180deg,#04101b70,#04101bb0 55%,#020c1ce8)}
#protocol-screen .protocol-content{min-height:0;overflow:auto;overscroll-behavior:contain;padding:16px max(12px,calc((100% - 1120px)/2));scrollbar-color:#6a8ca0 #071b28}
#protocol-screen .protocol-feedback{min-height:26px;padding:5px 16px;font-size:13px;line-height:18px;text-align:center;background:#071b29df;color:#d5eab1}
#protocol-screen .protocol-feedback:empty{min-height:8px;padding:4px}
#protocol-screen .protocol-feedback.is-error{color:#ffd8ba;background:#42251fe8}
#protocol-screen.protocol-social .protocol-tabs{grid-template-columns:repeat(5,minmax(0,1fr));padding:4px;gap:4px}
#protocol-screen.protocol-social .protocol-tabs button{font-size:clamp(10px,2.4dvh,15px);min-height:0}
#protocol-screen.protocol-social .protocol-tabs svg{width:24px;height:24px}
#protocol-screen .protocol-count{display:inline-grid;place-items:center;min-width:20px;border-radius:12px;padding:1px 4px;background:#d8ad52;color:#102133}
#protocol-screen .protocol-panel{padding:20px;margin:0 0 16px;background:linear-gradient(125deg,#0c263af5,#071722f2);border:1px solid #6e91a6;border-top-color:#cfb56e;border-radius:8px;box-shadow:0 5px 18px #0005;min-width:0}
#protocol-screen .protocol-section-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:16px}
#protocol-screen h2{font-size:clamp(20px,3.3dvh,28px);margin:0 0 8px;color:#fff0c7;overflow-wrap:anywhere}
#protocol-screen h3{font-size:18px;margin:0 0 8px;overflow-wrap:anywhere}
#protocol-screen .protocol-panel p{line-height:1.5;margin:8px 0;color:#d6e6ee;overflow-wrap:anywhere}
#protocol-screen .protocol-panel small{color:#bbd1dd;line-height:1.4;font-size:12px}
#protocol-screen .protocol-control{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:40px;padding:8px 13px;border:1px solid #7295ab;border-radius:5px;background:linear-gradient(#23485e,#102b3f);color:#f0f6fb;font-size:13px;font-weight:700;line-height:1.25;white-space:normal}
#protocol-screen .protocol-control.primary{border-color:#d6b561;background:linear-gradient(#665125,#342c19);color:#fff0c6}
#protocol-screen .protocol-control.danger{border-color:#a96c61;background:#462b2be0;color:#ffe1d8}
#protocol-screen button:disabled{opacity:.55;cursor:default;filter:none}
#protocol-screen .protocol-refresh{justify-self:end}
#protocol-screen .protocol-welcome{display:flex;align-items:center;gap:24px;padding:28px}
#protocol-screen .protocol-welcome-emblem{flex:0 0 70px;color:#eed38a}
#protocol-screen .protocol-welcome-emblem svg{width:70px;height:80px}
#protocol-screen.protocol-social .protocol-major-actions{min-height:60px;margin:0 0 20px;gap:12px}
#protocol-screen .protocol-major-actions .protocol-control{font-size:16px;min-height:60px}
#protocol-screen .protocol-person{display:flex;align-items:center;gap:12px;min-width:0;padding:12px 0;border-bottom:1px solid #69859740}
#protocol-screen .protocol-person:last-child{border-bottom:0}
#protocol-screen .protocol-person-copy{flex:1 1 180px;min-width:0;display:flex;flex-direction:column;gap:4px}
#protocol-screen .protocol-name{display:inline-block;text-align:left;background:none;border:0;padding:0;color:#ffe9b0;font-size:16px;font-weight:700;line-height:1.3;overflow-wrap:anywhere}
#protocol-screen .protocol-person-actions{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:6px;max-width:58%}
#protocol-screen .protocol-avatar{width:52px;height:52px;flex:0 0 52px;object-fit:cover;border-radius:7px;border:1px solid #bfa66a;background:#193c50}
#protocol-screen .protocol-initials{display:grid;place-items:center;font-size:20px;font-weight:700;color:#f7dfa0}
#protocol-screen .protocol-chip{font-size:12px;color:#ceebc4;border:1px solid #6c9368;border-radius:4px;padding:6px 8px}
#protocol-screen .protocol-search{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-bottom:10px}
#protocol-screen .protocol-search input{flex:1 1 200px;min-width:0}
#protocol-screen input,#protocol-screen textarea,#protocol-screen select{font:inherit;font-size:15px;width:100%;min-width:0;min-height:42px;border:1px solid #83a7bb;border-radius:5px;padding:10px 12px;background:#04131de8;color:#f3f8fc;box-shadow:inset 0 1px 4px #0004}
#protocol-screen input:focus,#protocol-screen textarea:focus,#protocol-screen select:focus{outline:2px solid #e8cb79;outline-offset:2px}
#protocol-screen input::placeholder,#protocol-screen textarea::placeholder{color:#abc0cb;opacity:1}
#protocol-screen textarea{resize:vertical;max-height:200px}
#protocol-screen form>label{display:grid;gap:7px;font-size:14px;color:#e9e2ce;margin-bottom:16px}
#protocol-screen .protocol-form-panel{max-width:760px;margin-inline:auto}
#protocol-screen .protocol-form-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-top:12px}
#protocol-screen .protocol-empty{padding:18px 4px;color:#d0dfe8;font-size:15px;line-height:1.6}
#protocol-screen .protocol-group-result{padding:16px 0;border-bottom:1px solid #6e91a640}
#protocol-screen .protocol-activity{padding:0;list-style:none;margin:0}
#protocol-screen .protocol-activity li{display:flex;gap:12px;justify-content:space-between;padding:10px 0;border-bottom:1px solid #6e91a630;font-size:13px;line-height:1.5}
#protocol-screen .protocol-activity time{white-space:nowrap;color:#a7bdca;font-size:12px}
#protocol-screen .protocol-chat{max-width:960px;margin-inline:auto}
#protocol-screen .protocol-messages{max-height:42dvh;min-height:120px;overflow:auto;overscroll-behavior:contain;padding-right:4px}
#protocol-screen .protocol-message{padding:12px;margin:0 40px 10px 0;border-radius:7px;border:1px solid #65879c60;background:#173448}
#protocol-screen .protocol-message.is-mine{margin-left:40px;margin-right:0;background:#263f38;border-color:#a1a66d50}
#protocol-screen .protocol-message header{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
#protocol-screen .protocol-message time{font-size:11px;color:#aac0ca;margin-left:auto}
#protocol-screen .protocol-message header .protocol-control{min-height:28px;padding:3px 6px;font-size:10px}
#protocol-screen .protocol-message p{white-space:pre-wrap}
#protocol-screen .protocol-report-block{display:flex;align-items:center;gap:10px}
#protocol-screen .protocol-report-block input{width:18px;height:18px;flex:0 0 18px}
#protocol-screen .protocol-panel a{color:#b4e5f5;text-underline-offset:3px}
#protocol-screen .protocol-chat-form{display:flex;gap:8px;align-items:stretch;margin:12px 0 6px}
#protocol-screen .protocol-chat-form textarea{flex:1;resize:none}
#protocol-screen .protocol-leave{margin-top:22px;border-top:1px solid #6e91a640;padding-top:12px}
#protocol-screen .protocol-profile{max-width:760px;margin-inline:auto}
#protocol-screen .protocol-profile-heading{display:flex;align-items:center;gap:18px;margin:24px 0}
#protocol-screen .protocol-profile-heading .protocol-avatar{width:80px;height:80px;flex-basis:80px;font-size:28px}
#protocol-screen .protocol-profile-heading>div{flex:1;min-width:0}
#protocol-screen .protocol-rank-icon{width:64px;height:64px;object-fit:contain}
#protocol-screen .protocol-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
#protocol-screen .protocol-stats>div{padding:16px 8px;border:1px solid #7892a050;background:#132d3e;text-align:center;display:grid;gap:6px}
#protocol-screen .protocol-stats strong{font-size:22px;color:#ffe4a0;overflow-wrap:anywhere}
#protocol-screen .protocol-stats span{font-size:12px;color:#c6d9e3}
#protocol-screen .sr-only{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}
#protocol-screen.protocol-social .protocol-header{grid-template-columns:auto minmax(0,1fr) auto}
#protocol-screen.protocol-social h1{font-size:clamp(20px,5.6vw,43px)}
#protocol-screen.protocol-social .protocol-emblem{width:clamp(24px,4.8vw,48px);height:clamp(30px,6vw,60px);max-height:100%}
#protocol-screen.protocol-social .protocol-tabs button{font-size:clamp(9px,2.7vw,15px);overflow-wrap:anywhere}
#protocol-screen.protocol-social .protocol-refresh{font-size:12px;padding-inline:9px}
@media(max-width:650px){#protocol-screen .protocol-content{padding:10px}#protocol-screen .protocol-panel{padding:14px}#protocol-screen .protocol-person{flex-wrap:wrap}#protocol-screen .protocol-person-actions{flex:1 1 100%;max-width:none;justify-content:flex-start;padding-left:64px}#protocol-screen .protocol-person-copy{flex-basis:calc(100% - 70px)}#protocol-screen.protocol-social .protocol-major-actions{grid-template-columns:1fr}#protocol-screen .protocol-welcome{gap:12px}#protocol-screen .protocol-welcome-emblem{flex-basis:40px}#protocol-screen .protocol-welcome-emblem svg{width:40px;height:50px}#protocol-screen .protocol-profile-heading{gap:10px}#protocol-screen .protocol-profile-heading .protocol-avatar{width:55px;height:55px;flex-basis:55px}#protocol-screen .protocol-rank-icon{width:42px;height:42px}#protocol-screen .protocol-message{margin-right:12px}#protocol-screen .protocol-message.is-mine{margin-left:12px}#protocol-screen .protocol-stats strong{font-size:18px}}
@media(max-height:480px) and (orientation:landscape){#protocol-screen.protocol-social{grid-template-rows:44px auto minmax(0,1fr) 48px}#protocol-screen .protocol-content{padding-block:10px}#protocol-screen.protocol-social .protocol-tabs button{flex-direction:row;gap:6px}#protocol-screen.protocol-social .protocol-tabs svg{width:20px;height:20px}#protocol-screen .protocol-messages{max-height:26dvh}#protocol-screen .protocol-header h1{font-size:26px}#protocol-screen .protocol-panel{padding:14px}}
