/* Companion menu: a small roster beside a focused, handheld-style profile. */
#party.team-notebook{padding:24px;background:#102c3bd9;backdrop-filter:blur(3px)}
#party.team-notebook .team-card{
  width:min(1080px,100%);max-height:calc(100dvh - 48px);padding:0;overflow:auto;
  background:#e6eeea;color:#203e4e;border:3px solid #355468;border-radius:9px;
  box-shadow:0 5px 0 #152e3d,0 22px 70px #0b233955;font-family:'Courier New',monospace;
}
.team-card *{box-sizing:border-box}
.team-card [hidden]{display:none!important}
.team-card button,.team-card input,.team-card select{font:700 13px/1.4 'Courier New',monospace}
.team-card button{cursor:pointer}
.team-card button:disabled{cursor:default;color:#526b66;background:#e4ece7;border-color:#a9bab1;box-shadow:none;opacity:1}
.team-card button:focus-visible,.team-card input:focus-visible,.team-card select:focus-visible{outline:3px solid #c47832;outline-offset:3px}
.team-heading{display:flex;justify-content:space-between;align-items:center;gap:16px;padding:17px 22px;background:#284b60;color:#fff7df;position:sticky;top:0;z-index:2;border-bottom:3px solid #18394c}
.team-card .team-heading h2{font:700 24px/1.3 'Courier New',monospace;color:inherit;text-align:left;margin:0}
.team-card #partyClose{position:static;min-height:38px;padding:8px 11px;font:700 12px/1.4 'Courier New',monospace;background:#f9f5e6;color:#294758;border:2px solid #132f42;border-radius:3px;box-shadow:0 2px 0 #162d3a;flex:none}
.team-card #ptyTabs{display:flex;gap:5px;margin:0;padding:14px 22px}
.team-card #ptyTabs button{flex:none;min-height:40px;padding:8px 15px;background:transparent;color:#49636d;border:2px solid transparent;border-radius:5px;box-shadow:none;font:700 14px/1.4 'Courier New',monospace}
.team-card #ptyTabs button.sel{background:#fdfbef;color:#24485e;border-color:#65868e;box-shadow:0 2px 0 #b1c4c2}
.team-card #ptyTabs span{display:inline-block;margin-left:7px;font-size:12px;padding:1px 5px;background:#d8e6e2;border-radius:3px;color:#3c626b}
.team-card #partyList,.team-card #boxList{padding:0 20px 18px;min-width:0}
.team-roster{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px}
.team-roster>.team-tile{grid-column:1/-1}
.team-tile{
  display:flex;align-items:center;gap:12px;min-width:0;min-height:92px;text-align:left;
  background:#f9fbf2;color:#244451;border:2px solid #9db3ad;border-radius:8px 3px 8px 3px;
  padding:10px;box-shadow:0 2px 0 #c7d3ca;
}
.team-tile:hover{border-color:#648776;background:#fffdf3}
.team-tile[aria-pressed=true]{background:#fff0ce;border-color:#bb773f;box-shadow:inset 4px 0 0 #ddac62,0 2px 0 #b99665}
.team-tile.shiny{background:#fff6dc}.team-tile.shiny[aria-pressed=true]{background:#ffeab7;border-color:#b1833e;box-shadow:inset 4px 0 0 #dfb254,0 2px 0 #b99665}
.team-tile canvas{width:64px;height:64px;image-rendering:pixelated;flex:none}
.team-tile-info{min-width:0;flex:1}.team-tile strong{display:block;font:700 14px/1.4 'Courier New',monospace;overflow-wrap:anywhere}
.team-type,.team-slot-label,.team-hp-text{display:block;font:11px/1.5 'Courier New',monospace;color:#516b73}
.team-type{margin:2px 0}.team-slot-label{font-size:10px;font-weight:bold;color:#2d6c67;margin-top:4px}
.team-hp{display:block;height:7px;margin-top:6px;background:#d2dcd2;border:1px solid #88a49b;border-radius:2px;overflow:hidden}
.team-hp i{display:block;height:100%;background:#48a66f}.team-hp i.mid{background:#d5a43f}.team-hp i.low{background:#d46851}
.team-hp-text{margin-top:4px}.team-card .shiny-mark{font:700 10px/1.4 'Courier New',monospace;color:#927027;white-space:nowrap}
.team-empty-slot{display:flex;align-items:center;justify-content:center;gap:5px;min-height:43px;padding:6px 3px;background:transparent;border:1px dashed #96afa6;border-radius:4px;box-shadow:none;color:#6c827b;font:11px/1.4 'Courier New',monospace}
.team-empty-slot>span{font-size:18px}.team-empty-slot b{font-weight:400}
.team-explainer{font:12px/1.6 'Courier New',monospace;color:#60736e;margin:14px 0 0;text-align:center}
.team-storage{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
.team-storage .team-tile{flex-direction:column;gap:4px;text-align:center;padding:10px 8px}
.team-storage .team-tile-info{width:100%}.team-storage .team-tile strong{font-size:12px}
.team-empty{grid-column:1/-1;background:#f4f7ef;border:1px dashed #9fb6a9;border-radius:6px;padding:30px 20px;text-align:center;font:14px/1.7 'Courier New',monospace;color:#49665f}
.team-empty b{color:#2b544c}.team-empty p{max-width:440px;margin:8px auto 0}
.team-toolbar{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-bottom:12px}
.team-toolbar label{display:grid;gap:4px;min-width:0;font:700 10px/1.5 'Courier New',monospace;color:#4c676d}
.team-toolbar .team-search{grid-column:1/-1}
.team-toolbar input,.team-toolbar select{width:100%;min-width:0;min-height:37px;border:1px solid #8aa69e;border-radius:4px;background:#fbfcf6;color:#33535c;padding:6px;font-size:11px}
.team-toolbar input{font-size:13px}
.team-result{font:11px/1.6 'Courier New',monospace;color:#5a726b;margin:0 0 10px}
.team-pagination{display:flex;align-items:center;justify-content:space-between;gap:6px;margin:14px 0 0;font:11px/1.5 'Courier New',monospace}
.team-pagination button,.team-empty button,.team-swap button,.team-return{background:#f9faf0;color:#355565;border:1px solid #8fa8a8;border-radius:4px;min-height:38px;padding:7px 9px}
.team-detail{min-width:0;margin:0 20px 18px;padding:20px;background:#fffdf3;border:1px solid #9eb5ac;border-radius:7px;box-shadow:0 2px 0 #c8d7cb}
.team-profile{display:grid;grid-template-columns:144px minmax(0,1fr);gap:20px;align-items:center}
.team-stage{height:160px;display:grid;place-items:center;background:linear-gradient(#d6e9df 0 68%,#bad49c 68%);border:1px solid #8aa793;border-radius:7px 3px}
.team-stage.shiny{background:linear-gradient(#f6e9bd 0 68%,#d6db9b 68%);border-color:#b3a05b}
.team-stage canvas{width:138px;height:138px;image-rendering:pixelated}
.team-profile-info small{font:700 11px/1.5 'Courier New',monospace;color:#718176;letter-spacing:1px}
.team-profile h3{font:700 23px/1.25 'Courier New',monospace;color:#25485a;margin:5px 0 4px;overflow-wrap:anywhere}
.team-profile p{font:13px/1.5 'Courier New',monospace;color:#5c7271;margin:4px 0 8px}
.team-type-pills{display:flex;flex-wrap:wrap;gap:5px}
.team-type-pills span{font:700 10px/1.4 'Courier New',monospace;padding:3px 6px;background:#e0eddf;color:#477164;border-radius:3px;border:0}
.team-profile .team-hp{margin-top:10px}.team-profile .team-hp-text{font-size:12px;color:#405e61}
.team-pose{display:flex;gap:5px;flex-wrap:wrap;margin-top:10px}
.team-pose button{font-size:11px;min-height:31px;padding:4px 9px;background:transparent;color:#4b6970;border:1px solid #a8bdb4;border-radius:3px}
.team-pose button[aria-pressed=true]{background:#dfebe3;border-color:#749889;color:#315649}
.team-actions{display:flex;gap:8px;flex-wrap:wrap;margin:18px 0}
.team-actions button{flex:1;min-height:42px;padding:9px 11px;color:#fffbed;background:#386d70;border:2px solid #28565b;border-radius:4px;white-space:normal}
.team-actions button[data-team-action=walk]{background:#f1ead4;color:#57583d;border-color:#b6b086}
.team-actions button[data-team-action=deposit]{flex:0 0 auto;background:#f9f6e9;color:#73613c;border-color:#b7ac91}
.team-actions button:disabled{background:#e3eade;color:#537058;border-color:#becab5}
.team-detail-tabs{display:flex;gap:18px;border-bottom:1px solid #b7c9bd;margin:0 0 14px}
.team-detail-tabs button{background:none;border:0;border-bottom:3px solid transparent;border-radius:0;box-shadow:none;min-height:40px;padding:8px 2px;color:#617771}
.team-detail-tabs button[aria-selected=true]{color:#244f50;border-bottom-color:#37766a}
.team-moves{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.team-move{padding:12px;background:#f0f4e9;border:1px solid #d0dbc8;border-radius:5px;box-shadow:none;min-width:0}
.team-move-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:8px}
.team-move b{font:700 14px/1.45 'Courier New',monospace;color:#2c5358}
.team-move button{flex:none;min-height:30px;padding:3px 7px;color:#386957;background:#fffdf1;border:1px solid #91b3a0;border-radius:3px;font-size:11px;white-space:nowrap}
.team-move-meta{display:flex;align-items:center;flex-wrap:wrap;gap:5px 9px;margin:5px 0 0}
.team-move-meta span{font:700 9px/1.5 'Courier New',monospace;color:#587c61;letter-spacing:.5px}
.team-move code{font:10px/1.5 'Courier New',monospace;color:#687e73;overflow-wrap:anywhere}
.team-move p{font:13px/1.55 system-ui,sans-serif;color:#46605a;margin:8px 0}
.team-move small{display:block;font:700 10px/1.6 'Courier New',monospace;color:#597460}
.team-observation{font:15px/1.75 system-ui,sans-serif;color:#36574d;margin:4px 0 18px;padding:0;background:none;border:0}
.team-detail .work-connection{margin:0;padding:16px 0 0;border:0;border-top:1px solid #b8cbbd;background:transparent;color:#496158;font:14px/1.7 system-ui,sans-serif}
.team-detail .work-connection h4{font:700 12px/1.6 'Courier New',monospace;color:#3b6262;margin:0 0 8px}
.team-detail .work-connection p{margin:6px 0 14px}.team-detail .work-connection a{font:700 12px/1.5 'Courier New',monospace;color:#2d655f}
.team-swap{padding:12px;margin-bottom:15px;background:#f5eed9;border:1px solid #bdb28a;border-radius:5px;box-shadow:none}
.team-swap h4{font:700 14px/1.5 'Courier New',monospace;margin:0 0 6px;color:#5c6045}.team-swap p{font:13px/1.6 system-ui,sans-serif;color:#5c6654;margin:6px 0 12px}.team-swap button{margin:0 5px 5px 0}
.team-return{display:none;margin-bottom:14px}
.team-message{font:700 12px/1.6 'Courier New',monospace;color:#3b6957;padding:0 22px;margin:0 0 10px}
.team-message:empty{display:none}
#party .team-card .phint{font:11px/1.5 'Courier New',monospace;color:#6d8178;text-align:right;margin:0;padding:0 22px 14px}
@media(min-width:1000px){
  #party.team-notebook .team-card{display:grid;grid-template-columns:320px minmax(0,1fr);align-items:start;gap:0}
  .team-heading,.team-card #ptyTabs,.team-message,.team-card .phint{grid-column:1/-1}
  .team-card #partyList,.team-card #boxList{grid-column:1;grid-row:3;max-height:calc(100dvh - 222px);overflow:auto;overscroll-behavior:contain}
  .team-card .team-detail{grid-column:2;grid-row:3;max-height:calc(100dvh - 222px);overflow:auto;overscroll-behavior:contain}
  #party.team-empty-view #boxList{grid-column:1/-1;max-width:620px;width:100%;justify-self:center}
}
@media(max-width:999px){
  #party.team-notebook .team-card{width:min(640px,100%)}
  .team-return{display:inline-flex;align-items:center}
  #party:not([data-detail-open=true]) .team-detail{display:none}
  #party[data-detail-open=true] #partyList,#party[data-detail-open=true] #boxList,#party[data-detail-open=true] #ptyTabs{display:none}
  #party[data-detail-open=true] .team-detail{margin-top:18px}
}
@media(max-width:600px){
  #party.team-notebook{padding:10px}
  #party.team-notebook .team-card{max-height:calc(100dvh - 20px)}
  .team-heading{padding:12px 14px}.team-card .team-heading h2{font-size:21px}.team-card #partyClose{min-height:38px;font-size:11px;padding:7px}
  .team-card #ptyTabs{padding:12px 14px}.team-card #ptyTabs button{min-height:44px;padding:8px 12px}
  .team-card #partyList,.team-card #boxList{padding:0 14px 16px}
  .team-detail{margin:0 12px 14px;padding:14px}
  .team-profile{grid-template-columns:100px minmax(0,1fr);gap:12px}.team-stage{height:128px}.team-stage canvas{width:96px;height:96px}
  .team-profile h3{font-size:18px}.team-profile p{font-size:12px}.team-profile-info small{font-size:10px}
  .team-pose{gap:4px}.team-pose button{min-height:36px;font-size:10px;padding:4px 7px}
  .team-actions button{font-size:12px;min-height:44px;padding:8px}.team-moves{grid-template-columns:1fr}
  .team-move button{min-height:36px}.team-return,.team-detail-tabs button{min-height:44px}
  .team-toolbar{grid-template-columns:repeat(2,minmax(0,1fr))}.team-toolbar label:last-child{grid-column:1/-1}
  .team-toolbar input,.team-toolbar select{min-height:40px}
}
