.memory-dialog{width:min(860px,calc(100vw - 40px));height:min(720px,calc(100dvh - 48px));max-width:none;max-height:none;padding:0;border:1px solid #dce2eb;border-radius:20px;color:#202936;background:#fff;box-shadow:0 24px 90px #17244338}
.memory-dialog::backdrop{background:#16223840}
.memory-dialog #dialog-avatar{display:none!important}
.memory-dialog form{display:flex;flex-direction:column;height:100%;margin:0;min-height:0}
.memory-dialog header{display:flex;align-items:flex-start;gap:24px;padding:24px 28px 18px;border-bottom:1px solid #e6ebf2}
.memory-dialog h2{font-size:19px;margin:0 0 8px;overflow-wrap:anywhere}
.memory-dialog .helper{font-size:13px;line-height:1.7;margin:0;color:#647087}
.memory-dialog .memory-close{margin-left:auto;flex:none;font-size:24px;line-height:1;width:34px;height:34px;padding:0;border:0;background:transparent;color:#647087}
.memory-body{flex:1;min-height:0;overflow:auto;padding:24px 28px}
.memory-text{white-space:pre-wrap;overflow-wrap:anywhere;font-size:14px;line-height:1.85;margin:14px 0 24px}
.memory-empty{padding:36px 0;color:#647087;line-height:1.8}
.memory-empty h3{color:#202936;font-size:16px;margin:0 0 8px}
.memory-dialog label{display:block;font-size:14px;margin:0 0 12px}
.memory-dialog textarea{box-sizing:border-box;width:100%;min-height:300px;resize:vertical;font-family:inherit;font-size:14px;line-height:1.8;padding:14px;border:1px solid #cdd6e4;border-radius:9px;margin:0 0 12px}
.memory-dialog footer{display:flex;justify-content:flex-end;gap:10px;padding:16px 28px;border-top:1px solid #e6ebf2}
.memory-history{border-top:1px solid #e6ebf2;padding-top:18px}
.memory-history summary{cursor:pointer;padding:8px 0;font-size:13px;color:#647087}
.memory-history>details{padding:8px 0 12px}
#memory-error{color:#a12d35;font-size:13px;line-height:1.6}
#memory-status{color:#24784d;font-size:13px}
.memory-dialog :focus-visible{outline:2px solid #315efb;outline-offset:3px}
.memory-page{overflow:auto;padding:18px 24px 30px}
.content-shell:has(.panel-header [data-me-kind]){container-type:inline-size;container-name:memory-panel}
@container memory-panel (max-width:560px){.panel-header .inline-description{display:none}.panel-header .heading-actions{display:flex;flex-wrap:wrap;grid-column:1/-1;grid-row:2;margin-left:0}.panel-header .heading-line{display:grid;grid-template-columns:auto 1fr auto;height:auto;gap:8px}.panel-header .heading-actions button{font-size:12px;padding:7px 10px}}
.memory-tab-count{margin-left:7px;font-size:12px;color:#647087}
.memory-scope-note{color:#647087;font-size:13px;line-height:1.7;margin:0 0 16px}
.memory-row{border-bottom:1px solid #e6ebf2;padding:20px 0}
.memory-row:first-child{padding-top:6px}
.memory-row-heading,.memory-row-bottom{display:flex;align-items:center;gap:12px;justify-content:space-between}
.memory-row-heading{flex-wrap:wrap}
.memory-row-identity{display:flex;align-items:center;flex-wrap:wrap;min-width:0;gap:8px}
.memory-row-heading>.ui-detail-actions{flex:none}
.memory-entry-dialog header{justify-content:space-between;flex-wrap:wrap}
.memory-row-title{border:0;background:transparent;padding:0;text-align:left;font-size:16px;font-weight:600;overflow-wrap:anywhere;color:#202936}
.memory-row-heading .badge{flex-shrink:0}
.memory-row-preview{white-space:pre-wrap;overflow-wrap:anywhere;color:#475569;line-height:1.8;font-size:14px;margin:10px 0;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
.memory-row-bottom p{font-size:12px;color:#647087;overflow-wrap:anywhere;margin:0}
.memory-row-bottom span{display:flex;flex-shrink:0;gap:8px}
.memory-row-bottom button{font-size:12px;padding:6px 12px}
.memory-list-empty{padding:54px 16px;text-align:center;color:#647087}
.memory-list-empty h2{font-size:18px;color:#202936;margin:0 0 12px}
.memory-list-empty p{font-size:14px;line-height:1.8;margin:0 0 22px}
.memory-legacy{border:1px solid #dce2eb;padding:18px;margin-top:24px;border-radius:10px;font-size:13px;color:#647087}
.memory-entry-dialog input{box-sizing:border-box;display:block;width:100%;border:1px solid #cdd6e4;border-radius:8px;padding:10px 12px;font:inherit;margin:0 0 18px;background:#fff;color:#202936}
.memory-entry-dialog textarea{min-height:160px}
.memory-entry-dialog:has(#me-text){height:min(600px,calc(100dvh - 48px))}
.memory-entry-dialog .memory-body:has(#me-text){display:flex;flex-direction:column}
.memory-entry-dialog #me-text{flex:1}
#memory-entry-error:empty,#memory-entry-status:empty{display:none}
.memory-entry-dialog h3{font-size:15px;margin:20px 0 12px}
.memory-entry-meta{display:flex;align-items:center;gap:12px;color:#647087;font-size:13px}
.memory-sources article{border-top:1px solid #e6ebf2;padding:16px 0;font-size:14px;overflow-wrap:anywhere}
.memory-sources small{display:block;color:#647087;margin-top:6px}
.memory-sources p{white-space:pre-wrap;line-height:1.7;margin:8px 0 0}
.memory-reference{color:#647087;font-size:13px}
#memory-entry-error{color:#a12d35;font-size:13px;line-height:1.7}
@media(max-width:700px){.memory-page{padding:16px}.memory-row-heading{align-items:flex-start}.memory-row-bottom{align-items:flex-start;flex-direction:column}.memory-row-heading .badge{font-size:11px}}
@media(max-width:600px){.memory-dialog{width:calc(100vw - 24px);height:calc(100dvh - 24px);border-radius:14px}.memory-dialog header,.memory-body{padding:18px}.memory-dialog footer{padding:14px 18px}.memory-dialog textarea{min-height:240px}}
