/* Shared menus: Select (single choice) and the generic menu panel. Loaded last so it wins over page styles.
   Layout never changes on hover, focus or open: the panel is absolutely positioned and only colours change. */
.select-menu{position:relative;min-width:0}
.select-menu>summary{list-style:none}
.select-menu>summary::-webkit-details-marker{display:none}
.select-trigger{display:flex;align-items:center;gap:8px;min-width:0;min-height:38px;padding:0 10px 0 12px;border:1px solid var(--control-border);border-radius:8px;background:var(--surface);color:var(--text);font-size:13px;font-weight:600;line-height:1.2;cursor:pointer;user-select:none;transition:border-color .12s,background-color .12s}
.select-trigger:hover{background:var(--control-soft);border-color:var(--control-border-strong,var(--control-border))}
.select-menu[open]>.select-trigger{border-color:var(--ink);background:var(--surface)}
.select-trigger:focus-visible{outline:2px solid var(--focus);outline-offset:2px}
.select-value{min-width:0;flex:1 1 auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.select-chevron{flex:none;width:14px;height:14px;background:var(--muted);-webkit-mask:url('/icons/chevron-down.svg') center/contain no-repeat;mask:url('/icons/chevron-down.svg') center/contain no-repeat;transition:transform .12s}
.select-menu[open]>.select-trigger .select-chevron{transform:rotate(180deg)}
.select-panel,.menu-panel{position:absolute;z-index:60;top:calc(100% + 6px);left:0;min-width:100%;width:max-content;max-width:min(320px,calc(100vw - 24px));max-height:min(320px,60vh);overflow-y:auto;padding:4px;border:1px solid var(--control-border-strong,var(--control-border));border-radius:10px;background:var(--surface);box-shadow:0 14px 36px rgba(30,34,25,.16)}
.select-up .select-panel{top:auto;bottom:calc(100% + 6px)}
.select-option,.menu-item{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;min-height:40px;padding:0 10px;border:0;border-radius:7px;background:transparent;color:var(--text);font-size:13px;font-weight:500;text-align:left;cursor:pointer}
.select-option:hover,.select-option:focus-visible,.menu-item:hover,.menu-item:focus-visible{background:var(--control-soft);outline:none}
.select-option[aria-selected="true"]{font-weight:700}
.select-option-label{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.select-check{flex:none;width:14px;height:14px}
.select-option[aria-selected="true"] .select-check{background:var(--ink);-webkit-mask:url('/icons/check.svg') center/contain no-repeat;mask:url('/icons/check.svg') center/contain no-repeat}
.menu-item[hidden]{display:none}
.menu-item.danger{color:var(--danger,#b3261e)}
@media(max-width:860px){.select-option,.menu-item{min-height:44px}}
@media(prefers-reduced-motion:reduce){.select-trigger,.select-chevron{transition:none}}

/* Table filters and page size. */
.data-table-filter{min-width:160px;max-width:240px;flex:0 1 200px}
.data-table-filter .select-menu,.data-table-filter .select-trigger{width:100%}
.data-table-rows{display:inline-flex;align-items:center;gap:8px;color:var(--muted);font-size:12px}
.data-table-rows .select-trigger{min-height:34px;padding:0 8px 0 10px;font-size:12px}
.data-table-rows .select-panel{min-width:72px}
@media(max-width:760px){.data-table-filter{max-width:none;min-width:0;flex:1 1 0}.data-table-filter .select-trigger{min-height:44px}.data-table-rows .select-trigger{min-height:44px}}

/* Chat header. */
.chat-header{gap:10px}
.chat-title-wrap h2{font-size:15px}
.chat-context{gap:8px;flex:none}
.chat-context .select-trigger,.chat-context .chat-chip{min-height:36px;height:36px;padding:0 10px;border-radius:8px;font-size:12.5px}
.chat-context .chat-chip{display:flex;align-items:center;gap:8px;border:1px solid var(--control-border);background:var(--surface)}
.chat-context .chat-chip[hidden]{display:none}
.chat-context .chat-chip:hover{background:var(--surface)}
.chat-context .select-menu{max-width:200px}
.chat-context .select-panel,.chat-context .menu-panel{left:auto;right:0}
.chat-more-menu{position:relative}
.chat-more-menu>summary{list-style:none}
.chat-more-menu>summary::-webkit-details-marker{display:none}
.chat-more-menu .menu-panel{min-width:180px}
.chat-context .chat-more-menu>.icon-button{display:grid;place-items:center;width:36px;height:36px;padding:0;border:1px solid var(--control-border);border-radius:8px;background:var(--surface);cursor:pointer}
.chat-context .chat-more-menu[open]>.icon-button,.chat-context .chat-more-menu>.icon-button:hover{border-color:var(--ink)}
.chat-more-menu>.icon-button:focus-visible{outline:2px solid var(--focus);outline-offset:2px}
.chat-options-button{--chat-icon:url('/icons/settings.svg')}
.chat-context .chat-online-dot{flex:none}
@media(max-width:860px){
  .chat-context{width:100%;gap:8px}
  .chat-context .select-menu,.chat-context .chat-chip{flex:1 1 0;max-width:none}
  .chat-context .chat-more-menu{flex:none;margin-left:0}
  .chat-context .select-trigger,.chat-context .chat-chip{height:44px;min-height:44px}
  .chat-context .chat-more-menu>.icon-button{width:44px;height:44px}
  .chat-context .select-menu:first-child .select-panel{left:0;right:auto}
  .chat-context .select-panel{width:max(100%,220px)}
}

/* Composer: one line when empty, grows with the text, send button inside the box. */
.chat-composer{padding-bottom:16px}
.chat-hint{max-width:none;min-height:0;margin:0 0 6px;padding:0 4px;color:var(--muted);font-size:12.5px;text-align:left}
.chat-hint:empty{display:none}
.chat-input-box{display:flex;align-items:flex-end;gap:8px;padding:6px 6px 6px 4px}
#tab-chat .chat-input-box textarea{flex:1 1 auto;width:auto;min-width:0;min-height:40px;max-height:200px;padding:9px 12px;border-radius:12px;overflow-y:auto}
.chat-input-row{flex:none;padding:0}
.chat-send-group{margin:0}
.chat-send{width:40px;height:40px}
@media(max-width:860px){.chat-hint{display:block}.chat-hint:empty{display:none}.chat-send{width:44px;height:44px}}

/* Chat list header: New chat fills the row. */
.chat-history-head{gap:8px}
.chat-new-button{justify-content:center}
@media(max-width:860px){.chat-history-head{padding-right:0}.chat-history-close{flex:none}}

/* Sidebar mode switch without a helper line. */
.sidebar-mode{gap:6px;padding:4px 4px 12px;margin-bottom:8px}

/* Setup guide: every step starts at the same height, so the heading never jumps between screens. */
.wizard-step{align-items:flex-start;padding:clamp(24px,9vh,88px) 0 24px}
.wizard-center{gap:18px}
.wizard-request{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;overflow:hidden;font-size:12.5px;color:var(--muted)}
.wizard-choice{position:relative}
.wizard-choice em{position:absolute;top:10px;right:10px;margin:0}
.wizard-actions .button.primary{min-width:200px}
@media(max-width:560px){.wizard-step{padding-top:28px}.wizard-actions .button.primary{width:100%}}
.wizard-status:empty{display:none}
@media(max-width:560px){.wizard-actions{width:100%;flex-direction:column;align-items:stretch}.wizard-actions .button{width:100%}}
.chat-list{flex:0 1 auto}
.chat-history{box-shadow:none}
.chat-layout.history-open .chat-history{box-shadow:0 20px 50px rgba(30,34,25,.16)}

/* Sign-in: centred without a stray scrollbar; every provider row has the same icon column. */
.auth-view{min-height:100vh;min-height:100dvh;box-sizing:border-box;padding:24px 16px}
.auth-provider{font-weight:650}
.auth-provider span{text-align:center}
@media(max-width:480px){.auth-view{justify-content:center;padding:20px 14px}}

/* Automations: the secondary actions live in one More menu. */
.skills-more-menu{position:relative}
.skills-more-menu>summary{list-style:none;display:inline-flex;align-items:center;gap:6px;cursor:pointer}
.skills-more-menu>summary::-webkit-details-marker{display:none}
.skills-more-menu .menu-panel{left:auto;right:0;min-width:200px}
.skills-more-menu[open]>summary .select-chevron{transform:rotate(180deg)}

/* Settings: profile picture actions. */
.avatar-actions{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.avatar-upload{position:relative;display:inline-flex;align-items:center;justify-content:center;cursor:pointer}
.avatar-upload:focus-within{outline:2px solid var(--focus);outline-offset:2px}
.avatar-upload[aria-disabled="true"]{opacity:.55;cursor:not-allowed}
.avatar-note{display:block;margin-top:6px;color:var(--muted);font-size:12px}

/* Collapsible blocks show a chevron so they read as controls. */
.task-try>summary{list-style:none;display:flex;align-items:center;gap:8px;cursor:pointer}
.task-try>summary::-webkit-details-marker{display:none}
.task-try>summary::after{content:"";width:14px;height:14px;background:var(--muted);-webkit-mask:url('/icons/chevron-down.svg') center/contain no-repeat;mask:url('/icons/chevron-down.svg') center/contain no-repeat;transition:transform .12s}
.task-try[open]>summary::after{transform:rotate(180deg)}

/* Dialog headers: the title is enough, no small-caps category line above it. */
dialog .dialog-head .eyebrow{display:none}
.connected-app-card .text-button .ext{margin-left:2px}

/* Task details: nothing smaller than 12px, so the dialog reads comfortably. */
.task-review-summary strong,.task-evidence-section-head strong,.task-evidence-timeline li>div:last-child>span,.task-evidence-more>summary,.task-evidence-audit summary,.task-evidence-result strong,.task-evidence-empty strong{font-size:13px}
.task-evidence-result p,.task-evidence-retention p,.task-evidence-muted,.task-evidence-empty p,.task-evidence-timeline p,.task-evidence-result small,.task-evidence-more>summary small,.task-evidence-audit dt,.task-evidence-audit dd,.task-evidence-proof li,.task-evidence-proof li strong,.task-evidence-scope span{font-size:12px}
.task-review-summary span,.task-review-summary dt{font-size:11px}

/* Settings share the app's page width. */
.profile-page.settings-page{max-width:none}
.analytics-page-heading{justify-content:flex-end}
.metrics-window{min-width:190px}
.perm-ask-title::before{content:none!important}
@media(max-width:860px){#tab-permissions{--perm-col:104px}#tab-permissions .perm-use-name{display:inline}#tab-permissions .perm-mode-use,#tab-permissions .perm-mode-active{font-size:11px;height:28px;white-space:nowrap}}
/* The closed mobile drawer casts no shadow onto the page. */
@media(max-width:860px){.app-sidebar{box-shadow:none}body.sidebar-open .app-sidebar{box-shadow:0 20px 50px rgba(30,34,25,.16)}}
body.auth-mode .shell{padding-bottom:0}
