@charset "UTF-8";
:root{--nav:#18283d;--sidebar-width:16rem;--page-gutter:clamp(24px,2.6vw,64px);--blue:#3465bd;--ink:#243147;--muted:#64748b;--line:#e2e7ee;--paper:#f6f8fb;--danger:#b43e43;--green:#35826d;--amber:#a46c22;font-family:Inter,"Segoe UI","Microsoft YaHei",sans-serif;color:var(--ink);font-size:15px;line-height:1.6;background:var(--paper)}
*{box-sizing:border-box}
html{width:100%;min-height:100%;background:var(--paper)}
body{margin:0;width:100%;min-height:100vh;min-height:100dvh;background:var(--paper);overflow-wrap:break-word}
button,input,select,textarea{font:inherit}
button,a,input,select,textarea{outline-offset:4px}
a{color:inherit;text-decoration:none}
button{cursor:pointer}
button:disabled{opacity:.5;cursor:not-allowed}
button,input,textarea,select{border-radius:6px}
button{transition:background .16s,transform .16s}
button:active{transform:translateY(1px)}
.sidebar{position:fixed;inset:0 auto 0 0;width:var(--sidebar-width);background:var(--nav);color:#a9b8cf;padding:30px 18px;overflow-y:auto;overscroll-behavior:contain;display:flex;flex-direction:column;z-index:20}
.brand{display:flex;gap:13px;align-items:center;padding:0 8px 34px;color:#fff;font-size:1.4667rem;font-weight:650;letter-spacing:.6px}
.brand small{display:block;font-size:0.8rem;letter-spacing:2px;font-weight:400;color:#96aac5;margin-top:3px}
.brand-mark{width:38px;height:38px;border:1px solid #6982a2;border-radius:12px;display:grid;place-items:center;font-size:1.3333rem}
.nav-label{font-size:0.8rem;letter-spacing:2px;padding:0 16px;margin:4px 0 12px;color:#6d829f}
nav a{display:flex;gap:13px;align-items:center;padding:11px 16px;border-radius:6px;margin:4px 0;color:#bac7da;transition:background .18s,color .18s}
nav a:hover{background:#213550;color:white}
nav a.active{background:#2b4264;color:#fff}
nav svg{width:17px;height:17px;opacity:.9}
.sidebar-bottom{margin-top:auto;padding:25px 12px 0;font-size:0.8rem;display:flex;gap:9px;flex-wrap:wrap;color:#9baec8;border-top:1px solid #2b3b51}
.sidebar-bottom a{display:block;width:100%;margin-top:7px}
.status-dot{width:6px;height:6px;border-radius:100%;background:#80bcae;margin-top:5px}
.workspace{margin-left:var(--sidebar-width);width:calc(100% - var(--sidebar-width));min-width:0;min-height:100vh;min-height:100dvh;display:flex;flex-direction:column}
.topbar{min-height:76px;background:#fff;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:14px var(--page-gutter);position:sticky;top:0;z-index:10}
.breadcrumb{font-size:0.9333rem;color:var(--muted)}
.breadcrumb span{padding:0 14px;color:#c0c8d3}
.breadcrumb strong{font-weight:500;color:var(--ink)}
.top-actions{display:flex;gap:20px;align-items:center}
#clock{font-size:0.8rem;color:var(--muted)}
main{width:100%;min-width:0;flex:1;margin:0;padding:36px var(--page-gutter) 48px}
.page-title{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;margin-bottom:29px}
h1{font-size:2rem;font-weight:650;letter-spacing:-.6px;margin:0 0 7px}
h2{font-size:1.2rem;font-weight:600;margin:0}
h3{font-size:1rem;margin:0 0 12px}
.subtitle,.muted{color:var(--muted);font-size:0.9333rem}
.page-title p{margin:0}
.button{background:var(--blue);color:white;border:1px solid var(--blue);min-height:40px;display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:9px 16px;white-space:nowrap;font-size:0.9333rem;font-weight:500}
.button:hover{background:#2853a1}
.button.quiet{background:white;color:#526178;border-color:var(--line)}
.button.quiet:hover{background:#edf2f8}
.button.danger{background:white;color:var(--danger);border-color:#edd6d7}
.button.small{padding:7px 12px}
.button.link{border:0;background:none;color:var(--blue);padding:6px 4px;min-height:36px}
.icon-button{border:0;background:transparent;color:var(--muted);font-size:1.6rem;padding:10px;width:44px;height:44px;flex-shrink:0;display:inline-grid;place-items:center}
.mobile-menu{display:none}
.notice{display:flex;gap:13px;align-items:center;background:#edf2fa;border-left:3px solid #6d8fc8;padding:15px 20px;margin-bottom:27px;color:#455e83;font-size:0.9333rem}
.notice .button{margin-left:auto}
.notice.warning{background:#fbf5e9;border-color:#c4a16b;color:#81612f}
.metrics{display:grid;grid-template-columns:repeat(4,1fr);background:#fff;border-top:1px solid var(--line);border-bottom:1px solid var(--line);margin-bottom:34px}
.metric{padding:25px 28px;border-right:1px solid var(--line)}
.metric:last-child{border:0}
.metric-label{font-size:0.9333rem;color:var(--muted)}
.metric-value{font-size:2.2667rem;font-weight:600;letter-spacing:-1px;margin:8px 0 0;font-variant-numeric:tabular-nums}
.two-columns{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(0,1fr);gap:35px}
.two-columns>section{min-width:0}
.section-heading{display:flex;align-items:center;justify-content:space-between;padding:0 0 15px;border-bottom:1px solid var(--line);margin-bottom:0}
.list-row{padding:16px 0;border-bottom:1px solid var(--line);display:flex;justify-content:space-between;align-items:center;gap:16px}
.list-row small{display:block;margin-top:4px;color:var(--muted);font-size:0.8rem}
.status{font-size:0.8rem;display:inline-flex;align-items:center;gap:6px;white-space:nowrap}
.status::before{content:"";width:5px;height:5px;border-radius:50%;background:currentColor}
.status.good{color:var(--green)}
.status.wait{color:var(--amber)}
.status.bad{color:var(--danger)}
.empty{padding:57px 28px;text-align:center;color:var(--muted)}
.empty-mark{font-size:2.0667rem;color:#b3c0d2;margin-bottom:10px}
.empty strong{display:block;color:#55657d;font-size:1rem;font-weight:500;margin-bottom:6px}
.empty p{font-size:0.9333rem;margin:0;max-width:420px;margin-inline:auto}
.toolbar{display:flex;align-items:center;gap:12px;margin-bottom:19px;flex-wrap:wrap}
.toolbar input,.toolbar select{min-width:210px}
.toolbar .grow{flex:1}
.table-wrap{overflow-x:auto;background:#fff;border-top:1px solid var(--line);border-bottom:1px solid var(--line)}
table{width:100%;border-collapse:collapse;text-align:left}
th{font-size:0.8rem;color:var(--muted);font-weight:500;background:#fafbfd;letter-spacing:.3px}
td,th{padding:15px 18px;border-bottom:1px solid var(--line)}
td{font-size:0.9333rem;vertical-align:top}
tr:last-child td{border-bottom:0}
tbody tr:hover{background:#f8faff}
.content-cell{max-width:760px;white-space:pre-wrap;overflow-wrap:anywhere}
.cell-sub{font-size:0.8rem;color:var(--muted);margin-top:5px}
.mono{font-family:Consolas,monospace;font-size:0.8rem;overflow-wrap:anywhere}
.tag{display:inline-block;font-size:0.8rem;padding:2px 7px;border-radius:4px;background:#edf1f7;color:#647791}
.actions{display:flex;gap:12px;white-space:nowrap}
.split-workspace{display:grid;grid-template-columns:265px minmax(0,1fr);min-height:560px;border:1px solid var(--line);background:white;border-radius:7px;overflow:hidden}
.chat-list{border-right:1px solid var(--line);background:#fbfcfe}
.chat-item{display:block;width:100%;text-align:left;border:0;border-bottom:1px solid var(--line);background:none;padding:18px 20px;color:var(--ink)}
.chat-item.active{background:#eaf0fa;box-shadow:inset 3px 0 var(--blue)}
.chat-item strong{display:block;font-size:0.9333rem;font-weight:500}
.chat-item small{font-size:0.8rem;color:var(--muted)}
.chat-content{min-width:0;padding:23px 27px}
.chat-top{display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--line);padding-bottom:18px;margin-bottom:22px}
.message{margin-bottom:22px}
.message-meta{display:flex;gap:12px;font-size:0.8rem;color:var(--muted);margin-bottom:7px}
.message-meta strong{font-weight:600;color:#4a6288}
.message-body{white-space:pre-wrap;overflow-wrap:anywhere;font-size:1rem;line-height:1.8}
.message.assistant{border-left:2px solid #d5e0f1;padding-left:16px}
.settings-layout{display:grid;grid-template-columns:190px minmax(0,860px);gap:40px}
.settings-layout form{min-width:0}
.settings-tabs{display:flex;flex-direction:column;gap:6px;position:sticky;top:100px;align-self:start}
.settings-tabs button{text-align:left;background:transparent;border:0;padding:11px 14px;color:var(--muted);font-size:0.9333rem}
.settings-tabs button.active{background:#e7edf6;color:#3d5b88}
.form-section{border-bottom:1px solid var(--line);padding-bottom:29px;margin-bottom:29px}
.form-section p{font-size:0.9333rem;color:var(--muted);margin:8px 0 23px}
.form-row{display:grid;grid-template-columns:170px 1fr;gap:25px;margin-top:20px;align-items:start}
.form-row>label{font-size:0.9333rem;padding-top:9px}
.field small{display:block;font-size:0.8rem;color:var(--muted);margin-top:7px}
.field input,.field select,.field textarea{width:100%}
input,select,textarea{border:1px solid #d7dfe9;background:#fff;padding:9px 11px;color:var(--ink);font-size:0.9333rem}
input:focus,select:focus,textarea:focus{border-color:#88a5d5;outline:2px solid #e4ecf9}
textarea{resize:vertical;line-height:1.8;min-height:120px}
.toggle-row{display:flex;justify-content:space-between;align-items:center;gap:20px;margin-top:20px}
.toggle-row strong{font-size:0.9333rem;font-weight:500}
.toggle-row small{display:block;font-size:0.8rem;color:var(--muted);margin-top:4px}
.toggle{appearance:none;width:36px;height:20px;background:#c9d1de;border:0;border-radius:20px;position:relative;cursor:pointer;padding:0;transition:background .18s}
.toggle::after{content:"";position:absolute;width:14px;height:14px;border-radius:100%;background:white;top:3px;left:3px;transition:transform .18s}
.toggle:checked{background:var(--blue)}
.toggle:checked::after{transform:translateX(16px)}
.form-actions{display:flex;gap:12px;justify-content:flex-end;margin-top:22px}
.diary-layout{display:grid;grid-template-columns:250px 1fr;border-top:1px solid var(--line)}
.diary-list{padding-right:25px;border-right:1px solid var(--line)}
.diary-page{padding:27px 35px;background:white;min-height:520px}
.diary-body{white-space:pre-wrap;font-size:1rem;line-height:2;max-width:760px}
.diary-date{font-size:0.8rem;letter-spacing:1px;color:var(--muted);margin-bottom:12px}
.drawer-shade{position:fixed;inset:0;background:#101d3340;z-index:30;animation:enter .16s}
.drawer{position:fixed;inset:0 0 0 auto;width:min(680px,100%);background:white;box-shadow:-10px 0 60px #152a4320;z-index:31;padding:28px 30px;overflow-y:auto;animation:slide .22s ease}
.drawer-title{display:flex;justify-content:space-between;align-items:center;margin-bottom:27px}
.source{border-left:2px solid #b5c8e4;padding:8px 16px;margin:19px 0;background:#f7f9fc}
.source p{white-space:pre-wrap;font-size:0.9333rem;line-height:1.8;margin:8px 0}
.source small{font-size:0.8rem;color:var(--muted)}
pre{white-space:pre-wrap;word-break:break-word;background:#f4f6fa;padding:16px;font-size:0.8rem;line-height:1.7}
.gallery-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:20px}
.gallery-item{border:0;padding:0;background:#fff;text-align:left;overflow:hidden;border-radius:7px}
.gallery-item img{width:100%;aspect-ratio:1;object-fit:contain;background:#eef1f5}
.gallery-item div{padding:11px;font-size:0.8rem}
.preview-image{max-width:100%;max-height:65vh;object-fit:contain}
.loading{height:260px;display:grid;place-items:center;color:var(--muted);font-size:0.9333rem}
.spinner{width:20px;height:20px;border:2px solid #e1e7ef;border-top-color:var(--blue);border-radius:100%;animation:spin .8s linear infinite}
#toast{position:fixed;bottom:28px;left:calc(50% + var(--sidebar-width)/2);transform:translateX(-50%);background:#243852;color:white;padding:12px 23px;border-radius:7px;z-index:60;font-size:0.9333rem;box-shadow:0 5px 30px #172b4120}
#toast.error{background:#904147}
footer{padding:0 var(--page-gutter) 24px;color:#9ba6b6;font-size:0.8rem}
footer span{padding:0 8px}
[hidden]{display:none!important}
@keyframes enter{from{opacity:0;transform:translateY(4px)}
to{opacity:1;transform:none}
}
@keyframes slide{from{transform:translateX(30px);opacity:0}
to{transform:none;opacity:1}
}
@keyframes spin{to{transform:rotate(360deg)}
}

/* Shared frame and accessible navigation. */
.sidebar-brand{display:flex;align-items:flex-start;justify-content:space-between;gap:8px}
.sidebar-close{display:none;color:#c9d6e7}
.sidebar-bottom{line-height:1.7}
.sidebar-bottom a{display:flex;justify-content:space-between;min-height:36px;align-items:center;gap:12px}
.sidebar-bottom a:hover{color:#fff}
nav a{min-height:46px}
nav a.active{background:#30496a;box-shadow:inset 2px 0 #a9c8ff}
.mobile-menu{display:none}
.icon-button svg,.refresh-button svg{width:20px;height:20px;flex-shrink:0}
.topbar,.top-actions,.page-title{min-width:0}
.page-title>div{min-width:0}
.subtitle{max-width:70ch;line-height:1.8}
.actions{flex-wrap:wrap}
.skip-link{position:fixed;left:24px;top:-80px;padding:10px 18px;background:#fff;color:var(--blue);z-index:100;border:2px solid var(--blue)}
.skip-link:focus{top:12px}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
:focus-visible{outline:2px solid #4377cc;outline-offset:4px}
main:focus{outline:none}
input:disabled,select:disabled{background:#f1f4f8;color:#8390a2;cursor:not-allowed;opacity:1}
input::placeholder{color:#7b8799;opacity:1}
.nav-shade{position:fixed;inset:0;z-index:19;background:#0c1d36a6;border:0;border-radius:0;backdrop-filter:blur(2px);animation:enter .15s ease}
body.nav-open,body.drawer-open{overflow:hidden}
.drawer{padding-bottom:max(30px,env(safe-area-inset-bottom));overscroll-behavior:contain}
.drawer-title{position:sticky;top:-28px;background:#fff;z-index:1;padding:12px 0}
.drawer-title h2{overflow-wrap:anywhere}
.form-row .field{min-width:0}
.status-label{display:inline-flex;align-items:center;gap:8px;color:var(--green);font-size:.8667rem}
.status-label::before{content:"";width:7px;height:7px;flex-shrink:0;border-radius:50%;background:currentColor}
.status-label.off{color:var(--muted)}
.status-label.attention{color:var(--amber)}

/* Memory: one working surface, with secondary context alongside it. */
.memory-header{align-items:center;margin-bottom:30px}
.memory-heading-meta{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.memory-header-actions{display:flex;align-items:center;justify-content:flex-end;gap:20px;flex-wrap:wrap}
.memory-workspace{display:grid;grid-template-columns:minmax(0,1fr) minmax(260px,19rem);gap:32px;align-items:start}
.memory-primary{min-width:0;background:#fff;border:1px solid var(--line);border-radius:10px;overflow:hidden}
.memory-toolbar{display:flex;align-items:flex-end;gap:20px;padding:24px 26px 22px}
.memory-scope{display:block;min-width:0;flex:0 1 260px}
.memory-scope>span,.search-field>span{display:block;margin-bottom:9px;font-size:.8rem;font-weight:500;color:var(--muted)}
.memory-scope select{width:100%;min-height:44px;padding-right:30px;text-overflow:ellipsis}
.search-field{display:block;flex:1;min-width:0}
.search-input{position:relative;display:block}
.search-input svg{position:absolute;left:13px;top:50%;transform:translateY(-50%);width:18px;height:18px;color:#7e8ca1;pointer-events:none}
.search-input input{width:100%;min-height:44px;padding-left:40px}
.memory-filterbar{display:flex;align-items:center;gap:14px;flex-wrap:wrap;padding:0 26px 17px;border-bottom:1px solid var(--line)}
.memory-filters{display:flex;gap:4px;flex-wrap:wrap;min-width:0}
.filter-tab{background:none;border:1px solid transparent;color:var(--muted);padding:7px 12px;min-height:36px;font-size:.8667rem}
.filter-tab:hover{color:var(--ink);background:#f2f5fa}
.filter-tab[aria-pressed=true]{color:#315d9c;background:#edf3fc;border-color:#d6e3f6;font-weight:600}
.filter-tab:disabled{cursor:not-allowed}
.memory-count{font-size:.8rem;color:var(--muted);margin-left:auto;font-variant-numeric:tabular-nums}
.memory-results{min-height:320px}
.memory-table{table-layout:fixed}
.memory-table th:first-child{width:46%}
.memory-table th:nth-child(2){width:16%}
.memory-table th:nth-child(3){width:20%}
.memory-table th:nth-child(4){width:18%}
.memory-table td,.memory-table th{padding:20px 22px}
.memory-table th{font-size:.8rem;font-weight:500;background:#fbfcfe}
.memory-table td{font-size:.9333rem;vertical-align:middle}
.memory-table .memory-text{line-height:1.85;margin:0;white-space:pre-wrap;overflow-wrap:anywhere;max-width:75ch}
.memory-meta{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px;color:var(--muted);font-size:.8rem;align-items:center}
.memory-topic{color:#647792}
.memory-history{color:#916631;background:#faf3e8;border-radius:4px;padding:1px 6px}
.memory-owner{display:block;overflow-wrap:anywhere;font-variant-numeric:tabular-nums}
.memory-time{display:block;font-size:.8rem;color:var(--muted);margin-top:7px}
.memory-row-actions{display:flex;flex-wrap:wrap;gap:4px 12px;align-items:center}
.memory-row-actions .button{font-size:.8667rem}
.memory-row-actions .forget-button{color:#917076}
.memory-row-actions .forget-button:hover{color:var(--danger)}
.mobile-label{display:none}
.memory-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;min-height:clamp(360px,48vh,560px);padding:44px 28px}
.memory-empty-icon{display:grid;place-items:center;width:68px;height:68px;border-radius:20px;background:#f0f4fa;color:#6986b3;margin-bottom:23px}
.memory-empty-icon svg{width:32px;height:32px}
.memory-empty h2{font-size:1.2rem;color:#35465e;font-weight:600;margin:0 0 12px}
.memory-empty p{max-width:37ch;line-height:1.9;font-size:.9333rem;color:var(--muted);margin:0}
.memory-empty .empty-actions{display:flex;justify-content:center;flex-wrap:wrap;gap:12px;margin-top:25px}
.memory-empty.no-matches{min-height:320px}
.memory-context{padding:6px 0 0;min-width:0}
.memory-context section+section{margin-top:30px;padding-top:26px;border-top:1px solid var(--line)}
.context-title{font-size:1rem;font-weight:600;margin:0 0 20px}
.memory-config{margin:0}
.memory-config>div{display:flex;align-items:baseline;justify-content:space-between;gap:16px;margin:17px 0}
.memory-config dt{font-size:.8667rem;color:var(--muted)}
.memory-config dd{font-size:.8667rem;margin:0;text-align:right;color:#3b4d67}
.memory-config .config-model{display:block}
.config-model dd{font-size:.8rem;text-align:left;overflow-wrap:anywhere;line-height:1.7;margin-top:8px;color:#6a7b92}
.memory-context .button{margin-top:8px}
.memory-notes{list-style:none;margin:0;padding:0;color:var(--muted);font-size:.8667rem;line-height:1.9}
.memory-notes li{padding-left:16px;position:relative;margin:12px 0}
.memory-notes li::before{content:"";position:absolute;left:0;top:.8em;width:4px;height:4px;border-radius:50%;background:#879fbe}
.context-hint{font-size:.8rem;color:var(--muted);margin:20px 0 0;line-height:1.8}
.memory-scope-note{display:flex;gap:8px;align-items:flex-start;padding:16px 26px;background:#fbfcfe;border-top:1px solid var(--line);font-size:.8rem;color:var(--muted);line-height:1.7}
.memory-scope-note svg{width:16px;height:16px;flex-shrink:0;margin-top:2px}

@media(min-width:2000px){:root{font-size:16px}}
@media(min-width:2800px){:root{font-size:18px}.memory-workspace{gap:48px}.memory-empty{min-height:540px}}
@media(max-width:1440px){
 .memory-workspace{grid-template-columns:minmax(0,1fr)}
 .memory-context{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:40px;padding-top:4px}
 .memory-context section+section{margin-top:0;padding-top:0;border-top:0;border-left:1px solid var(--line);padding-left:32px}
 .memory-empty{min-height:360px}
 .settings-layout{grid-template-columns:155px minmax(0,1fr);gap:28px}
 .form-row{grid-template-columns:145px minmax(0,1fr);gap:22px}
}
@media(max-width:1180px){
 :root{--sidebar-width:14.5rem}
 .two-columns{gap:26px}
 .metric{padding:20px}
 .split-workspace{grid-template-columns:210px minmax(0,1fr)}
 .memory-header{align-items:flex-start}
 .memory-header-actions{gap:12px}
 .memory-table thead{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
 .memory-table,.memory-table tbody{display:block;width:100%}
 .memory-table tr{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:16px 22px;padding:24px;border-bottom:1px solid var(--line)}
 .memory-table tr:last-child{border:0}
 .memory-table td{display:block;border:0;padding:0;min-width:0}
 .memory-table td:first-child,.memory-table td:last-child{grid-column:1/-1}
 .memory-table td:last-child{padding-top:12px;border-top:1px solid #edf0f5}
 .mobile-label{display:block;color:var(--muted);font-size:.8rem;margin-bottom:6px}
 .memory-row-actions{gap:20px}
 .memory-row-actions .button{min-height:40px}
}
@media(max-width:900px){
 .sidebar{transform:translateX(-100%);transition:transform .2s ease;width:min(290px,calc(100vw - 48px));padding:25px 18px max(24px,env(safe-area-inset-bottom));box-shadow:16px 0 60px #091b2926;visibility:hidden}
 .sidebar.open{transform:translateX(0);visibility:visible}
 .sidebar-close,.mobile-menu{display:inline-grid}
 .workspace{margin-left:0;width:100%}
 .topbar{min-height:68px;padding:10px 22px;gap:10px}
 .breadcrumb{margin-right:auto;font-size:.8667rem}
 .breadcrumb span{padding:0 8px}
 .top-actions{gap:10px}
 #clock{display:none}
 main{padding:28px 24px 36px}
 footer{padding:0 24px max(22px,env(safe-area-inset-bottom))}
 #toast{left:50%;max-width:calc(100% - 32px);width:max-content;bottom:max(20px,env(safe-area-inset-bottom))}
 .button{min-height:44px}
 .button.link{min-height:40px}
 input,select,textarea{font-size:16px}
 .settings-layout{display:block}
 .settings-tabs{position:static;flex-direction:row;overflow-x:auto;padding:4px 0 12px;margin-bottom:20px;white-space:nowrap}
 .settings-tabs button{min-height:44px}
 .form-row{grid-template-columns:150px minmax(0,1fr)}
 .notice{flex-wrap:wrap}
 .notice .button{margin-left:0}
 .memory-empty{min-height:340px}
 .memory-header-actions .status-label{font-size:.8rem}
 .filter-tab{min-height:42px}
}
@media(max-width:600px){
 :root{--page-gutter:18px}
 main{padding:26px max(18px,env(safe-area-inset-right)) 32px max(18px,env(safe-area-inset-left))}
 .topbar{padding:max(8px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) 8px max(12px,env(safe-area-inset-left));min-height:64px;gap:5px}
 .refresh-button{width:44px;height:44px;padding:10px}
 .refresh-button span{display:none}
 .page-title{gap:16px;flex-wrap:wrap;margin-bottom:24px}
 h1{font-size:1.7333rem}
 .subtitle{font-size:.8667rem}
 .memory-header{display:block}
 .memory-header-actions{justify-content:space-between;margin-top:18px;gap:12px}
 .memory-toolbar{display:block;padding:20px 18px}
 .memory-scope{width:100%;margin-bottom:18px}
 .memory-filterbar{padding:0 14px 14px;gap:8px}
 .memory-filters{gap:2px}
 .filter-tab{padding:8px 10px;font-size:.8667rem}
 .memory-count{width:100%;margin:6px 4px 0}
 .memory-empty{min-height:330px;padding:32px 20px}
 .memory-empty h2{font-size:1.1333rem}
 .memory-empty-icon{width:58px;height:58px;border-radius:16px;margin-bottom:20px}
 .memory-empty .empty-actions{gap:10px;align-self:stretch}
 .memory-empty .empty-actions .button{padding:10px 14px}
 .memory-table tr{padding:20px 18px;gap:18px 16px}
 .memory-row-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
 .memory-row-actions .button{min-height:44px;padding:9px 6px;background:#f5f8fc;border-radius:6px}
 .memory-scope-note{padding:15px 18px}
 .memory-context{display:block;padding:0 4px}
 .memory-context section+section{margin-top:24px;padding:24px 0 0;border-left:0;border-top:1px solid var(--line)}
 .memory-config>div{margin:15px 0}
 .two-columns{grid-template-columns:minmax(0,1fr);gap:28px}
 .metrics{grid-template-columns:repeat(2,minmax(0,1fr))}
 .metric:nth-child(2){border-right:0}
 .metric:nth-child(-n+2){border-bottom:1px solid var(--line)}
 .metric-value{font-size:2rem}
 .form-row{display:block}
 .form-row>label{display:block;padding:0;margin-bottom:9px}
 .toolbar{gap:10px}
 .toolbar input,.toolbar select{width:100%;min-width:0;max-width:100%}
 .toolbar .grow{display:none}
 .chat-top{flex-wrap:wrap;gap:14px}
 .split-workspace{display:block;min-height:420px}
 .chat-list{max-height:170px;overflow-y:auto;border-right:0;border-bottom:1px solid var(--line)}
 .chat-content{padding:20px 18px}
 .chat-item{min-height:64px}
 .message-meta{flex-wrap:wrap;gap:6px 12px}
 .diary-layout{display:block}
 .diary-list{display:flex;overflow-x:auto;border:0;padding:0}
 .diary-list .chat-item{min-width:170px}
 .diary-page{padding:24px 18px;min-height:360px}
 .diary-body{font-size:1rem;overflow-wrap:anywhere}
 .gallery-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
 .drawer{width:100%;padding:18px 20px max(28px,env(safe-area-inset-bottom))}
 .drawer-title{top:-18px;margin-bottom:20px}
 .source{padding:10px 12px}
 .source p,.source small{overflow-wrap:anywhere}
 .list-row{align-items:flex-start;flex-wrap:wrap}
 .form-actions .button{min-height:44px}
 footer{padding-inline:18px}
}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important}}

/* Independent administrator login, shared desktop/mobile proportions. */
.logout-button{display:flex;align-items:center;gap:8px;width:100%;min-height:44px;padding:8px 0;border:0;background:transparent;color:#c2cfe0;text-align:left;font-size:.8667rem}
.logout-button:hover{color:#fff}
.login-page{display:flex;align-items:center;justify-content:center;padding:32px 18px;background:var(--paper)}
.login-shell{width:100%;max-width:440px;flex:none;padding:0;margin:auto;animation:none}
.login-brand{display:flex;align-items:center;gap:14px;margin:0 0 30px;padding-left:2px;color:var(--nav);font-weight:650;font-size:25px}
.login-brand .brand-mark{width:44px;height:44px;font-size:24px;border-color:#a9b9ce;background:white}
.brand-mark{overflow:hidden;padding:0;border:0}
.brand-mark img{display:block;width:100%;height:100%;object-fit:cover}
.login-brand small{display:block;margin-top:2px;font-size:13px;font-weight:400;color:var(--muted);letter-spacing:.4px}
.login-panel{padding:34px 32px 32px;background:#fff;border:1px solid var(--line);border-radius:12px}
.login-heading{margin-bottom:28px}
.login-heading h1{font-size:26px;letter-spacing:-.5px;margin-bottom:9px}
.login-heading p{font-size:14px;color:var(--muted);line-height:1.7;margin:0}
.login-field{margin-bottom:22px}
.login-field label{display:block;font-size:14px;font-weight:500;margin-bottom:9px}
.login-field input{width:100%;height:48px;padding:11px 13px;border:1px solid #ced7e3;background:#fff;color:var(--ink);font-size:16px;min-width:0}
.login-field input:focus{outline:2px solid #a8c0e8;outline-offset:2px;border-color:var(--blue)}
.password-field{position:relative}
.password-field input{padding-right:70px}
.password-toggle{position:absolute;right:4px;top:2px;height:44px;min-width:58px;padding:8px 12px;background:transparent;border:0;color:#4c6281;font-size:13px}
.password-toggle:hover{background:#f2f5fa}
.login-session-note{font-size:12px;color:var(--muted);line-height:1.7;margin:0 0 22px}
.login-error{color:var(--danger);background:#fff4f3;border-left:3px solid #d79b96;padding:10px 12px;margin:0 0 18px;font-size:14px;line-height:1.6;overflow-wrap:anywhere}
.login-submit{width:100%;min-height:48px;font-size:15px}
.login-footer{margin:24px 0 0;text-align:center;font-size:12px;color:#7b8a9d}
@media(max-width:480px){.login-page{padding:max(28px,env(safe-area-inset-top)) 18px max(28px,env(safe-area-inset-bottom))}.login-panel{padding:28px 22px}.login-heading h1{font-size:24px}.login-brand{margin-bottom:26px}}

/* Navigation keeps its current view until the next one is ready. */
.page-progress{position:fixed;z-index:18;top:0;left:var(--sidebar-width);right:0;height:2px;background:#e6edf8;overflow:hidden;pointer-events:none}
.page-progress::after{content:"";display:block;width:35%;height:100%;background:var(--blue);animation:page-loading 1.1s ease-in-out infinite}
@keyframes page-loading{from{transform:translateX(-110%)}to{transform:translateX(400%)}}
#nav a.pending:not(.active){background:#ffffff09}
.persona-summary{display:flex;flex-wrap:wrap;gap:12px 24px;padding:14px 0 24px;color:var(--muted);font-size:.9rem}
.persona-new{align-self:flex-start;margin-top:12px}
@media(max-width:900px){.page-progress{left:0}}
@media(prefers-reduced-motion:reduce){.page-progress::after{animation:none;width:100%}}

.admin-accounts{display:grid;gap:12px;margin:24px 0}.admin-account-row{display:grid;grid-template-columns:70px minmax(0,320px) auto;gap:12px;align-items:center;justify-content:start}.admin-account-row input{min-width:0;width:100%;height:44px;padding:10px 12px;border:1px solid var(--line,#dbe2ec);border-radius:6px;background:var(--surface,#fff);color:inherit}.admin-account-row button{min-height:44px}@media(max-width:600px){.admin-account-row{grid-template-columns:minmax(0,1fr) auto;gap:8px}.admin-account-row label{grid-column:1/-1}.admin-account-row input{grid-column:1}}

.identity-label{unicode-bidi:isolate;overflow-wrap:anywhere}.admin-account-field{min-width:0}.admin-account-identity{display:block;margin-top:6px;overflow-wrap:anywhere;color:var(--muted,#667892);font-size:12px;line-height:1.6}.admin-account-row{align-items:start}.admin-account-row>label{padding-top:12px}@media(max-width:600px){.admin-account-row>label{padding-top:0}.admin-account-field{grid-column:1}}
