/* 綴 横断表示 build 202612050001. The list column shows every memo with its title, body and folders, editable in place (a long body folded to its first lines until it is used). */
/* The switch sits beside the search box: both decide how the list is looked at. */
.list-tools{display:flex;flex-wrap:wrap;align-items:center;gap:6px 8px;margin:0 12px 6px;flex:none}
.list-tools .search{flex:1 1 140px;min-width:0;margin:0}
.vswitch{display:inline-flex;flex:none;padding:3px;gap:2px;border-radius:9px;background:var(--paper-2)}
.vswitch[hidden]{display:none}
.vswitch button{height:30px;min-width:44px;padding:0 10px;border-radius:7px;font:500 12.5px/1 var(--sans);color:var(--ink-2);white-space:nowrap}
.vswitch button.on{background:var(--surface);color:var(--ink);box-shadow:0 1px 2px rgba(0,0,0,.12)}
.vswitch.off{opacity:.5}
.vswitch button:disabled{cursor:default;opacity:1}
@media (max-width:900px){
  .list-tools{margin:0 16px 8px;gap:8px}
  .list-tools .search{margin:0}
  .vswitch{padding:4px;border-radius:12px}
  .vswitch button{height:40px;min-width:54px;padding:0 12px;font-size:14px;border-radius:9px}
}

/* Desktop: while the cross view is the working surface, the editor column folds away and the list takes the width. */
@media (min-width:901px){
  body.cross-mode:not(.hl) #app{grid-template-columns:var(--left) minmax(0,1fr) 0 var(--side) var(--strip)}
  body.cross-mode:not(.hl) #editor,body.cross-mode:not(.hl) #rs2{display:none}
  body.cross-mode:not(.hl) #list{border-right:0}
  body.cross-mode:not(.hl) #listHide{display:none}
  /* The editor is folded away, so the keys of the rail that act on the open memo rest until it comes back. */
  body.cross-mode:not(.hl) #strip .ib:not(#stFont):not(#stTpl):not(#stBackup){opacity:.3;pointer-events:none}
  #notes.cross{padding:4px 24px 48px}
  #notes.cross .xwrap{max-width:calc(var(--fs) * var(--measure) + 72px);margin:0 auto}
}
@media (max-width:900px){
  #notes.cross{padding:6px 16px 120px}
}

#notes.cross .xrow{position:relative;background:var(--surface);border:1px solid var(--line);border-radius:12px;margin:0 0 12px;padding:8px 16px 6px}
#notes.cross .xrow:focus-within{border-color:var(--caret)}
.xtitle:focus-visible,.xbody:focus-visible{outline:none}
#notes.cross .xrow.locked{background:var(--paper-2)}
.xhead{display:flex;align-items:center;gap:6px}
.xtitle{flex:1;min-width:0;border:0;outline:0;background:transparent;color:var(--ink);font-family:var(--serif);font-size:calc(var(--fs) * 1.15);font-weight:500;line-height:1.5;padding:6px 0;letter-spacing:.02em;caret-color:var(--caret)}
.xstate{flex:none;font-family:var(--sans);font-size:12px;color:var(--ink-3);white-space:nowrap}
.xstate.err{color:var(--shu)}
.xmore{width:32px;height:32px}
.xbody{display:block;width:100%;border:0;outline:0;background:transparent;color:var(--ink);font-family:var(--serif);font-size:var(--fs);line-height:var(--lh);padding:2px 0 8px;min-height:calc(var(--lh) * 2.4);white-space:pre-wrap;word-break:break-all;overflow-wrap:anywhere;tab-size:2;letter-spacing:.01em;font-kerning:none;font-variant-ligatures:none;resize:none;overflow:hidden;caret-color:var(--caret)}
.xtitle::placeholder,.xbody::placeholder{color:var(--ink-3);opacity:.8}
.xrow.locked .xtitle,.xrow.locked .xbody{color:var(--ink-2)}
.xmap{display:none;font-family:var(--serif);font-size:var(--fs);line-height:var(--lh);color:var(--ink-2);white-space:pre-wrap;padding:2px 0 8px;cursor:pointer}
.xmap .map-kind{display:inline-block;font-family:var(--sans);font-size:11px;color:var(--ink-3);border:1px solid var(--line);border-radius:999px;padding:0 8px;margin-right:6px;vertical-align:middle}
.xrow.map .xbody{display:none}
.xrow.map .xmap{display:block}
.xfoot{display:flex;align-items:center;gap:8px;min-height:28px;font-family:var(--sans);font-size:12px;color:var(--ink-2)}
.xfolders{flex:1;min-width:0;display:flex;flex-wrap:wrap;gap:6px}
.xfolder{display:inline-flex;align-items:center;gap:4px;max-width:14em;height:22px;padding:0 9px;border-radius:11px;background:var(--paper-2);color:var(--ink-2);font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer}
.xfolder:hover{background:var(--paper-3);color:var(--ink)}
.xfolder svg{width:13px;height:13px}
.xtime{flex:none;font-variant-numeric:tabular-nums;color:var(--ink-3)}
/* Folding: a long memo shows its first lines, the last of them fading out, and a key at its foot opens it and folds it again. */
.xrow.folded .xbody{-webkit-mask-image:linear-gradient(to bottom,#000 52%,transparent 98%);mask-image:linear-gradient(to bottom,#000 52%,transparent 98%)}
.xfold{flex:none;width:32px;height:28px;margin-right:-6px;color:var(--ink-2)}
.xfold[hidden]{display:none}
/* Beside the switch: a key like the ones in the header (it is pressed, so it stands out of the paper). */
.xfoldall{flex:none;width:36px;height:36px;color:var(--ink-2);background:linear-gradient(var(--key-top,var(--surface)),var(--key-bottom,var(--paper-2)));border:1px solid var(--key-edge,var(--line-2));box-shadow:var(--raised-shadow,none);border-radius:var(--r-key,9px)}
.xfoldall:active{background:var(--key-bottom,var(--paper-2));box-shadow:var(--pressed-shadow,none)}
.xfoldall[hidden]{display:none}
.xfold svg{width:18px;height:18px}
@media (max-width:900px){.xfold{width:44px;height:36px;margin-right:-10px}}
.xadd{display:flex;justify-content:flex-start;padding:4px 0 8px}
.xadd .btn{display:inline-flex;align-items:center;gap:8px;color:var(--ink-2)}
.xadd .btn:hover{color:var(--ink)}
.xempty{padding:40px 8px;text-align:center;color:var(--ink-2);font-size:14px;line-height:1.9}
.xempty b{display:block;color:var(--ink);font-weight:500}
@media (prefers-reduced-motion:no-preference){#notes.cross .xrow{transition:border-color .12s}}

/* 入力補助 (keybar.js): on a phone, the keys for lists and levels sit above the on-screen keyboard while a memo is being written. */
.kbar{display:none}
html[data-mode="single-note"] .kbar{display:none!important}
@media (max-width:900px){
  .kbar:not([hidden]){display:flex;align-items:center;gap:4px;flex:none;min-height:56px;padding:6px 10px calc(6px + var(--sab));background:var(--paper-2);border-top:1px solid var(--line);overflow-x:auto;overscroll-behavior:contain;scrollbar-width:none}
  .kbar::-webkit-scrollbar{display:none}
  .kbar button{flex:none;display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;border-radius:10px;border:1px solid var(--line-2);background:var(--surface);color:var(--ink)}
  .kbar button svg{width:20px;height:20px}
  .kbar .kbar-gap{flex:1 0 2px}
  .kbar .kbar-done{position:sticky;right:0}
  /* In a memo the row folds into its handle (keybar.js). Folded, the bar takes no row: the handle floats over the lower right corner of the text,
     exactly where it stands at the end of the drawn-out row, so a tap changes the row and not the place of the handle. */
  .kbar .kbar-more{border-radius:50%}
  .kbar .kbar-more svg{transition:transform .16s}
  .kbar:not(.folded) .kbar-more svg{transform:rotate(180deg)}
  .kbar.folded:not([hidden]){position:absolute;right:0;bottom:0;z-index:4;min-height:0;padding:6px 10px calc(6px + var(--sab));background:none;border:0;box-shadow:none;overflow:visible;pointer-events:none}
  .kbar.folded>*{display:none}
  .kbar.folded>.kbar-more{display:inline-flex;pointer-events:auto;box-shadow:0 2px 10px rgb(0 0 0 / .28)}
  /* the key for chosen text: beside the handle, also while the row is folded away */
  .kbar .kbar-sel{color:var(--caret)}
  /* the key whose list is open stays lit */
  .kbar button[aria-pressed=true]{background:var(--ai-soft);border-color:var(--ai);color:var(--ai)}
  .kbar .kbar-sel[hidden]{display:none!important}
  /* with one key more, the drawn-out row still fits a phone's width */
  .kbar.has-sel:not(.folded) button{width:40px}
  .kbar.folded>.kbar-sel:not([hidden]){display:inline-flex;pointer-events:auto;border-radius:50%;box-shadow:0 2px 10px rgb(0 0 0 / .28)}
  @media (prefers-reduced-motion:no-preference){.kbar.drawn:not(.folded) .kbar-keys>button{animation:kbar-draw .16s ease-out both}}
  @keyframes kbar-draw{from{opacity:0;transform:translateX(18px)}to{opacity:1;transform:none}}
  .kbar[data-kind=cross] [data-only=ed],.kbar[data-kind=ed] [data-only=cross]{display:none}
  body[data-kb=cross] #list>.list-bottom{display:none}
  @media (max-width:340px){.kbar button{width:40px}.kbar [data-k=redo]{display:none}}
  /* The keys of the row stand in a strip that slides sideways; the key for chosen words and the handle stand beside it and stay where they are.
     On a narrow phone seven keys of a memo are in view (the padding takes 20px, the handle 44px with its gap 4px, the six gaps 24px, and the edge of the
     eighth key 12px with its gap): the strip fades where it goes on, and can be slid to やり直す and 行を選ぶ. From about 500px on everything is in view. */
  .kbar .kbar-keys{display:flex;align-items:center;gap:4px;flex:1 1 auto;min-width:0;overflow-x:auto;overscroll-behavior:contain;scrollbar-width:none}
  .kbar .kbar-keys::-webkit-scrollbar{display:none}
  .kbar.folded>.kbar-keys{display:none}
  .kbar .kbar-keys.more-right{-webkit-mask-image:linear-gradient(to right,#000 calc(100% - 20px),transparent);mask-image:linear-gradient(to right,#000 calc(100% - 20px),transparent)}
  .kbar .kbar-keys.more-left{-webkit-mask-image:linear-gradient(to right,transparent,#000 20px);mask-image:linear-gradient(to right,transparent,#000 20px)}
  .kbar .kbar-keys.more-left.more-right{-webkit-mask-image:linear-gradient(to right,transparent,#000 20px,#000 calc(100% - 20px),transparent);mask-image:linear-gradient(to right,transparent,#000 20px,#000 calc(100% - 20px),transparent)}
  .kbar[data-kind=ed]:not(.folded) .kbar-keys button{width:min(44px,calc((100vw - 108px) / 7))}
  /* While words are chosen in a memo, the key for them stands where the handle stands, and the handle is away for that time. Nothing else gives way:
     the strip keeps its width, so a key that was pressed (行を選ぶ, pressed again to choose more) is still under the finger. */
  .kbar[data-kind=ed].has-sel:not(.folded) .kbar-more{display:none}
  .kbar[data-kind=ed].has-sel:not(.folded) .kbar-sel{width:44px}
  body[data-kb=ed] .pane:not(.empty) .edwrap{margin-bottom:8px}
}
/* The list key holds more: a long press offers the list styles. The corner mark says so without words. */
@media (max-width:900px){
  .kbar button{-webkit-touch-callout:none;-webkit-user-select:none;user-select:none;touch-action:manipulation}
  .kbar [data-k=list]{position:relative}
  .kbar [data-k=list]::after{content:'';position:absolute;right:5px;bottom:5px;width:0;height:0;border-left:5px solid transparent;border-bottom:5px solid var(--ink-3)}
}
