#notes[hidden], #notes [hidden], #writing-tools[hidden] { display:none !important; }
.notes-tabs { display:flex; gap:6px; padding:9px 12px; background:#fff; border-bottom:1px solid #eae2f5; }
.notes-tabs button { background:#f7f3fc; color:#6033a0; }
.notes-tabs [aria-pressed="true"] { background:#6d28d9; color:#fff; }
body.notes-open { min-height:100dvh; display:flex; flex-direction:column; background:#fff; }
body.notes-open > header { max-width:none; width:100%; margin:0; padding:12px 24px; background:#fff; }
body.notes-open #web-notes { background:#f2e9ff; color:#6325bf; }
#notes { --notes-accent:#6727c6; --notes-ink:#25183b; --notes-muted:#6c5c81; --notes-border:#ebe3f3; --notes-gradient:linear-gradient(110deg,#65ffe0 0%,#82c6ff 36%,#c098ff 68%,#ff91d6 100%); box-sizing:border-box; width:100%; color:var(--notes-ink); background:#fff; margin:0; padding:0; border:0; }
body.notes-open #notes { flex:1; display:flex; flex-direction:column; }
#notes input,#notes select,#notes textarea,#notes button,#notes summary { box-sizing:border-box; font:inherit; }
#notes h2 { margin:0; font-size:16px; letter-spacing:-.025em; }
#notes button,#notes summary { cursor:pointer; }
#notes button:disabled { opacity:.48; cursor:default; }
#notes button,#notes summary,#notes input:not([role="switch"]),#notes select,#notes textarea { border:1px solid var(--notes-border); border-radius:10px; padding:10px 12px; color:var(--notes-ink); background:#fff; }
#notes button,#notes summary { font-weight:700; }
#notes button:hover:not(:disabled),#notes summary:hover { background:#f8f3ff; }
#notes :focus-visible { outline:2px solid #a879ed; outline-offset:2px; }
#notes input:not([role="switch"]),#notes select,#notes textarea { width:100%; min-width:0; }
.notes-layout { display:grid; grid-template-columns:240px minmax(260px,.9fr) minmax(300px,1.35fr); grid-template-rows:auto auto 1fr; flex:1; min-height:0; }
.notes-books { grid-area:1/1/4/2; min-width:0; background:#faf7ff; padding:24px 16px; border-right:1px solid var(--notes-border); }
.notes-books h2 { padding:0 8px; margin-bottom:14px !important; }
.notes-book-list { display:grid; gap:4px; max-height:40vh; overflow:auto; }
#notes .notes-book-list button { text-align:left; width:100%; border-color:transparent; background:transparent; overflow-wrap:anywhere; }
#notes .notes-book-list button[aria-pressed="true"] { background:#eee3ff; color:var(--notes-accent); }
#notes .notes-book-list button:hover { background:#f1e9ff; }
.notes-books form { display:grid; gap:8px; margin-top:20px; padding-top:16px; border-top:1px solid var(--notes-border); }
#notes #nt-count { margin:22px 7px 10px; color:var(--notes-muted); font-size:13px; }
.notes-search { grid-area:1/2/2/4; display:flex; gap:10px; padding:18px 24px; border-bottom:1px solid var(--notes-border); align-items:center; min-width:0; }
.notes-search-input { flex:1; position:relative; min-width:0; max-width:760px; }
.notes-search-input svg { position:absolute; left:13px; top:50%; transform:translateY(-50%); color:#744cb0; pointer-events:none; }
#notes #nt-query { padding:12px 13px 12px 40px; background:#fbf9fe; }
.notes-search-by { position:relative; flex:none; z-index:2; }
#notes summary { list-style:none; display:flex; gap:12px; align-items:center; white-space:nowrap; padding:12px; }
#notes summary::-webkit-details-marker { display:none; }
#notes summary span { color:var(--notes-accent); }
.notes-search-options { position:absolute; top:calc(100% + 8px); right:0; width:210px; padding:7px 11px; background:#fff; border:1px solid var(--notes-border); border-radius:14px; box-shadow:0 10px 30px #3b196c1a; }
.notes-search-options label { display:flex; align-items:center; justify-content:space-between; padding:10px 3px; gap:12px; margin:0; font-weight:600; }
.notes-search-options label + label { border-top:1px solid #f1eaf7; }
#notes input[role="switch"] { appearance:none; position:relative; flex:none; width:41px; height:23px; margin:0; border:1px solid #c9b8dd; border-radius:999px; background:#e9e1f1; cursor:pointer; padding:0; }
#notes input[role="switch"]:checked { background:var(--notes-gradient); border-color:#b78de9; }
#notes input[role="switch"]::before { content:""; position:absolute; left:2px; top:2px; width:17px; height:17px; border-radius:50%; background:#fff; box-shadow:0 1px 4px #20133140; transition:transform .16s ease; }
#notes input[role="switch"]:checked::before { transform:translateX(18px); }
.notes-results,.notes-editor { min-width:0; padding:22px 24px; }
.notes-results { grid-area:3/2/4/4; }
.notes-layout:has(.notes-editor:not([hidden])) .notes-results { grid-column:2; border-right:1px solid var(--notes-border); }
.notes-editor { grid-area:3/3/4/4; display:grid; align-content:start; gap:14px; }
.notes-editor label { display:grid; font-weight:700; gap:6px; margin:0; }
.notes-editor textarea { resize:vertical; min-height:140px; }
.notes-results-heading,.notes-actions { display:flex; align-items:center; flex-wrap:wrap; justify-content:space-between; gap:8px; }
.notes-actions { justify-content:flex-start; }
#notes #nt-new,#notes .notes-editor button[type="submit"] { background:#6f2bcd; border-color:#6f2bcd; color:white; }
#notes #nt-new:hover:not(:disabled),#notes .notes-editor button[type="submit"]:hover { background:#5b20b4; }
#nt-list { display:grid; gap:8px; margin:14px 0; }
#notes #nt-list button { display:grid; gap:4px; text-align:left; overflow-wrap:anywhere; }
#nt-list small { color:var(--notes-muted); }
#nt-status { grid-area:2/2/3/4; margin:0; padding:10px 24px 0; color:var(--notes-muted); overflow-wrap:anywhere; }
#nt-status:empty { display:none; }
.notes-gate { width:min(420px,calc(100% - 32px)); margin:32px auto; padding:20px; border:1px solid var(--notes-border); border-radius:14px; background:#faf7ff; }
@media(max-width:880px) {
  .notes-layout { grid-template-columns:190px minmax(0,1fr); grid-template-rows:auto auto auto 1fr; }
  .notes-books { grid-area:1/1/5/2; }
  .notes-search { grid-area:1/2/2/3; }
  #nt-status { grid-area:2/2/3/3; }
  .notes-editor { grid-area:3/2/4/3; }
  .notes-results,.notes-layout:has(.notes-editor:not([hidden])) .notes-results { grid-area:4/2/5/3; border-right:0; }
}
@media(max-width:620px) {
  body.notes-open > header { padding:8px 10px; }
  body.notes-open > header nav { gap:3px; }
  body.notes-open > header .chrome-install,body.notes-open > header .free-label { display:none; }
  .notes-layout { grid-template-columns:minmax(0,1fr); grid-template-rows:auto auto auto auto 1fr; }
  .notes-search { grid-area:1/1/2/2; padding:12px; }
  .notes-books { grid-area:2/1/3/2; padding:14px 12px; border-right:0; border-bottom:1px solid var(--notes-border); }
  .notes-books form { grid-template-columns:minmax(0,1fr) auto; }
  .notes-book-list { max-height:150px; }
  #nt-status { grid-area:3/1/4/2; padding:10px 12px 0; }
  .notes-editor { grid-area:4/1/5/2; }
  .notes-results,.notes-layout:has(.notes-editor:not([hidden])) .notes-results { grid-area:5/1/6/2; }
  .notes-results,.notes-editor { padding:14px 12px; }
}
@media(prefers-reduced-motion:reduce) { #notes input[role="switch"]::before { transition:none; } }

/* Keep the default writing surface next to the notebook navigation. */
.notes-layout { grid-template-columns:240px minmax(0,1fr) minmax(280px,31%); }
.notes-search { grid-area:1/2/2/3; }
.notes-search-input { max-width:none; }
#nt-status { grid-area:2/2/3/3; }
.notes-results,.notes-editor { grid-area:3/2/4/3; }
.notes-layout:has(.notes-editor:not([hidden])) .notes-results { display:none; }
.notes-editor { max-width:920px; width:100%; }
#notes #nt-new { flex:none; padding:12px; white-space:nowrap; }
.notes-agent {
  grid-area:1/3/4/4; position:sticky; top:0; align-self:start; height:calc(100dvh - 69px);
  min-height:380px; display:flex; flex-direction:column; min-width:0;
  background:#fbf8ff; border-left:1px solid var(--notes-border);
}
.notes-agent-heading { display:flex; align-items:center; gap:10px; padding:19px 18px; border-bottom:1px solid var(--notes-border); background:#fff; }
.notes-agent-heading span { display:grid; place-items:center; width:30px; height:30px; border-radius:9px; background:#eee3ff; color:var(--notes-accent); font-size:18px; }
.notes-conversation { display:flex; flex-direction:column; gap:10px; flex:1; min-height:0; overflow:auto; padding:16px; }
.notes-agent-hint { margin:0; color:var(--notes-muted); font-size:14px; line-height:1.5; }
.notes-message { margin:0; padding:10px 12px; border:1px solid var(--notes-border); border-radius:13px; background:#fff; color:var(--notes-ink); line-height:1.5; white-space:pre-wrap; overflow-wrap:anywhere; max-width:95%; }
.notes-message-user { align-self:flex-end; background:#eee3ff; }
.notes-agent-status { padding:0 16px; margin:5px 0; color:var(--notes-muted); }
.notes-agent-status:empty { display:none; }
.notes-composer { display:flex; align-items:flex-end; gap:8px; padding:12px 14px 16px; border-top:1px solid var(--notes-border); background:#fff; }
#notes #nt-question { min-height:54px; max-height:180px; resize:vertical; }
#notes #nt-agent-send { flex:none; display:grid; place-items:center; width:39px; height:39px; border-radius:50%; padding:0; color:#fff; background:#6f2bcd; border-color:#6f2bcd; font-size:22px; }
@media(max-width:1000px) {
  .notes-layout { grid-template-columns:190px minmax(0,1fr) minmax(230px,29%); grid-template-rows:auto auto 1fr; }
  .notes-books { grid-area:1/1/4/2; }
  .notes-search,.notes-editor,.notes-results { padding-inline:12px; }
  .notes-results,.notes-layout:has(.notes-editor:not([hidden])) .notes-results { grid-area:3/2/4/3; }
}
@media(max-width:790px) {
  .notes-layout { grid-template-columns:155px minmax(0,1fr); grid-template-rows:auto auto auto 1fr; }
  .notes-books { grid-area:1/1/5/2; }
  .notes-agent { grid-area:4/2/5/3; position:static; height:410px; border-left:0; border-top:1px solid var(--notes-border); }
}
@media(max-width:620px) {
  .notes-layout { grid-template-columns:minmax(0,1fr); grid-template-rows:auto auto auto auto auto; }
  .notes-search { grid-area:1/1/2/2; gap:5px; flex-wrap:wrap; }
  .notes-search-input { flex-basis:120px; }
  #notes #nt-new,#notes summary { padding:9px 8px; }
  .notes-books { grid-area:2/1/3/2; }
  #nt-status { grid-area:3/1/4/2; }
  .notes-editor,.notes-results,.notes-layout:has(.notes-editor:not([hidden])) .notes-results { grid-area:4/1/5/2; }
  .notes-agent { grid-area:5/1/6/2; }
}
.notes-tag-chips { display:flex; flex-wrap:wrap; gap:6px; }
.notes-tag-chips span { padding:4px 10px; border-radius:999px; background:#eee3ff; color:#542497; font-size:13px; overflow-wrap:anywhere; }
.notes-tree-children { margin:4px 0 8px 14px; padding-left:8px; border-left:1px solid #decef1; }
#notes .notes-tree-children button { padding:6px 8px; font-size:13px; font-weight:500; }
#notes .notes-tree-children button[aria-current="true"] { background:#eee3ff; color:var(--notes-accent); font-weight:700; }
.notes-tag-chips span { position:relative; padding-right:25px; }
#notes .notes-tag-chips button { position:absolute; top:0; right:2px; border:0; border-radius:50%; padding:0; width:20px; height:20px; line-height:20px; font-size:14px; background:transparent; color:#542497; }
#notes .notes-tag-chips button:hover:not(:disabled) { background:#ddcbfa; }
