:root{font-family:Inter,system-ui,sans-serif;color:#142033;background:#eef3f8;font-size:16px}*{box-sizing:border-box}body{margin:0}button,input,textarea{font:inherit}button{cursor:pointer}header{height:64px;background:#10233f;color:white;display:flex;align-items:center;justify-content:space-between;padding:0 max(20px,calc((100vw - 1180px)/2));box-shadow:0 2px 12px #10233f33}header div{display:flex;gap:12px;align-items:center}header strong{font-size:1.25rem}header span{font-size:.8rem;background:#ffffff1f;padding:5px 9px;border-radius:999px}header button{background:transparent;border:1px solid #ffffff66;color:white;border-radius:9px;padding:8px 12px}main{max-width:1180px;margin:auto;padding:24px;display:grid;grid-template-columns:minmax(0,1fr);gap:20px}.chat{background:white;min-height:calc(100vh - 112px);border-radius:18px;box-shadow:0 10px 35px #19324d12;display:flex;flex-direction:column;overflow:hidden}#messages{padding:24px;flex:1;overflow:auto}.welcome{max-width:600px;margin:12vh auto;text-align:center}.welcome h1{font-size:2.4rem;margin:.2em}.welcome p{color:#526173;line-height:1.55}.msg{max-width:78%;padding:14px 16px;border-radius:14px;margin:12px 0;white-space:pre-wrap;line-height:1.5}.user{margin-left:auto;background:#dbe9ff}.assistant{background:#f1f4f7}.sources{font-size:.8rem;color:#627083;margin-top:10px}#chat{display:flex;gap:10px;padding:16px;border-top:1px solid #dce4ec}textarea{min-height:50px;max-height:160px;resize:vertical;flex:1;border:1px solid #bac7d5;border-radius:12px;padding:12px}#chat button,#ownerPanel button,#loginSubmit{border:0;background:#1769aa;color:white;border-radius:10px;padding:10px 15px}#ownerPanel{background:white;border-radius:18px;padding:16px;box-shadow:0 10px 35px #19324d12}#ownerPanel nav{display:flex;gap:8px;flex-wrap:wrap}.card{border:1px solid #dbe3eb;border-radius:12px;padding:14px;margin:12px 0}.card small{color:#667487}.card button{margin-right:8px}.danger{background:#9f2f2f!important}dialog{border:0;border-radius:16px;padding:22px;box-shadow:0 20px 70px #0005}dialog form{display:grid;gap:12px;min-width:min(360px,80vw)}dialog input{padding:12px;border:1px solid #aebdcc;border-radius:9px}@media(min-width:900px){main.owner{grid-template-columns:minmax(0,1.7fr) minmax(330px,1fr)}}@media(max-width:600px){main{padding:10px}.chat{min-height:calc(100vh - 84px);border-radius:12px}#messages{padding:14px}.msg{max-width:92%}#chat{position:sticky;bottom:0;background:white;flex-direction:column}#chat button{min-height:48px}}

.file-row{display:block;padding:9px;border-bottom:1px solid #dbe3eb;overflow-wrap:anywhere}.file-row input{margin-right:8px}#downloadStatus{font-size:.9rem;color:#526173}

/* Comfortable editor for long stories and corrections */
#panel{padding:6px 2px;min-width:0}
#panel h2{margin:18px 0 12px}
#panel #kind{display:block;width:100%;padding:11px 12px;border:1px solid #bac7d5;border-radius:10px;background:white;margin:0 0 12px}
#panel #memoryText{display:block;width:100%;height:260px;min-height:220px;max-height:none;resize:vertical;line-height:1.55;margin:0 0 12px;padding:14px}
#panel #wordFile{display:block;width:100%;margin:0 0 12px}
#panel hr{border:0;border-top:1px solid #dbe3eb;margin:24px 0}
#panel #uploadStatus,#panel #indexStatus{line-height:1.5;overflow-wrap:anywhere}
@media(min-width:900px){main.owner{max-width:1400px;grid-template-columns:minmax(0,1.25fr) minmax(480px,1fr)}}
@media(max-width:900px){#panel #memoryText{height:240px}}

.field-label{display:block;font-weight:600;margin:13px 0 7px}.editor-help{color:#526173;line-height:1.5;margin:0 0 16px}


/* Scott personality feedback controls */
#panel #responseSelect{display:block;width:100%;padding:11px 12px;border:1px solid #bac7d5;border-radius:10px;background:white;margin-bottom:12px}
.feedback-grid{display:grid;grid-template-columns:1fr 1fr;gap:9px;margin:14px 0}
.feedback-grid button{min-height:48px;text-align:left}
#feedbackEditor{margin:12px 0;padding:14px;border:1px solid #dbe3eb;border-radius:12px;background:#f8fafc}
#feedbackEditor .secondary-btn{background:#64748b;margin-left:8px}
#panel #newMemoryText{display:block;width:100%;height:210px;min-height:160px;max-height:none;resize:vertical;line-height:1.55;margin:10px 0 12px;padding:14px}
#panel details{padding:4px 0}#panel summary{cursor:pointer}
@media(max-width:600px){.feedback-grid{grid-template-columns:1fr}}

.visitor-memory-prompt{max-width:78%;background:#fff8df;border:1px solid #e7d89b;border-radius:14px;padding:14px 16px;margin:12px 0;line-height:1.45}
.visitor-memory-prompt p{margin:8px 0 12px}.visitor-memory-prompt button{border:0;background:#1769aa;color:white;border-radius:9px;padding:9px 13px;margin:4px 7px 4px 0}
.visitor-memory-prompt .dismiss-suggestion{background:#64748b}.visitor-memory-prompt textarea,.visitor-memory-prompt input{display:block;width:100%;border:1px solid #bac7d5;border-radius:9px;padding:10px;margin-bottom:10px}
.visitor-memory-prompt textarea{min-height:110px;max-height:260px}
@media(max-width:600px){.visitor-memory-prompt{max-width:92%}}

.memory-review-editor{display:block;width:100%;min-height:260px;max-height:600px;resize:vertical;margin:8px 0 12px;padding:12px;border:1px solid #bac7d5;border-radius:10px;font:inherit;line-height:1.45;box-sizing:border-box}
