.copilot-shell { max-width: 1080px; display: grid; gap: 14px; }
.copilot-policy { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 13px 15px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-soft); color: var(--text); }
.copilot-policy strong { font-size: 13px; }
.copilot-policy .card-subtitle { max-width: 650px; margin: 5px 0 0; }
.copilot-context { min-width: 190px; max-width: 260px; display: grid; gap: 4px; padding: 9px 11px; border-radius: 8px; background: var(--surface-raised); }
.copilot-context small { color: var(--muted); font-size: 10px; }
.copilot-context strong { color: var(--text); font-size: 11px; overflow-wrap: anywhere; }
.copilot-prompts { display: flex; flex-wrap: wrap; gap: 7px; }
.copilot-prompts button { padding: 7px 10px; color: var(--text); background: var(--surface-soft); border-color: var(--border); font-size: 11px; }
.copilot-prompts button:hover { border-color: var(--blue); color: var(--blue); }
.copilot-history { display: grid; gap: 9px; max-height: 48vh; min-height: 110px; overflow: auto; padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-soft); }
.copilot-turn { max-width: 92%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); color: var(--text); }
.copilot-turn.owner { justify-self: end; background: var(--surface-raised); }
.copilot-turn small { display: block; margin-bottom: 5px; color: var(--muted); font-size: 10px; }
.copilot-turn pre, .copilot-response { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); font: inherit; font-size: 12px; line-height: 1.55; }
.copilot-form { display: grid; gap: 6px; }
.copilot-form textarea { min-height: 70px; resize: vertical; color: var(--text); background: var(--surface-soft); border-color: var(--border); }
#kasim-copilot-result { margin: 0; padding: 14px; }
#kasim-copilot-result .section-kicker { margin: 0 0 7px; color: var(--muted); font-size: 10px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.kasim-floating-button { position: fixed; right: 22px; bottom: 20px; z-index: 80; min-height: 42px; padding: 9px 15px; color: #071927; background: linear-gradient(110deg,#65d4ec,#52aef0); border: 1px solid #65d4ec; border-radius: 999px; box-shadow: 0 8px 24px #0007; font-weight: 760; }
.kasim-floating-button:hover { color: #03111c; background: #8be7f1; transform: translateY(-1px); }
.kasim-floating-button[aria-expanded="true"] { box-shadow: 0 0 0 3px #58d4e944,0 8px 24px #0007; }
.right-workspace-layer { position: fixed; inset: 0; z-index: 1001; pointer-events: none; }
.right-workspace-backdrop { position: absolute; inset: 0; background: #02071188; backdrop-filter: blur(2px); pointer-events: auto; animation: drawer-fade .16s ease-out; }
.right-workspace-drawer { position: absolute; inset: 0 0 0 auto; display: flex; flex-direction: column; width: min(420px,100vw); min-width: 0; color: var(--text); background: var(--surface); border-left: 1px solid var(--border-strong); box-shadow: -20px 0 50px #0006; pointer-events: auto; transform: translateX(0); transition: width .18s ease,transform .18s ease,visibility .18s ease; }
.right-workspace-layer.is-expanded .right-workspace-drawer { width: min(680px,calc(100vw - 28px)); }
.right-workspace-layer.is-minimized .right-workspace-backdrop { visibility: hidden; opacity: 0; pointer-events: none; }
.right-workspace-layer.is-minimized .right-workspace-drawer { visibility: hidden; transform: translateX(102%); pointer-events: none; }
.right-workspace-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 63px; padding: 12px 15px; background: var(--surface-raised); border-bottom: 1px solid var(--border); }
.right-workspace-head>div:first-child { display: grid; gap: 4px; min-width: 0; }
.right-workspace-head strong { color: var(--text); font-size: 14px; letter-spacing: -.02em; }
.copilot-gateway-status { color: var(--green); font-size: 10px; }
.copilot-gateway-status.unavailable { color: var(--amber); }
.right-workspace-controls { display: flex; gap: 4px; }
.copilot-overflow-menu { position: relative; }
.copilot-overflow-menu summary { display: grid; width: 32px; min-width: 32px; min-height: 31px; place-items: center; color: var(--muted); border: 1px solid transparent; border-radius: 7px; cursor: pointer; font-size: 18px; line-height: 1; list-style: none; }
.copilot-overflow-menu summary::-webkit-details-marker { display: none; }
.copilot-overflow-menu summary:hover,.copilot-overflow-menu[open] summary { color: var(--text); background: var(--surface-soft); border-color: var(--border); }
.copilot-overflow-items { position: absolute; z-index: 4; top: calc(100% + 5px); right: 0; display: grid; width: 176px; padding: 5px; background: var(--surface-raised); border: 1px solid var(--border-strong); border-radius: 9px; box-shadow: 0 10px 28px #0008; }
.copilot-overflow-items button { min-height: 33px; padding: 7px 9px; color: var(--text); background: transparent; border: 0; text-align: left; font-size: 11px; }
.copilot-overflow-items button:hover { background: var(--surface-soft); }
.copilot-reset-confirm { position: absolute; z-index: 5; inset: 0; display: grid; place-items: center; padding: 16px; background: #02071199; }
.copilot-reset-card { width: min(340px,100%); padding: 16px; color: var(--text); background: var(--surface-raised); border: 1px solid var(--border-strong); border-radius: 12px; box-shadow: 0 18px 44px #0009; }
.copilot-reset-card strong { font-size: 13px; }
.copilot-reset-card p { margin: 8px 0 14px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.copilot-reset-card>div { display: flex; justify-content: flex-end; gap: 7px; }
.right-workspace-controls button { width: 32px; min-width: 32px; min-height: 31px; padding: 3px; color: var(--muted); background: transparent; border-color: transparent; font-size: 17px; }
.right-workspace-controls button:hover { color: var(--text); background: var(--surface-soft); border-color: var(--border); }
.copilot-context-chip { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 11px 13px 0; padding: 7px 9px 7px 11px; color: #d4eafa; background: #15324a; border: 1px solid #275273; border-radius: 999px; font-size: 10px; }
.copilot-context-chip span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.copilot-context-chip button { flex: 0 0 auto; width: 21px; min-width: 21px; min-height: 21px; padding: 0; color: #a9d7ef; background: transparent; border: 0; border-radius: 50%; font-size: 15px; line-height: 1; }
.copilot-context-chip button:hover { background: #285674; }
.right-workspace-tabs { display: flex; gap: 4px; padding: 9px 13px 0; border-bottom: 1px solid var(--border); }
.right-workspace-tabs button { min-height: 32px; padding: 7px 12px; color: var(--muted); background: transparent; border-color: transparent; border-radius: 7px 7px 0 0; font-size: 11px; }
.right-workspace-tabs button.active { color: var(--text); background: var(--surface-soft); border-color: var(--border); border-bottom-color: var(--surface-soft); }
.right-workspace-content { position: relative; display: flex; flex: 1; min-height: 0; overflow: hidden; }
.copilot-drawer-panel { display: flex; flex: 1; min-width: 0; min-height: 0; flex-direction: column; gap: 6px; padding: 9px 11px; }
.copilot-drawer-policy { display: flex; min-height: 24px; align-items: center; gap: 4px; padding: 3px 8px; color: var(--muted); background: transparent; border: 0; border-radius: 7px; }
.copilot-drawer-policy span { color: var(--cyan); font-size: 10px; font-weight: 700; }
.copilot-drawer-policy small { font-size: 10px; line-height: 1.4; }
.copilot-drawer-prompts { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.copilot-prompt-chip { display: inline-flex; align-items: center; overflow: hidden; border: 1px solid var(--border); border-radius: 999px; background: var(--surface-soft); }
.copilot-prompt-chip button { min-height: 27px; padding: 4px 7px; color: #c7deed; background: transparent; border: 0; font-size: 9px; }
.copilot-prompt-chip button:first-child { max-width: 124px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.copilot-prompt-chip button:last-child { min-width: 19px; width: 19px; padding: 0; color: var(--muted); font-size: 13px; }
.copilot-prompt-chip button:last-child:hover { color: #ffb4a9; background: #432729; }
.copilot-prompt-add,.copilot-prompt-more { min-height: 27px; min-width: 28px; padding: 3px 7px; color: var(--muted); background: transparent; border: 1px dashed var(--border-strong); border-radius: 999px; font-size: 10px; }
.copilot-prompt-add:hover,.copilot-prompt-more:hover { color: var(--cyan); border-color: var(--cyan); }
.copilot-drawer-prompts button { min-height: 29px; padding: 5px 8px; color: #c7deed; background: var(--surface-soft); border-color: var(--border); border-radius: 999px; font-size: 10px; }
.copilot-drawer-prompts button:hover { color: var(--cyan); border-color: #35769a; }
.copilot-drawer-suggestions { display: grid; gap: 5px; }
.copilot-drawer-suggestions>small { color: var(--muted); font-size: 9px; }
.copilot-suggestion-list { display: flex; gap: 5px; overflow-x: auto; scrollbar-width: thin; }
.copilot-suggestion-list button { flex: 0 0 auto; min-height: 26px; padding: 4px 7px; color: #b8d5e6; background: transparent; border: 1px solid var(--border); border-radius: 999px; font-size: 9px; white-space: nowrap; }
.copilot-suggestion-list button:hover { color: var(--cyan); border-color: #35769a; }
.copilot-drawer-history { display: flex; flex: 1; min-height: 0; flex-direction: column; align-items: stretch; gap: 8px; overflow: auto; padding: 3px 2px; scroll-behavior: smooth; }
.copilot-drawer-empty { margin: auto 10px; color: var(--muted); font-size: 11px; line-height: 1.55; text-align: center; }
.copilot-discovery { display: grid; gap: 7px; margin: 2px 1px; }
.copilot-discovery>strong { color: var(--text); font-size: 12px; }
.copilot-discovery>p { margin: -3px 0 1px; color: var(--muted); font-size: 10px; }
.copilot-discovery-categories { display: grid; gap: 4px; }
.copilot-discovery-categories details { border: 1px solid var(--border); border-radius: 7px; background: var(--surface-soft); }
.copilot-discovery-categories summary { padding: 6px 8px; color: #c9e1ef; cursor: pointer; font-size: 10px; list-style-position: inside; }
.copilot-example-list { display: grid; gap: 3px; padding: 0 6px 6px; }
.copilot-example-list button { width: 100%; min-height: 26px; padding: 5px 7px; color: var(--muted); background: transparent; border: 0; border-radius: 5px; text-align: left; font-size: 10px; }
.copilot-example-list button:hover { color: var(--cyan); background: var(--surface-raised); }
.copilot-drawer-turn { max-width: 92%; align-self: start; padding: 9px 11px; color: var(--text); background: var(--surface-soft); border: 1px solid var(--border); border-radius: 11px 11px 11px 3px; }
.copilot-drawer-turn.owner { align-self: end; background: #15334b; border-color: #285273; border-radius: 11px 11px 3px 11px; }
.copilot-drawer-turn small { display: block; margin-bottom: 4px; color: var(--muted); font-size: 9px; }
.copilot-drawer-turn p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 11px; line-height: 1.5; }
.copilot-navigation-button { display: block; min-height: 25px; margin: 7px 0 0; padding: 4px 8px; color: var(--cyan); background: #163249; border: 1px solid #285273; border-radius: 7px; font-size: 9px; text-align: left; }
.copilot-navigation-button:hover { background: #1c405c; }
.copilot-prompt-editor { position: absolute; z-index: 8; inset: 0; display: grid; place-items: center; padding: 18px; background: #020711a8; }
.copilot-prompt-editor.hidden { display: none; }
.copilot-prompt-editor form { display: grid; gap: 10px; width: min(360px,100%); padding: 16px; color: var(--text); background: var(--surface-raised); border: 1px solid var(--border-strong); border-radius: 11px; box-shadow: 0 14px 38px #0009; }
.copilot-prompt-editor strong { font-size: 13px; }
.copilot-prompt-editor label { display: grid; gap: 5px; color: var(--muted); font-size: 10px; }
.copilot-prompt-editor input,.copilot-prompt-editor textarea { width: 100%; padding: 8px; color: var(--text); background: var(--surface-soft); border: 1px solid var(--border); border-radius: 6px; font: inherit; font-size: 11px; }
.copilot-prompt-editor textarea { min-height: 68px; resize: vertical; }
.copilot-prompt-editor form>div { display: flex; justify-content: flex-end; gap: 7px; }
.copilot-prompt-editor form button { min-height: 30px; padding: 5px 9px; font-size: 10px; }
.copilot-drawer-status { flex: 0 0 auto; margin: 0; padding: 8px 10px; color: var(--muted); background: var(--surface-soft); border-radius: 7px; font-size: 10px; }
.copilot-drawer-status.bad { color: #ffb4a9; background: #392323; }
.copilot-drawer-form { position: sticky; bottom: 0; flex: 0 0 auto; margin-top: auto; padding: 8px 0 0; background: var(--surface); border-top: 1px solid var(--border); }
.copilot-drawer-input-row { display: flex; align-items: end; gap: 8px; }
.copilot-drawer-input-row textarea { min-height: 40px; max-height: 130px; flex: 1; resize: vertical; padding: 9px 10px; color: var(--text); background: var(--surface-soft); border-color: var(--border); font-size: 11px; }
.copilot-drawer-input-row button { min-width: 54px; min-height: 38px; padding: 7px 10px; font-size: 10px; }
.right-workspace-detail-slot { position: relative; flex: 1; min-width: 0; min-height: 0; overflow: hidden; }
.right-workspace-detail-slot .drawer-scrim { display: none; }
.right-workspace-detail-slot .side-drawer { position: absolute; inset: 0; width: 100%; border: 0; box-shadow: none; animation: none; }
@keyframes drawer-fade { from { opacity: 0; } to { opacity: 1; } }
@media(max-width:720px) {
  .copilot-policy { flex-direction: column; }
  .copilot-context { max-width: none; width: 100%; }
  .copilot-turn { max-width: 100%; }
  .copilot-history { max-height: 45vh; }
}
@media(max-width:560px) {
  .kasim-floating-button { right: 14px; bottom: 14px; }
  .right-workspace-drawer,.right-workspace-layer.is-expanded .right-workspace-drawer { width: 100vw; }
  .right-workspace-head { min-height: 57px; padding: 10px 12px; }
  .copilot-drawer-panel { padding: 10px; }
  .copilot-drawer-turn { max-width: 96%; }
}
