/* v5.8: existing WIIN palette, accessible dialogs and messaging. */
:root{--support-accent:#215fee;--support-soft:#eef4ff;--support-border:#dae2ed;--support-ink:#1d2429}
.member-body{--support-accent:var(--tr-red);--support-soft:#fbefef;--support-border:var(--tr-line)}
.client-activity-summary{display:inline;font-size:.6em;font-weight:550;color:#53677d;letter-spacing:normal;overflow-wrap:anywhere}
.training-floating-actions{position:fixed;z-index:32;right:max(18px,env(safe-area-inset-right));bottom:calc(92px + env(safe-area-inset-bottom));display:flex;gap:10px;align-items:center}
.support-fab{position:relative;display:grid;place-items:center;border:1px solid #a2181c20;border-radius:50%;width:54px;height:54px;background:var(--tr-red);color:#fff;cursor:pointer;box-shadow:0 4px 18px #1d242929}
.support-fab svg{width:25px;height:25px}.support-fab.support-info{background:#fff;color:var(--tr-red);font-size:26px;font-weight:750;font-family:Georgia,serif}
.support-text-button{display:inline;border:0;background:none;color:var(--support-accent);text-decoration:underline;padding:0;cursor:pointer;font:inherit}
.support-dialog{position:fixed;inset:auto;margin:0;left:50%;top:calc(var(--support-top,0px) + var(--support-height,100dvh)/2);transform:translate(-50%,-50%);box-sizing:border-box;padding:0;border:1px solid var(--support-border);border-radius:20px;width:min(820px,calc(100vw - 28px));max-width:calc(100vw - 28px);max-height:calc(var(--support-height,100dvh) - 32px);background:#fff;color:var(--support-ink);box-shadow:0 24px 80px #17202433;overflow:hidden}
.support-dialog[open]{display:flex;flex-direction:column}.support-dialog::backdrop{background:#111c2677}
.support-dialog-head{display:flex;justify-content:space-between;align-items:flex-start;gap:14px;flex:none;padding:19px 22px;border-bottom:1px solid var(--support-border);background:#fff}
.support-dialog-head h2{font-size:22px!important;line-height:1.3;margin:3px 0!important;letter-spacing:-.4px;overflow-wrap:anywhere}
.support-dialog-head button{display:grid;place-items:center;width:44px;height:44px;flex:none;border:1px solid var(--support-border);border-radius:50%;background:#f5f6f6;color:#253038;font-size:28px;cursor:pointer;line-height:1}
.support-dialog-content{overflow-y:auto;overscroll-behavior:contain;min-height:0;padding:20px 22px;scrollbar-gutter:stable;overflow-wrap:anywhere}
.support-dialog .tr-training-guide{margin:0}.support-dialog .tr-guide-heading{margin-top:0}.support-dialog :focus-visible{outline:3px solid var(--support-accent);outline-offset:2px}
.chat-dialog{width:min(650px,calc(100vw - 28px));height:min(730px,calc(var(--support-height,100dvh) - 32px))}
.chat-widget{display:flex;flex-direction:column;min-height:0;flex:1;padding:0 20px 16px;overflow:hidden}
.chat-explainer{font-size:12px;line-height:1.5;color:#61717b!important;margin:12px 0!important;flex:none}
.chat-context{font-size:12px;margin:0 0 8px!important;color:#61717b;flex:none}
.chat-timeline{flex:1;min-height:95px;overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable;padding:8px 2px}
.chat-messages{display:flex;flex-direction:column;gap:14px}.chat-bubble{max-width:88%;align-self:flex-start;padding:12px 14px;background:#f0f3f6;border:1px solid #e5eaed;border-radius:15px 15px 15px 4px;overflow-wrap:anywhere}
.chat-bubble.outgoing{align-self:flex-end;background:var(--support-soft);border-color:var(--support-border);border-radius:15px 15px 4px 15px}
.chat-bubble header{font-size:11px;font-weight:700;color:#52616c;margin-bottom:5px}.chat-bubble .chat-text{white-space:pre-wrap;margin:0;color:var(--support-ink);font-size:14px;line-height:1.55}.chat-bubble time{display:block;font-size:10px;color:#64747e;text-align:right;margin-top:6px}.chat-bubble .chat-message-context{font-size:11px;margin:0 0 6px;color:#64747e}
.chat-empty{text-align:center;padding:22px 10px;color:#70818d;font-size:14px}.chat-compose{border-top:1px solid var(--support-border);padding-top:12px;flex:none}.chat-compose label{display:block;font-size:12px;font-weight:600;margin:0 0 8px!important}.chat-compose textarea{display:block;box-sizing:border-box;width:100%;resize:vertical;min-height:60px;max-height:130px;margin-top:5px;padding:10px;border:1px solid var(--support-border);border-radius:10px;font:inherit;font-size:16px;color:var(--support-ink);background:#fff}.chat-compose-footer{display:flex;gap:8px;align-items:center;justify-content:space-between}.chat-compose-footer small{font-size:10px;color:#637585}.chat-error{padding:10px 12px;color:#a2181c;background:#fff1ed;font-size:13px;border-radius:10px;flex:none;white-space:pre-line}.chat-update{font-size:11px;min-height:16px;color:#61717b;margin:4px 0!important;flex:none}.chat-to-bottom{align-self:center;background:var(--support-soft);border:1px solid var(--support-border);border-radius:16px;color:var(--support-accent);padding:7px 16px;cursor:pointer;flex:none}.chat-older,.chat-retry{margin:4px auto 10px;flex:none;font-size:12px!important;min-height:34px!important}
.chat-unread-badge{display:inline-block;min-width:18px;padding:1px 5px;border-radius:20px;background:var(--support-accent);color:#fff;font-size:10px;line-height:16px;text-align:center;white-space:nowrap}.support-fab .chat-unread-badge{position:absolute;right:-5px;top:-3px;background:#fff;color:var(--tr-red);border:1px solid var(--tr-red)}
.member-nav a{min-width:0;padding:17px 10px;flex:1;max-width:155px;font-size:13px;position:relative}.member-nav [data-chat-unread]{position:absolute;top:4px;right:9px}
.chat-page{height:min(760px,calc(100dvh - 245px));min-height:400px;padding:0!important;display:flex;flex-direction:column}
.messages-layout{display:grid;grid-template-columns:290px minmax(0,1fr);height:calc(100dvh - 160px);min-height:520px;max-height:900px;border:1px solid var(--support-border);border-radius:18px;overflow:hidden;background:#fff}
.inbox-sidebar{display:flex;flex-direction:column;min-width:0;min-height:0;border-right:1px solid var(--support-border);padding:18px 12px;background:#f9fbfe}.inbox-sidebar label{font-size:12px;font-weight:650;padding:0 5px;margin-bottom:8px}.inbox-sidebar input{width:100%;box-sizing:border-box;font:inherit;border:1px solid var(--support-border);border-radius:10px;padding:12px;font-size:14px}.inbox-list{overflow:auto;flex:1;min-height:0;margin-top:12px}.inbox-thread{width:100%;text-align:left;border:1px solid transparent;border-radius:12px;display:block;background:transparent;padding:14px 10px;cursor:pointer;color:var(--support-ink)}.inbox-thread:hover,.inbox-thread[aria-pressed=true]{background:#eaf1ff;border-color:#cad9f7}.inbox-thread strong{display:block;font-size:14px;overflow-wrap:anywhere}.inbox-thread small{display:block;color:#64778f;margin-top:6px;font-size:11px}.inbox-thread .chat-unread-badge{float:right}.inbox-content{display:flex;min-width:0;min-height:0}.inbox-prompt{align-self:center;margin:35px;text-align:center;color:#61717b}.inbox-prompt h2{color:var(--support-ink)}.inbox-conversation{display:flex;flex-direction:column;width:100%;min-height:0}.inbox-heading{display:flex;align-items:center;gap:12px;border-bottom:1px solid var(--support-border);padding:17px 20px;flex:none}.inbox-heading h2{font-size:21px;margin:0;overflow-wrap:anywhere}.inbox-back{display:none!important}.inbox-error{padding:8px;font-size:13px;color:#a2181c}
.attendance-actions{display:flex!important;gap:6px;align-items:center}.attendance-choice{flex:1;min-width:65px}.attendance-history-button{display:flex;align-items:center;justify-content:center;gap:5px;flex:none;width:44px;height:42px;border:1px solid #ccdaed;border-radius:10px;background:#f4f7fb;color:#446080;cursor:pointer}.attendance-history-button svg{width:20px;height:20px}.attendance-history-button span{display:none}.attendance-row.saving .attendance-choice{pointer-events:none;opacity:.65}.history-controls{padding:14px 22px 4px;flex:none;border-bottom:1px solid var(--support-border)}.history-controls label{display:inline;font-size:13px;margin-right:10px}.history-controls select{width:auto!important;min-width:135px;padding:8px;border:1px solid var(--support-border);border-radius:8px;font:inherit}.history-controls p{font-size:12px;color:#637585;line-height:1.5;margin:10px 0}.history-row{padding:14px 0;border-bottom:1px solid var(--support-border);display:grid;grid-template-columns:1fr auto;gap:5px 15px}.history-row strong{font-size:14px}.history-row small{grid-column:1/-1;font-size:12px;color:#637585}.history-status{font-size:12px;padding:4px 10px;border-radius:16px;align-self:start}.history-status.present{color:#12613b;background:#e0f6e9}.history-status.absent{color:#a23625;background:#fff0ed}
.live-update-notice{position:fixed;z-index:40;bottom:18px;left:50%;transform:translateX(-50%);width:min(590px,calc(100vw - 32px));padding:14px 16px;background:#fff;border:1px solid var(--support-border);box-shadow:0 8px 30px #1e314126;border-radius:14px;font-size:13px;display:flex;align-items:center;gap:14px;color:#374d61;box-sizing:border-box}.member-body .live-update-notice{bottom:calc(153px + env(safe-area-inset-bottom))}.live-update-notice button{font:inherit;border:1px solid var(--support-border);background:var(--support-soft);color:var(--support-accent);border-radius:8px;padding:10px;cursor:pointer;flex:none}
@media(max-width:680px){.support-dialog{border-radius:16px;width:calc(100vw - 20px);max-width:calc(100vw - 20px);max-height:calc(var(--support-height,100dvh) - 20px)}.support-dialog-head{padding:14px 16px}.support-dialog-head h2{font-size:20px!important}.support-dialog-content{padding:16px}.support-dialog .tr-pse-table-head{display:none}.support-dialog .tr-pse-row{grid-template-columns:32px 1fr!important;gap:4px 10px;padding:10px!important}.support-dialog .tr-pse-row>span:last-child{grid-column:2;font-size:12px}.support-dialog .tr-pse-number{grid-row:1/3}.support-dialog .card{padding:16px}.chat-dialog{height:calc(var(--support-height,100dvh) - 20px)}.chat-widget{padding:0 14px 12px}.chat-compose textarea{max-height:105px}.chat-bubble{max-width:93%}.messages-layout{grid-template-columns:1fr;height:calc(100dvh - 175px);min-height:400px}.messages-layout .inbox-content{display:none}.messages-layout.conversation-open .inbox-sidebar{display:none}.messages-layout.conversation-open .inbox-content{display:flex}.inbox-back{display:inline-flex!important}.inbox-heading{padding:12px;flex-wrap:wrap}.inbox-heading h2{font-size:18px}.chat-page{height:calc(100dvh - 265px);min-height:370px}.history-controls{padding:12px 16px 2px}.training-floating-actions{right:14px;bottom:calc(84px + env(safe-area-inset-bottom))}.support-fab{width:50px;height:50px}.attendance-history-button{width:40px}.client-activity-summary{font-size:.57em}}
@media(max-height:450px){.chat-explainer,.chat-context{display:none}.chat-compose textarea{min-height:40px;max-height:60px;height:40px}.chat-dialog .chat-timeline{min-height:40px}.support-dialog-head{padding:7px 12px}.support-dialog-head button{width:36px;height:36px}.chat-compose{padding-top:5px}.chat-widget{padding-bottom:6px}}
@media print{.training-floating-actions,.support-dialog,.live-update-notice,.chat-unread-badge{display:none!important}}

.training-floating-actions .support-info{width:auto;max-width:calc(100vw - 100px);border-radius:24px;padding:12px 16px;font-size:14px;line-height:1.3}.member-exercise-inputs summary{cursor:pointer;font-weight:700;padding:10px 0}.member-exercise-inputs[open] summary{margin-bottom:12px}
