/* 通常の全員表の高さを変えず、チャット・タスクだけを可視画面に配置する。 */
body.team-mode{overflow:hidden;height:100dvh;padding:0}
.team-mode>.site-header,.team-mode>#sync-status{display:none!important}
.team-mode main#app{margin:0;padding:0;max-width:none;width:100%}
.team-shell{position:fixed;inset:0 0 auto;height:100dvh;display:flex;flex-direction:column;background:#f1f6f6;z-index:30;padding:env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left);box-sizing:border-box;overflow:hidden;color:var(--ink)}
.team-header{flex:none;display:grid;grid-template-columns:80px 1fr 80px;align-items:center;height:var(--app-header-height);min-height:var(--app-header-height);padding:4px var(--app-header-gutter);background:#fff;border-bottom:1px solid var(--line);gap:4px}
.team-header h1{font-size:17px;font-weight:700;line-height:1.5;text-align:center;margin:0}
.team-header button{min-height:44px;min-width:44px;color:var(--teal);font-size:14px;border-radius:8px}
.team-header .team-back{font-size:38px;line-height:1;width:48px}
.team-header .team-switch{border:1px solid var(--line);font-size:14px}
.team-status{flex:none;background:#fff2d6;color:#6c5014;font-size:14px;line-height:1.6;padding:6px 12px;margin:0;max-height:90px;overflow:auto}
.team-retry{min-height:44px;text-decoration:underline;margin-left:12px}
.team-log{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;overflow-anchor:none;scroll-behavior:auto;touch-action:pan-y pinch-zoom;padding:8px 12px 18px}
.team-messages{max-width:800px;margin:auto}
.team-date{text-align:center;font-size:12px;color:#536d73;margin:20px 0 16px;clear:both}
.team-message{position:relative;max-width:min(86%,600px);margin:0 auto 18px 0;padding-right:32px;overflow-wrap:anywhere}
.team-message.own{margin-left:auto;margin-right:0;padding-left:32px;padding-right:0}
.team-message-meta{display:flex;align-items:baseline;gap:9px;margin:0 3px 5px;font-size:12px;color:#526b71;line-height:1.4}
.team-message-meta strong{font-size:13px;font-weight:600}
.team-message.own .team-message-meta{justify-content:flex-end}
.team-bubble{background:#fff;border:1px solid #dce6e6;border-radius:3px 16px 16px;padding:11px 14px;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;touch-action:pan-y pinch-zoom}
.own .team-bubble{background:#dcefed;border-color:#c7e1dd;border-radius:16px 3px 16px 16px}
.bot .team-bubble{background:#e9eff1;border-color:transparent}
.team-body{font-size:16px;line-height:1.65;white-space:pre-wrap;margin:0;overflow-wrap:anywhere}
.team-message-menu{position:absolute;right:-3px;bottom:0;min-width:44px;min-height:44px;font-size:23px;color:#526b71}
.own .team-message-menu{left:-3px;right:auto}
.team-quote{display:block;text-align:left;border-left:3px solid #427d7e;background:#ffffff80;padding:7px 10px;margin-bottom:9px;width:100%;min-height:44px;overflow-wrap:anywhere;border-radius:3px}
.team-quote strong,.team-quote span{display:block;font-size:13px;line-height:1.5;white-space:pre-wrap}
.team-quote span{display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
.team-highlight .team-bubble{outline:3px solid #608f8e;outline-offset:2px}
.team-task-card{margin-top:12px;padding:12px;background:#ffffffb3;border:1px solid #a8cac4;width:100%;border-radius:9px;text-align:left;min-height:44px}
.team-task-card strong{font-size:12px;color:var(--teal)}
.team-task-card .team-card-title{display:block;margin:5px 0;font-size:15px;line-height:1.5;white-space:pre-wrap}
.team-task-card small{font-size:12px;color:#47636a}
.team-older{display:block;min-height:44px;margin:0 auto 10px;color:var(--teal);font-size:14px}
.team-new{flex:none;align-self:center;margin:-52px auto 8px;z-index:2;min-height:44px;padding:10px 18px;background:#fff;border:1px solid #b6cece;box-shadow:0 3px 12px #20383f1a;border-radius:24px;font-size:14px;color:var(--teal)}
.team-composer{flex:none;background:#fff;border-top:1px solid var(--line);padding:8px 10px max(8px,env(safe-area-inset-bottom))}
.keyboard-open .team-composer{padding-bottom:8px}
.team-compose-row{display:flex;align-items:flex-end;gap:8px;max-width:800px;margin:auto}
.team-compose-row textarea{font:inherit;font-size:16px;line-height:1.5;flex:1;min-width:0;min-height:44px;max-height:130px;resize:none;border:1px solid #cbdadb;border-radius:19px;padding:9px 13px;background:#f5f8f8;color:var(--ink);box-sizing:border-box}
.team-compose-row button{min-height:44px;padding:9px 14px;border-radius:20px;font-size:15px;flex:none}
.team-reply-preview{display:flex;gap:8px;align-items:center;max-width:800px;margin:0 auto 6px;border-left:3px solid var(--teal);padding-left:10px;font-size:13px}
.team-reply-preview span{flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.team-reply-preview button{min-height:44px;min-width:44px;font-size:24px}
.team-dialog{position:fixed;bottom:auto;margin:0 auto;max-width:480px;width:calc(100% - 24px);max-height:calc(100dvh - 32px);padding:20px;border:0;border-radius:18px;color:var(--ink);box-sizing:border-box;overflow:auto;overscroll-behavior:contain}
.team-dialog::backdrop{background:#142d3b70}
.team-dialog-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:14px}
.team-dialog-head h2{font-size:18px;margin:0;line-height:1.5}
.team-dialog-head button{font-size:28px;min-height:44px;min-width:44px}
.team-actions{display:flex;flex-direction:column;gap:2px}
.team-actions button{min-height:50px;font-size:16px;text-align:left;padding:10px;border-bottom:1px solid var(--line)}
.team-danger{color:#a33838}
.team-field{display:flex;flex-direction:column;gap:8px;font-size:14px;margin:16px 0;min-width:0}
.team-dialog input,.team-dialog textarea,.team-dialog select{width:100%;min-width:0;max-width:100%;font:inherit;font-size:16px;padding:10px;border:1px solid #b6cccd;border-radius:7px;background:#fff;color:var(--ink);min-height:44px;box-sizing:border-box}
.team-form-actions,.team-presets{display:flex;align-items:center;justify-content:flex-end;gap:12px;flex-wrap:wrap}
.team-form-actions button,.team-presets button{min-height:44px;padding:8px 12px;font-size:15px}
.team-presets{justify-content:flex-start}.team-presets button{background:#edf6f5;border-radius:8px}
.team-source-preview{background:#f0f5f5;padding:12px;border-radius:8px;max-height:120px;overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere;font-size:14px}
.team-help{font-size:14px;color:#536d73;line-height:1.7;margin:12px 0}
.team-task-content{overflow:auto;flex:1;min-height:0;padding:16px max(14px,calc((100% - 800px)/2)) max(24px,env(safe-area-inset-bottom));overscroll-behavior:contain}
.team-filters{display:flex;gap:8px;margin-bottom:16px}
.team-filters button{min-height:44px;border-radius:24px;padding:10px 22px;background:#fff;border:1px solid #bed3d2;font-size:15px}
.team-filters button[aria-pressed=true]{background:var(--teal);color:#fff;border-color:var(--teal)}
.team-task-row,.team-reminder{padding:18px;background:#fff;border:1px solid #d9e5e4;border-radius:12px;margin-bottom:12px;overflow-wrap:anywhere}
.team-task-row h2{font-size:18px;line-height:1.6;white-space:pre-wrap;margin:8px 0}
.team-task-title{display:block;text-align:left;white-space:pre-wrap;font-size:17px;font-weight:600;line-height:1.6;padding:8px 0;min-height:44px}
.team-task-state{font-size:13px;font-weight:600;background:#edf5f4;padding:4px 8px;border-radius:5px;color:var(--teal)}
.team-task-row.doing .team-task-state{background:#fff2d6;color:#795313}
.team-task-meta,.team-task-row p{font-size:14px;color:#536d73;line-height:1.7;margin:8px 0}
.team-task-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:14px}
.team-task-actions button{min-height:44px;padding:9px 12px;font-size:14px}
.team-reminder-heading{font-size:18px;margin:30px 0 16px}
.team-reminder strong{font-size:14px}.team-reminder p{font-size:16px;line-height:1.6;white-space:pre-wrap;margin:10px 0}
.team-reminder button{font-size:14px;min-height:44px;margin-right:12px}
.team-reminder.due{border-color:#bd944c;background:#fffbef}
.team-empty{padding:24px 10px;font-size:15px;line-height:1.8;text-align:center;color:#536d73}
.team-shell button:focus-visible,.team-dialog button:focus-visible{outline:3px solid #4d8486;outline-offset:2px}
@media(min-width:740px){.team-log{padding:14px 24px 24px}.team-composer{padding-top:12px}.team-header{grid-template-columns:100px 1fr 100px}}

/* File library stays inside a scrollable sheet, preserving the message viewport. */
.chat-file{display:flex;flex-direction:column;gap:6px;margin-block:8px;padding:10px;border:1px solid #cbd9d8;border-radius:10px;background:#fff;overflow-wrap:anywhere}
.chat-file small{font-size:12px;color:#526767}.chat-file-actions{display:flex;flex-wrap:wrap;gap:6px}.chat-file-actions button{padding:8px;font-size:13px}
.chat-library{max-height:70dvh;overflow:auto}.chat-search-form{display:flex;gap:6px;flex-wrap:wrap;position:sticky;top:0;background:white;padding-block:8px}.chat-search-form input{flex:1 1 180px;min-width:0}.chat-search-form input,.chat-search-form select{padding:9px;border:1px solid #bacbca;border-radius:8px}
.chat-search-item{padding:12px 0;border-bottom:1px solid #dbe3e3}.chat-search-item p{white-space:pre-wrap;overflow-wrap:anywhere;font-size:14px}.chat-search-item>button{margin-right:8px}.team-attach{align-self:end;min-height:42px;min-width:36px;font-size:22px}
@media(max-width:600px){.team-header{gap:6px}.team-header h1{font-size:16px;flex:1}.team-header .team-switch{padding:8px 6px;font-size:12px}.team-dialog{width:calc(100vw - 24px);max-width:600px}.chat-file-actions button{min-height:40px}}
.team-header.has-library{grid-template-columns:44px minmax(0,1fr) auto auto auto}.team-header.has-library .team-switch{padding-inline:10px;white-space:nowrap}
.chat-library button,.chat-file-actions button{min-height:40px;padding:8px 12px;border:1px solid #cbd9d8;border-radius:8px;background:#f5f9f8;color:#205d61;font-size:14px}.chat-library button:disabled,.chat-file-actions button:disabled{opacity:.55}.chat-library>button{margin-block:10px}.chat-search-item>button{margin-top:6px}.chat-library>small{display:block;color:#607574;line-height:1.5}
@media(max-width:600px){.team-header.has-library h1{font-size:14px}.team-header.has-library .team-switch{padding-inline:7px;font-size:12px}}

.team-ai-status{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:8px;font-size:11px;color:#526b68}.team-ai-status button{min-height:44px;padding:6px 10px;border:1px solid #b9cfca;border-radius:7px;background:#fff}
