
/* Progressive disclosure: shared desktop and mobile controls. */
.intent-bar { display: none; }
  .mobile-intent-picker {
    display: block;
  }
  .mobile-intent-trigger {
    width: 100%;
    min-height: 48px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 20px;
    align-items: center;
    gap: 10px;
    padding: 7px 11px 7px 13px;
    color: #3d3545;
    background: #fbfafc;
    border: 1px solid #d8d2df;
    border-radius: 8px;
    font: inherit;
    text-align: left;
    cursor: pointer;
  }
  .mobile-intent-trigger:hover { border-color: #c8bfda; background: #f8f6fb; }
  .mobile-intent-trigger:focus-visible {
    outline: 2px solid rgba(91, 50, 214, .34);
    outline-offset: 2px;
  }
  .mobile-intent-trigger-copy { min-width: 0; display: flex; align-items: baseline; gap: 7px; }
  .mobile-intent-trigger-copy strong {
    overflow: hidden;
    color: #3c3544;
    font-size: 13px;
    font-weight: 650;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .mobile-intent-trigger-copy small {
    flex: 0 0 auto;
    color: #776f7d;
    font-size: 10.5px;
    line-height: 1.3;
  }
  .mobile-intent-trigger svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: #746c7a;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 150ms ease;
  }
  .mobile-intent-picker.is-open .mobile-intent-trigger svg { transform: rotate(180deg); }
  .mobile-intent-listbox {
    position: absolute;
    z-index: 20;
    right: 0;
    bottom: calc(100% + 8px);
    left: 0;
    display: grid;
    gap: 2px;
    padding: 6px;
    color: #3d3545;
    background: #fff;
    border: 1px solid #d8d2df;
    border-radius: 10px;
    box-shadow: 0 16px 38px rgba(49, 40, 61, .18);
    animation: mobile-intent-listbox-in 150ms cubic-bezier(.22, 1, .36, 1) both;
  }
  .mobile-intent-listbox[hidden] { display: none; }
  .mobile-intent-option {
    position: relative;
    min-height: 46px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 8px 11px 8px 14px;
    border-radius: 7px;
    cursor: pointer;
  }
  .mobile-intent-option::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 5px;
    width: 3px;
    height: 18px;
    background: transparent;
    border-radius: 999px;
    transform: translateY(-50%);
  }
  .mobile-intent-option span { font-size: 13px; font-weight: 590; line-height: 1.35; }
  .mobile-intent-option small { color: #78717e; font-size: 10.5px; line-height: 1.3; }
  .mobile-intent-option:hover,
  .mobile-intent-option:focus-visible { background: #f5f2f9; outline: none; }
  .mobile-intent-option[aria-selected="true"] { color: var(--violet); background: #f0ecfb; }
  .mobile-intent-option[aria-selected="true"]::before { background: var(--violet); }
  .mobile-intent-option[aria-selected="true"] small { color: #6c55ae; }
  .mobile-intent-option:focus-visible { box-shadow: inset 0 0 0 2px rgba(91, 50, 214, .26); }

.intent-fieldset legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.mobile-intent-picker { max-width: 360px; }
.mobile-intent-listbox { max-height: min(340px, 55vh); overflow-y: auto; }
.composer-tools { position: relative; flex: 0 0 auto; }
.composer-tools > summary { list-style: none; display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid #d5cde1; border-radius: 12px; color: #51446c; background: #f7f4fc; cursor: pointer; font-size: 30px; line-height: 1; }
.composer-tools > summary::-webkit-details-marker { display: none; }
.composer-tools-panel { position: absolute; left: 0; bottom: calc(100% + 8px); z-index: 30; display: grid !important; gap: 4px; width: 220px; max-height: 45vh; overflow-y: auto; padding: 8px; border: 1px solid #d5cde1; border-radius: 14px; background: white; box-shadow: 0 12px 36px #30253d26; }
.assistant-composer .composer-tools-panel button { text-align: left; width: 100%; margin: 0; background: white; border-color: transparent; }
.assistant-composer .composer-tools-panel button:hover { background: #f2edf9; }
.composer-tools :focus-visible, .avatar-picker-dialog :focus-visible { outline: 2px solid #7651df; outline-offset: 2px; }
.profile-settings .profile-avatar-trigger { padding: 0; border-radius: 50%; border: 2px solid #e3dced; }
.avatar-picker-dialog { box-sizing: border-box; width: min(440px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow-y: auto; padding: 24px; border: 1px solid #d8d0e1; border-radius: 20px; color: #3d3545; background: #fff; box-shadow: 0 24px 80px #24203230; }
.avatar-picker-dialog::backdrop { background: #24203277; }
.avatar-picker-dialog header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.avatar-picker-dialog h2 { margin: 0; font-size: 22px; }
.avatar-picker-dialog button { min-height: 44px; padding: 8px 12px; border: 1px solid #d8d0e1; border-radius: 10px; color: #554766; background: #faf8fc; font: inherit; cursor: pointer; }
.avatar-picker-dialog button:disabled { opacity: .5; cursor: wait; }
.avatar-picker-dialog fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.avatar-picker-dialog legend { margin-bottom: 10px; font-size: 14px; }
.avatar-large { width: 160px; height: 160px; margin: 24px auto; }
.avatar-large svg { width: 100px; height: 100px; }
.avatar-presets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px; }
.avatar-presets button { display: grid; justify-items: center; align-content: center; gap: 8px; font-size: 13px; }
.avatar-presets img { width: 44px; height: 44px; object-fit: cover; border-radius: 50%; }
#avatar-picker-status { font-size: 13px; line-height: 1.6; }
#profile-avatar-apply { width: 100%; color: white; background: #5b32d6; border-color: #5b32d6; }
@media (prefers-reduced-motion: reduce) { .mobile-intent-listbox { animation: none; } .mobile-intent-trigger svg { transition: none; } }

.world-composer-tools { display: flex; align-items: center; gap: 10px; }
.world-composer-tools .intent-fieldset { flex: 1; min-width: 0; margin: 0; }
.world-composer-tools .composer-tools-panel button { min-height: 44px; padding: 8px 12px; border: 0; border-radius: 8px; color: #51446c; background: #f7f4fc; font: inherit; text-align: left; cursor: pointer; }
.attachment-picker-dialog { width: min(640px, calc(100vw - 32px)); }
.attachment-picker-dialog .attachment-panel { margin: 16px 0 0; padding: 0; border: 0; }
body:not(.platform-home-active):has(#composer:not([hidden])) .platform-kairil { bottom: calc(var(--composer-height, 180px) + 24px); }

.document-help { margin: 12px 0; font-size: 13px; }
.document-help > summary { min-height: 44px; display: flex; align-items: center; gap: 8px; color: #6044a4; cursor: pointer; list-style: none; }
.document-help > summary::-webkit-details-marker { display: none; }
.document-help > summary::before { content: "+"; font-size: 20px; }
.document-help[open] > summary::before { content: "−"; }
.document-help > summary:focus-visible { outline: 2px solid #7651df; outline-offset: 2px; border-radius: 6px; }
.document-help > p { padding: 12px; border-left: 2px solid #d9cfed; background: #faf8fd; }

.proposal-actions { align-items: flex-start; }
.proposal-actions > .document-help { margin: 0; }
.proposal-actions > .document-help > button { margin: 0 4px 6px 0; }

#world-release-create-button { min-height: 44px; padding: 10px 16px; border: 1px solid var(--violet); border-radius: 9px; color: white; background: var(--violet); font: inherit; cursor: pointer; }
#world-release-create-button:disabled { opacity: .5; cursor: not-allowed; }

@media (max-width: 700px) {
  body.platform-home-active .platform-home { bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
  body.platform-home-active .platform-kairil {
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    height: calc(64px + env(safe-area-inset-bottom, 0px));
    padding: 4px 16px calc(4px + env(safe-area-inset-bottom, 0px));
    align-items: center;
    justify-content: flex-end;
    background: #fbfbfa;
    border-top: 1px solid #e7e3e9;
  }
  body.platform-home-active .platform-kairil .platform-kairil-character {
    display: flex;
    align-items: center;
    gap: 8px;
    width: auto;
    height: 56px;
  }
  body.platform-home-active .platform-kairil-character > img { width: 44px; height: 52px; }
  body.platform-home-active .platform-kairil-character > span { font-size: 14px; padding: 8px 14px; }
  .app-shell > .titlebar { position: relative; z-index: 31; }
  .project-sidebar { top: calc(var(--platform-header-height) + var(--titlebar-height)); }
  body.platform-workbench-active:has(#welcome-view:not([hidden])) .platform-kairil {
    top: calc(var(--platform-header-height) + 4px);
    right: 12px;
    bottom: auto;
  }
  body.platform-workbench-active:has(#welcome-view:not([hidden])) .platform-kairil-character {
    width: 64px;
    height: 44px;
    align-items: center;
  }
  body.platform-workbench-active:has(#welcome-view:not([hidden])) .platform-kairil-character > img { display: none; }
  body.platform-workbench-active:has(#welcome-view:not([hidden])) .platform-kairil-character > span {
    display: grid;
    place-items: center;
    width: 64px;
    height: 44px;
    padding: 0;
    border-radius: 8px;
    font-size: 13px;
  }
}

.identity-modal { box-sizing: border-box; width: min(440px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow: auto; padding: 24px; border: 1px solid #d8d0e1; border-radius: 20px; color: #3d3545; background: #fff; box-shadow: 0 24px 80px #24203230; }
.identity-modal::backdrop { background: #24203277; }
.identity-modal header { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:20px; }
.identity-modal h2 { margin:0; font-size:22px; }
.identity-modal form { display:grid; gap:12px; }
.identity-modal button, .identity-settings-card button { min-height:44px; padding:10px 16px; border:1px solid #d8d0e1; border-radius:10px; background:#faf8fc; color:#554766; font:inherit; cursor:pointer; }
.identity-modal input { box-sizing:border-box; width:100%; min-height:44px; padding:10px 12px; border:1px solid #c8bed4; border-radius:10px; font:inherit; }
.identity-modal button:disabled { opacity:.55; cursor:wait; }
.identity-modal :focus-visible { outline:2px solid #7651df; outline-offset:2px; }
.identity-modal .identity-provider, #identity-manage-submit { width:100%; color:#fff; background:#5831dc; border-color:#5831dc; }
.identity-settings-card { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:18px; }
.identity-settings-card[hidden] { display:none; }
.identity-settings-card h3 { margin:0; font-size:16px; }
.identity-settings-card p, #identity-manage-account { margin:8px 0; font-size:14px; overflow-wrap:anywhere; }
@media(max-width:480px) { .identity-settings-card { flex-wrap:wrap; } }

#world-document-subtitle:empty { display: none; }
.check-record-details dd { overflow-wrap: anywhere; white-space: normal; }
.check-record-details .validation-baseline-details > div:first-child { grid-column: 1 / -1; }
