/* Notes (/services/notes/). Fonts, the base tokens and .btn come from /css/txlist.css (.ycp); this adds the palette and
   everything the notes page draws. Every rule is under .nt or a class only this page uses. */
body { background-color: #11141A; }

.nt {
  --warn: #F5B94A; --bad: #FF7A7A;
  /* The palette a note, a folder or a piece of text may use: names only, never a value from the customer. */
  --red: #FF7676; --orange: #FF9F5A; --yellow: #F5C84A; --green: #3DD68C; --teal: #34C6CF;
  --blue: #6EA8FF; --purple: #A98BFF; --pink: #F27FCF; --grey: #9AA3B5;
}
.nt .mono, .nt textarea.mono { font-family: 'YCP Mono', ui-monospace, monospace; }
.nt svg.i { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.nt .btn.ghost { background: transparent; }
.nt .btn.danger { color: var(--bad); }
.nt .btn[disabled], .nt .ib[disabled] { opacity: .45; cursor: not-allowed; }
.nt .ib { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 8px; border: 0; background: none; color: var(--muted); padding: 0; }
.nt .ib:hover:not([disabled]) { background: var(--surface-2); color: var(--text); }
.nt .ib.on { background: var(--surface-3); color: var(--text); }

/* colour swatches and dots */
.c-red { --c: var(--red); } .c-orange { --c: var(--orange); } .c-yellow { --c: var(--yellow); } .c-green { --c: var(--green); } .c-teal { --c: var(--teal); }
.c-blue { --c: var(--blue); } .c-purple { --c: var(--purple); } .c-pink { --c: var(--pink); } .c-grey { --c: var(--grey); } .c-none { --c: #4A5266; }
.dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--c, #4A5266); }

/* ------------------------------------------------------------------------------------------------ page */
.nt { padding: 26px 28px 22px; max-width: 1400px; }
.nt-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.nt-head h1 { margin: 0; font-family: "titles", sans-serif !important; font-weight: 400; font-size: 32px; color: #E4E8EF; }
.nt-head p { margin: 6px 0 0; font-size: 14.5px; color: #A5ACB9; }
.nt-head-r { display: flex; gap: 10px; }
.nt-work { display: grid; grid-template-columns: 276px minmax(0, 1fr); gap: 16px; height: calc(100vh - 248px); min-height: 560px; }

/* --------------------------------------------------------------------------------------- files (tree) */
.nt-files { display: flex; flex-direction: column; min-height: 0; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
.nt-search { display: flex; align-items: center; gap: 9px; height: 38px; margin: 12px 12px 6px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--bg); color: var(--muted); font-size: 13.5px; }
.nt-search:focus-within { border-color: #4A5266; }
.nt-search input { flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; outline: 0; background: none; color: var(--text); font-size: 13.5px; }
.nt-search input::placeholder { color: var(--muted-2); }
.nt-search input::-webkit-search-cancel-button { filter: invert(.6); }
.nt-search kbd { margin-left: auto; font-size: 11px; color: var(--muted-2); border: 1px solid var(--line-2); border-radius: 5px; padding: 1px 5px; font-family: 'YCP Mono', monospace; }
.nt-tree { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 8px 8px; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.nt-sec { display: flex; align-items: center; justify-content: space-between; margin: 12px 6px 4px; font-size: 11px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--muted-2); }
.nt-sec .ib { width: 24px; height: 24px; }
.row { position: relative; display: flex; align-items: center; gap: 8px; width: 100%; height: 32px; padding: 0 8px 0 calc(6px + var(--d, 0) * 16px); border: 0; border-radius: 8px;
  background: none; color: var(--text-2); font-size: 13.5px; text-align: left; white-space: nowrap; }
.row:hover { background: var(--surface-2); }
.row .chev { width: 14px; color: var(--muted-2); }
.row .chev.none { visibility: hidden; }
.row .fi { color: var(--c, var(--muted)); }
.row .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.row em { font-style: normal; font-size: 11.5px; color: var(--muted-2); }
.row.note { color: var(--muted); font-size: 13px; }
.row.note .fi { color: var(--c, var(--muted-2)); }
.row.sel { background: rgba(155, 123, 255, .14); color: #fff; }
.row[disabled] { opacity: .45; cursor: not-allowed; }
.row.trash-row { margin-top: 10px; }
.row.sel::before { content: ''; position: absolute; left: 0; top: 7px; bottom: 7px; width: 3px; border-radius: 3px; background: var(--grad); }
.row.ctx { background: var(--surface-3); color: #fff; }
.row .pin { color: var(--muted-2); }
.nt-foot { padding: 12px 14px 14px; border-top: 1px solid var(--line); }
.meter { height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 6px; background: var(--grad); }
.meter.near i { background: var(--warn); }
.nt-use { display: flex; justify-content: space-between; margin-top: 8px; font-size: 12px; color: var(--muted); }
.nt-use b { color: var(--text-2); font-weight: 500; }
.nt-use + .nt-use { margin-top: 3px; }

/* ----------------------------------------------------------------------------------------- the pane */
.nt-pane { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); overflow: hidden; }

/* tabs */
.tabs { display: flex; align-items: flex-end; gap: 2px; height: 46px; overflow: hidden; padding: 6px 8px 0; border-bottom: 1px solid var(--line); background: #12161E; }
.tab { position: relative; flex: 0 1 auto; min-width: 0; display: flex; align-items: center; gap: 8px; height: 40px; max-width: 200px; padding: 0 8px 0 13px; border: 1px solid transparent; border-bottom: 0;
  border-radius: 11px 11px 0 0; background: none; color: var(--muted); font-size: 13px; white-space: nowrap; }
.tab:hover { color: var(--text-2); background: rgba(255, 255, 255, .02); }
.tab .t { overflow: hidden; text-overflow: ellipsis; }
.tab .x { display: flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 6px; color: var(--muted-2); }
.tab .x:hover { background: var(--surface-3); color: var(--text); }
.tab.on { background: var(--surface); border-color: var(--line); color: #fff; margin-bottom: -1px; height: 41px; }
.tab.on::after { content: ''; position: absolute; left: 12px; right: 12px; top: -1px; height: 2px; border-radius: 2px; background: var(--grad); }
.tab.home { flex: none; padding: 0 12px; }
.tab .dot, .tab .x { flex: none; }
.tab .edited { width: 7px; height: 7px; border-radius: 50%; background: var(--text-2); }
.tabs .ib { flex: none; margin: 0 0 5px 2px; }
.tabs .count { flex: none; white-space: nowrap; margin: 0 4px 9px auto; font-size: 11.5px; color: var(--muted-2); }

/* the note's title row */
.nhead { display: flex; align-items: center; gap: 12px; padding: 14px 18px 10px; }
.nhead .ttl { flex: 1; min-width: 0; height: 36px; margin: 0 0 0 -6px; padding: 0 6px; border: 1px solid transparent; border-radius: 8px; outline: 0; background: none;
  font-size: 20px; font-weight: 600; color: #fff; text-overflow: ellipsis; }
.nhead .ttl:hover { border-color: var(--line); }
.nhead .ttl:focus { border-color: var(--line-2); background: var(--bg); }
.nhead .ttl::placeholder { color: var(--muted-2); }
.nhead .acts-desk { display: flex; gap: 6px; }
.crumbs { display: flex; align-items: center; gap: 4px; padding: 0 18px; font-size: 12.5px; color: var(--muted); }
.crumbs .sep { color: var(--muted-2); }
.crumbs .fold { display: inline-flex; align-items: center; gap: 5px; padding: 0; border: 0; background: none; color: inherit; font-size: inherit; }
.crumbs button.fold:hover { color: var(--text-2); }
.crumbs .fold .i { color: var(--c, var(--muted)); }
.swatch-btn { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text-2); font-size: 12.5px; }
.swatch-btn .dot { width: 10px; height: 10px; }

/* toolbar */
.tools { display: flex; align-items: center; gap: 2px; margin-top: 10px; padding: 6px 12px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #141821; }
.tools .sep { width: 1px; height: 20px; margin: 0 6px; background: var(--line-2); }
.tools .ib { width: 32px; height: 32px; }
.tools .ib.drop { width: auto; padding: 0 6px; gap: 2px; }
.tools .ib .bar { position: absolute; }
.tools .colour { position: relative; flex-direction: column; gap: 0; }
.tools .colour u { display: block; width: 16px; height: 3px; margin-top: -1px; border-radius: 2px; background: var(--c); }
.seg { display: inline-flex; margin-left: auto; padding: 3px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line-2); }
.seg button { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; border: 0; border-radius: 7px; background: none; color: var(--muted); font-size: 12.5px; font-weight: 500; }
.seg button.on { background: var(--surface-3); color: #fff; }

/* the document: source, preview or both */
.doc { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr); overflow: hidden; }
.doc.split { grid-template-columns: 1fr 1fr; }
.src { width: 100%; height: 100%; margin: 0; font-variant-ligatures: none; padding: 18px 20px 30px; border: 0; outline: 0; resize: none; background: #12161E; color: #D5D9E4; font-size: 13px; line-height: 1.75; tab-size: 2; }
.doc.split .src { border-right: 1px solid var(--line); }
.view { min-height: 0; overflow-y: auto; padding: 16px 26px 34px; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }

/* status line */
.status { display: flex; align-items: center; gap: 16px; height: 36px; padding: 0 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); background: #12161E; }
.status .state { display: inline-flex; align-items: center; gap: 6px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status .state.ok { color: var(--in); }
.status .r { margin-left: auto; font-variant-numeric: tabular-nums; white-space: nowrap; }
.status .warn { color: var(--warn); }
.view .loading { color: var(--muted); }
.view .cut { margin-top: 18px; padding-top: 12px; border-top: 1px dashed var(--line-2); font-size: 12.5px; color: var(--muted); }
.modebar { display: none; }

/* --------------------------------------------------------------------------------- rendered markdown */
.md { color: var(--text-2); font-size: 14.5px; line-height: 1.7; overflow-wrap: anywhere; }
.md > :first-child { margin-top: 0; }
.md h1, .md h2, .md h3 { color: #fff; font-family: 'YCP UI', Arial, sans-serif !important; line-height: 1.3; }
.md h1 { margin: 22px 0 10px; font-size: 24px; font-weight: 600; }
.md h2 { margin: 22px 0 8px; font-size: 18px; font-weight: 600; }
.md h3 { margin: 18px 0 6px; font-size: 15.5px; font-weight: 600; }
.md p { margin: 0 0 12px; }
.md strong { color: #fff; font-weight: 600; }
.md a.md-ext { color: var(--link); text-decoration: underline; text-decoration-color: rgba(169, 184, 255, .4); text-underline-offset: 3px; }
.md code { padding: 1px 6px; border-radius: 6px; background: var(--surface-3); color: #E9DDFF; font-size: 12.5px; font-family: 'YCP Mono', monospace; }
.md .md-code { position: relative; margin: 0 0 14px; border-radius: 12px; background: #0E1117; border: 1px solid var(--line); }
.md .md-code pre { margin: 0; padding: 14px 16px; overflow-x: auto; }
.md .md-code code { padding: 0; background: none; color: #D5D9E4; font-size: 12.5px; line-height: 1.6; }
.md .md-lang { position: absolute; top: 6px; right: 10px; font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted-2); }
.md blockquote { margin: 0 0 14px; padding: 8px 14px; border-left: 3px solid #7E7BFF; border-radius: 0 10px 10px 0; background: rgba(126, 123, 255, .08); color: var(--text-2); }
.md blockquote > :last-child { margin-bottom: 0; }
.md ul, .md ol { margin: 0 0 12px; padding-left: 22px; }
.md li { margin: 2px 0; }
.md li > ul, .md li > ol { margin: 2px 0 0; }
.md li.md-task { list-style: none; margin-left: -22px; display: flex; align-items: flex-start; gap: 9px; flex-wrap: wrap; }
.md li.md-task > span { flex: 1; }
.md li.md-task > ul { flex-basis: 100%; }
.md .md-check { appearance: none; flex: none; width: 17px; height: 17px; margin: 4px 0 0; border-radius: 5px; border: 1.5px solid #4A5266; background: transparent; cursor: pointer; display: grid; place-content: center; }
.md .md-check:checked { border: 0; background: var(--grad); }
.md .md-check:checked::after { content: ''; width: 9px; height: 5px; margin-top: -2px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg); }
.md li.md-task:has(> .md-check:checked) > span { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--muted-2); }
.md hr { margin: 18px 0; border: 0; border-top: 1px solid var(--line-2); }
.md .md-table { width: 100%; margin: 0 0 14px; border-collapse: separate; border-spacing: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; font-size: 13px; font-variant-numeric: tabular-nums; }
.md th, .md td { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--line); }
.md th { background: var(--surface-2); color: var(--muted); font-weight: 500; font-size: 12px; }
.md tr:last-child td { border-bottom: 0; }
.md .md-al-c { text-align: center; } .md .md-al-r { text-align: right; }
.md mark { padding: 1px 3px; border-radius: 4px; color: #fff; }
.md .md-note { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 8px; border-radius: 7px; border: 1px solid rgba(155, 123, 255, .35); background: rgba(155, 123, 255, .12); color: #D9D3FF; font-size: 13px; }
.md .md-note::before { content: '↗'; font-size: 11px; opacity: .7; }
.md-c-red { color: var(--red); } .md-c-orange { color: var(--orange); } .md-c-yellow { color: var(--yellow); } .md-c-green { color: var(--green); } .md-c-teal { color: var(--teal); }
.md-c-blue { color: var(--blue); } .md-c-purple { color: var(--purple); } .md-c-pink { color: var(--pink); } .md-c-grey { color: var(--grey); }
.md-bg-red { background: rgba(255, 118, 118, .26); } .md-bg-orange { background: rgba(255, 159, 90, .26); } .md-bg-yellow { background: rgba(245, 200, 74, .28); }
.md-bg-green { background: rgba(61, 214, 140, .24); } .md-bg-teal { background: rgba(52, 198, 207, .24); } .md-bg-blue { background: rgba(110, 168, 255, .26); }
.md-bg-purple { background: rgba(169, 139, 255, .28); } .md-bg-pink { background: rgba(242, 127, 207, .26); } .md-bg-grey { background: rgba(154, 163, 181, .26); }

/* ----------------------------------------------------------------------------------- files view (grid) */
.fv { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 20px 80px; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.fv-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.fv-path { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; font-size: 18px; font-weight: 600; color: #fff; }
.fv-path .up, .fv-path .crumb { display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; background: none; color: #fff; font-size: 18px; font-weight: 600; white-space: nowrap; }
.fv-path .up { font-size: 14px; font-weight: 500; color: var(--muted); }
.fv-path .crumb .fi { color: var(--c, var(--muted)); }
.fv-path .up:hover, .fv-path .crumb:hover { text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--line-2); }
.fv .fine { margin: -8px 0 16px; font-size: 12.5px; color: var(--muted); }
.nt-empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 56px 20px; color: var(--muted-2); text-align: center; }
.nt-empty p { margin: 0; font-size: 14px; color: var(--muted); }
.slist { display: flex; flex-direction: column; gap: 6px; }
.srow { display: flex; align-items: flex-start; gap: 12px; width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); text-align: left; }
.srow:hover { border-color: #3A4257; }
.srow .dot { margin-top: 7px; }
.srow .pm { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.srow .pm b { font-size: 14px; font-weight: 500; }
.srow .snip { font-size: 12.5px; line-height: 1.5; color: var(--text-2); overflow-wrap: anywhere; }
.srow small { font-size: 11.5px; color: var(--muted-2); }
.slist .empty, .slist .fine { margin: 8px 2px; font-size: 13px; color: var(--muted); }
.fv-path .sep { color: var(--muted-2); font-weight: 400; }
.fv h4 { margin: 0 0 10px; font-size: 11px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--muted-2); }
.fgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: 12px; margin-bottom: 24px; }
.fcard { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); text-align: left; color: var(--text); }
.fcard:hover { border-color: #3A4257; }
.fcard .fico { width: 40px; height: 40px; border-radius: 11px; display: flex; align-items: center; justify-content: center; color: var(--c, var(--muted)); background: color-mix(in srgb, var(--c, #8A92A5) 16%, transparent); }
.fcard b { font-size: 14px; font-weight: 500; }
.fcard span { font-size: 12px; color: var(--muted); }
.ngrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(214px, 1fr)); gap: 12px; }
.ncard { position: relative; display: flex; flex-direction: column; min-height: 150px; padding: 14px 14px 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); text-align: left; color: var(--text); overflow: hidden; }
.ncard::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--c, transparent); }
.ncard b, .fcard b { display: flex; align-items: center; gap: 6px; min-width: 0; padding-right: 22px; font-size: 14px; font-weight: 500; }
.ncard b .t, .fcard b .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ncard b .i { color: var(--muted-2); }
.ncard p { flex: 1; margin: 7px 0 10px; font-size: 12.5px; line-height: 1.55; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ncard small { font-size: 11.5px; color: var(--muted-2); }
.ncard.sel, .fcard.sel { border-color: transparent; background: linear-gradient(var(--surface-2), var(--surface-2)) padding-box, var(--grad) border-box; border: 1.5px solid transparent; }
.tick { position: absolute; top: 10px; right: 10px; width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid #4A5266; display: flex; align-items: center; justify-content: center; color: #fff; }
.sel > .tick { border: 0; background: var(--grad); }
.selbar { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); display: flex; align-items: center; gap: 6px; padding: 7px 8px 7px 16px; border-radius: 14px;
  background: var(--surface-3); border: 1px solid var(--line-2); box-shadow: 0 18px 40px rgba(0, 0, 0, .45); white-space: nowrap; }
.selbar b { margin-right: 8px; font-size: 13px; font-weight: 500; }

/* -------------------------------------------------------------------------------- popovers and dialogs */
.pop { position: absolute; z-index: 30; padding: 10px; border-radius: 14px; background: #1E2433; border: 1px solid var(--line-2); box-shadow: 0 20px 50px rgba(0, 0, 0, .5); }
.pop h5 { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin: 2px 4px 8px; font-size: 11px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--muted-2); }
.swatches { display: grid; grid-template-columns: repeat(5, 30px); gap: 7px; margin-bottom: 10px; }
.sw { width: 30px; height: 30px; border-radius: 9px; border: 0; background: var(--c); display: flex; align-items: center; justify-content: center; color: #11141A; }
.sw.text { background: color-mix(in srgb, var(--c) 14%, transparent); color: var(--c); font-weight: 700; font-size: 14px; border: 1px solid color-mix(in srgb, var(--c) 30%, transparent); }
.sw.hl { background: color-mix(in srgb, var(--c) 28%, transparent); color: #fff; font-size: 13px; font-weight: 600; }
.sw.none { background: transparent; border: 1.5px dashed #4A5266; color: var(--muted); }
.sw.on { box-shadow: 0 0 0 2px #1E2433, 0 0 0 4px #fff; }
.pop .hint { margin: 2px 4px 0; font-size: 11.5px; color: var(--muted-2); line-height: 1.45; }
.pop .hint code { font-family: 'YCP Mono', monospace; color: var(--text-2); font-size: 11px; }
.menu { min-width: 220px; padding: 6px; }
.menu button { display: flex; align-items: center; gap: 10px; width: 100%; height: 34px; padding: 0 10px; border: 0; border-radius: 8px; background: none; color: var(--text-2); font-size: 13px; text-align: left; }
.menu button:hover, .menu button.hov { background: var(--surface-3); color: #fff; }
.menu button .i { color: var(--muted); }
.menu button.danger, .menu button.danger .i { color: var(--bad); }
.menu kbd { margin-left: auto; font-size: 11px; color: var(--muted-2); font-family: 'YCP Mono', monospace; }
.menu hr { margin: 5px 4px; border: 0; border-top: 1px solid var(--line-2); }
.menu .mlabel { display: flex; align-items: center; gap: 10px; height: 30px; padding: 0 10px; font-size: 13px; color: var(--text-2); }
.menu .mlabel .i { color: var(--muted); }
.menu .swrow { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px 10px 8px 36px; }
.menu button[disabled] { opacity: .45; cursor: not-allowed; }
.menu .swrow button.sw { flex: none; width: 20px; height: 20px; padding: 0; border-radius: 6px; background: var(--c); }
.menu .swrow button.sw.none { background: transparent; }
.menu .swrow button.sw.on { box-shadow: 0 0 0 2px #1E2433, 0 0 0 3.5px #fff; }

.scrim { position: fixed; inset: 0; z-index: 1500; background: rgba(5, 6, 10, .6); }
.dlg { position: fixed; z-index: 1501; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 440px; max-width: calc(100vw - 32px); padding: 22px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line-2); box-shadow: 0 30px 80px rgba(0, 0, 0, .55); }
.dlg h3 { margin: 0 0 4px; font-size: 18px; font-weight: 600; color: #fff; font-family: 'YCP UI', Arial, sans-serif !important; }
.dlg > p { margin: 0 0 14px; font-size: 13.5px; color: var(--muted); }
.dlg .pick { max-height: 290px; overflow-y: auto; padding: 6px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); }
.dlg .pick .row[disabled] { opacity: .45; cursor: not-allowed; }
.dlg .pick .row small { margin-left: auto; font-size: 11px; color: var(--muted-2); }
.dlg .acts { display: flex; align-items: center; gap: 10px; margin-top: 16px; }
.dlg .acts .grow { flex: 1; }
.dlg .names { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dlg .field { display: block; width: 100%; height: 42px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--bg); color: var(--text); font-size: 14px; outline: 0; }
.dlg .field:focus { border-color: #5E7BFF; }
.dlg .swrow.in-dlg { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.dlg .swrow.in-dlg .sw { width: 26px; height: 26px; border-radius: 8px; }
.dlg .pick .row.sel { background: rgba(155, 123, 255, .14); color: #fff; }
.nt .btn.primary.danger-fill { background: #C2414B; box-shadow: none; }
.linkbtn.danger { color: var(--bad); }
.linkbtn { border: 0; background: none; color: var(--link); font-size: 13px; font-weight: 500; padding: 0; display: inline-flex; align-items: center; gap: 6px; }

.banners:empty { display: none; }
.banners { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.banner { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin: 0 18px; padding: 10px 12px 10px 14px; border-radius: 12px; font-size: 13px; line-height: 1.45; }
.banner.warn { background: rgba(245, 185, 74, .1); border: 1px solid rgba(245, 185, 74, .3); color: #F7D9A0; }
.banner .i { color: var(--warn); }
.banner span { flex: 1; min-width: 200px; }
.toast { position: fixed; z-index: 1600; left: 50%; bottom: 28px; transform: translateX(-50%); display: flex; align-items: center; gap: 14px; max-width: calc(100vw - 32px); padding: 11px 16px; border-radius: 12px;
  background: var(--surface-3); border: 1px solid var(--line-2); color: var(--text); font-size: 13px; box-shadow: 0 18px 40px rgba(0, 0, 0, .45); }

/* Before the notes arrive, and in place of them when Notes is off or did not load. */
.nt-work.is-loading .nt-files, .nt-work.is-loading .nt-pane { background: linear-gradient(90deg, var(--surface) 0%, #181D28 50%, var(--surface) 100%); background-size: 200% 100%; animation: nt-shine 1.4s linear infinite; }
@keyframes nt-shine { to { background-position: -200% 0; } }
.nt-state { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; max-width: 560px; padding: 22px 24px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); font-size: 14px; color: var(--text-2); }
.nt-state b { font-size: 17px; font-weight: 600; color: var(--text); }
.nt-state-acts { display: flex; gap: 10px; margin-top: 8px; }
.nt-state-acts a.btn { text-decoration: none; }

/* --------------------------------------------------------------------------------------------- phones */
.nt-phonebar, .nt-seg, .nt-phonetools, .sheet { display: none; }
@media (max-width: 750px) {
  .nt { padding: 16px 14px 0; }
  .nt-head { margin-bottom: 12px; align-items: center; }
  .nt-head h1 { font-size: 24px; }
  .nt-head p { display: none; }
  .nt-head-r .btn:not(.primary) { display: none; }
  .nt-work { display: block; height: auto; min-height: 0; }
  .nt[data-view="files"] .nt-pane { display: none; }
  .nt[data-view="note"] .nt-files, .nt[data-view="note"] .nt-head { display: none; }
  body.nt-open .dock, body.nt-open .dock-fade { display: none !important; }
  body.nt-open { margin-bottom: 0 !important; }
  body.nt-open .ann-strip { display: none !important; }
  .nhead, .crumbs { display: none; }
  .nt[data-view="note"] { padding: 0; }

  .nt-files { border: 0; background: none; border-radius: 0; }
  .nt-search { margin: 0 0 10px; height: 42px; background: var(--surface); }
  .nt-search kbd { display: none; }
  .plist .empty, .plist .fine { margin: 14px 4px; font-size: 13.5px; color: var(--muted); }
  .phead { display: flex; align-items: center; gap: 8px; margin: 2px 0 2px; }
  .pback { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px 0 6px; border: 0; border-radius: 10px; background: none; color: var(--muted); font-size: 13.5px; }
  .phead .ib, .phead .linkbtn { margin-left: auto; }
  .ptitle { margin: 4px 4px 0; font-family: 'YCP UI', Arial, sans-serif !important; font-size: 20px; font-weight: 600; color: #fff; }
  .slist .srow, .plist .srow { margin-bottom: 6px; }
  .nt-seg { display: flex; margin-bottom: 12px; }
  .nt-seg .seg { margin: 0; width: 100%; }
  .nt-seg .seg button { flex: 1; justify-content: center; height: 34px; font-size: 13px; }
  .nt-seg em { font-style: normal; display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--surface-3); font-size: 11px; color: var(--text-2); }
  .nt-tree { padding: 0; overflow: visible; }
  .nt-tree .tree-desk { display: none; }
  .plist { display: flex; flex-direction: column; }
  .plist .grp { margin: 14px 4px 8px; font-size: 11px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--muted-2); }
  .plist .card { border-radius: 16px; background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
  .prow { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border: 0; background: none; color: var(--text); text-align: left; }
  .prow + .prow { border-top: 1px solid var(--line); }
  .prow .pic { flex: none; width: 38px; height: 38px; border-radius: 11px; display: flex; align-items: center; justify-content: center; color: var(--c, var(--muted)); background: color-mix(in srgb, var(--c, #8A92A5) 15%, transparent); }
  .prow .pm { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
  .prow .pm b { font-size: 14.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .prow .pm span { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .prow .chev { color: var(--muted-2); }
  .prow .when { flex: none; font-size: 11.5px; color: var(--muted-2); align-self: flex-start; margin-top: 3px; }
  .nt-foot { margin-top: 14px; padding: 12px 4px 120px; border-top: 0; }

  .nt-pane { border: 0; border-radius: 0; height: 100vh; height: 100dvh; background: var(--surface); }
  .tabs, .nhead .acts-desk, .tools, .crumbs.desk, .status .r2 { display: none; }
  .nt-phonebar { display: flex; align-items: center; gap: 6px; height: 56px; padding: 0 8px; border-bottom: 1px solid var(--line); background: #12161E; }
  .nt-phonebar .ib { width: 40px; height: 40px; border-radius: 12px; color: var(--text-2); }
  .nt-phonebar .pt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
  .nt-phonebar .pt b { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .nt-phonebar .pt span { font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 5px; }
  .tabsbtn { position: relative; display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 0; background: none; color: var(--text-2); }
  .tabsbtn i { position: absolute; display: flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 6px; border: 1.8px solid currentColor; font-style: normal; font-size: 11px; font-weight: 600; }
  .nhead { padding: 12px 16px 6px; }
  .nhead .ttl { font-size: 19px; }
  .modebar { display: flex; padding: 10px 16px 4px; }
  .banners { margin-top: 0; padding-top: 8px; }
  .banner { margin: 0 12px; }
  .modebar .seg { margin: 0; }
  .doc.split { grid-template-columns: 1fr; }
  .doc.split .view { display: none; }
  .src { padding: 14px 16px 30px; font-size: 13.5px; background: var(--surface); }
  .view { padding: 8px 16px 30px; }
  .nt-phonetools { display: flex; align-items: center; gap: 2px; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); overflow-x: auto; border-top: 1px solid var(--line); background: #12161E; scrollbar-width: none; }
  .nt-phonetools .ib { flex: none; width: 40px; height: 40px; border-radius: 10px; color: var(--text-2); }
  .nt-phonetools .sep { flex: none; width: 1px; height: 22px; margin: 0 4px; background: var(--line-2); }
  .status { height: 32px; padding: 0 16px; }

  .pop.as-sheet { position: fixed; left: 0 !important; right: 0; top: auto !important; bottom: 0; z-index: 1501; max-height: 80vh; overflow-y: auto; min-width: 0;
    padding: 10px 12px calc(18px + env(safe-area-inset-bottom)); border-radius: 22px 22px 0 0; }
  .pop.as-sheet::before { content: ''; display: block; width: 40px; height: 4px; border-radius: 4px; background: var(--line-2); margin: 0 auto 10px; }
  .menu.as-sheet button { height: 44px; font-size: 14px; }
  .toast { bottom: 20px; }
  .sheet { display: block; position: fixed; z-index: 1501; left: 0; right: 0; bottom: 0; max-height: 80vh; padding: 10px 16px 26px; border-radius: 22px 22px 0 0; background: var(--surface); border-top: 1px solid var(--line-2); box-shadow: 0 -24px 60px rgba(0, 0, 0, .45); }
  .sheet h3 { display: flex; align-items: baseline; gap: 8px; margin: 0 2px 12px; font-size: 17px; font-weight: 600; color: #fff; font-family: 'YCP UI', Arial, sans-serif !important; }
  .sheet h3 small { font-size: 12.5px; font-weight: 400; color: var(--muted); }
  .sheet h3 .linkbtn { margin-left: auto; }
  .trow { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 13px; }
  .trow.on { background: rgba(155, 123, 255, .13); }
  .trow .pm { flex: 1; min-width: 0; display: flex; flex-direction: column; }
  .trow .pm b { font-size: 14.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .trow .pm span { font-size: 12px; color: var(--muted); }
  .trow .dot { width: 10px; height: 10px; }
  .sheet .newtab { margin-top: 10px; width: 100%; }
  .dlg { top: auto; bottom: 0; transform: translateX(-50%); width: 100%; max-width: none; border-radius: 22px 22px 0 0; }
}
