/* Uniform compact tiles: bounded text slots, reserved actions, no whole-card clipping.
   Long titles retain their full accessible text and native title tooltip. */
body.notes-library-page {
  --notes-card-height: 180px;
  font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
}
body.notes-library-page .notes-doc-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr));
  grid-auto-rows: var(--notes-card-height);
  gap: .625rem;
  align-items: stretch;
}
body.notes-library-page .notes-doc-grid > .tool-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-width: 0;
  height: 100%;
  min-height: 0;
  padding: .625rem;
  border-radius: .5rem;
  overflow: visible;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  opacity: 1;
  text-align: left;
  transform: none;
}
body.notes-library-page .notes-doc-grid > .tool-card:hover {
  border-color: var(--accent-text);
  background: var(--bg-card);
  background-clip: border-box;
}
body.notes-library-page .notes-doc-link,
body.notes-library-page #notesGroupGrid .notes-doc-link {
  display: grid;
  grid-template-rows: 20px 2.8rem 1.25rem 1.125rem;
  align-content: start;
  height: auto;
  min-width: 0;
  padding: 0;
  flex: 1 1 auto;
  gap: .1875rem;
  border-radius: .25rem;
}
body.notes-library-page .notes-doc-card .tool-card-icon {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: .5rem;
  font-size: 1rem;
  margin: 0;
  line-height: 1.25;
}
body.notes-library-page .notes-doc-card .tool-card-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
  word-break: normal;
  min-height: 0;
  margin: 0;
  font-size: 1rem;
  line-height: 1.4;
  color: var(--text);
}
body.notes-library-page .notes-doc-card .tool-card-desc {
  -webkit-line-clamp: 1;
  font-size: .8125rem;
  line-height: 1.5;
  color: var(--text-muted);
  overflow-wrap: anywhere;
  margin: 0;
}
body.notes-library-page .notes-doc-time {
  font-size: .75rem;
  line-height: 1.5;
  margin-top: 0;
  padding-top: 0;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}
body.notes-library-page .notes-doc-grid .notes-doc-card .notes-doc-actions,
body.notes-library-page .public-note-actions {
  position: static;
  order: 2;
  width: 100%;
  display: flex;
  flex-flow: row wrap;
  align-items: center;
  justify-content: flex-end;
  gap: .25rem;
  flex-shrink: 0;
  margin-top: .375rem;
  padding-top: 0;
  border-top: 0;
}
body.notes-library-page .notes-doc-actions .notes-doc-delete-form { position: static; margin: 0; }
/* Fine-pointer desktop gets quiet compact controls; touch remains generous.
   Override the shared destructive button's paint only, never its hold logic. */
body.notes-library-page .notes-doc-actions button,
body.notes-library-page .public-note-actions .btn {
  width: auto;
  height: auto;
  min-width: 0;
  min-height: 28px;
  max-width: 100%;
  padding: .1875rem .375rem;
  border: 1px solid var(--border) !important;
  border-radius: .25rem;
  background: var(--bg-input) !important;
  color: var(--text);
  font-size: .8125rem;
  font-weight: 500;
  line-height: 1.4;
  white-space: normal;
  transform: none;
  box-shadow: none !important;
  text-decoration: none;
}
body.notes-library-page .notes-doc-actions button[data-hold-delete] {
  border-color: color-mix(in srgb, var(--danger) 45%, var(--bg-card)) !important;
}
body.notes-library-page .notes-doc-actions button:hover,
body.notes-library-page .public-note-actions .btn:hover {
  background: var(--bg-input) !important;
  border-color: var(--border) !important;
  color: var(--accent-text);
}
body.notes-library-page .notes-vis-badge {
  margin: 0;
  font-size: .75rem;
  line-height: 1.5;
  white-space: nowrap;
  max-width: calc(100% - 1.5rem);
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-muted);
  background: var(--bg-input);
  border-color: var(--border);
  letter-spacing: 0;
}
body.notes-library-page .notes-vis-public { color: var(--success-text); background: var(--bg-card); }
body.notes-library-page .notes-group-card { gap: .25rem; }
body.notes-library-page .notes-group-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: .25rem .5rem;
  align-items: start;
  grid-template-rows: 2.8rem 1.125rem;
}
body.notes-library-page .notes-group-folder-icon { font-size: 1rem; line-height: 1.4; }
body.notes-library-page .notes-group-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  font-size: 1rem;
  line-height: 1.4;
  white-space: normal;
  overflow-wrap: anywhere;
  overflow: hidden;
}
body.notes-library-page .notes-group-count {
  grid-column: 2;
  padding: 0;
  background: none;
  color: var(--text-muted);
  font-size: .75rem;
  line-height: 1.5;
  white-space: normal;
}
body.notes-library-page .notes-group-thumbs {
  gap: .125rem;
  padding: .25rem 0 0;
  border-top: 1px solid var(--border);
  border-radius: 0;
  background: none;
}
body.notes-library-page .notes-group-thumb-row { font-size: .8125rem; line-height: 1.4; }
body.notes-library-page .notes-group-thumb-title { color: var(--text); opacity: 1; }
body.notes-library-page .notes-group-thumb-more { font-size: .75rem; padding-top: .125rem; }
body.notes-library-page .notes-list-tip { font-size: .8125rem; line-height: 1.5; margin-bottom: .625rem; }
body.notes-library-page .tool-section-title {
  width: auto;
  min-height: 0;
  padding: 0;
  margin-bottom: .5rem;
  border: 0;
  background: none;
  box-shadow: none;
  font-size: 1.125rem;
  line-height: 1.5;
}
body.notes-library-page .tool-section-title::before { display: none; }
@media (max-width: 600px) {
  body.notes-library-page .notes-doc-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (any-pointer: coarse) and (max-width: 600px) {
  body.notes-library-page { --notes-card-height: 196px; }
  body.notes-library-page .notes-doc-actions button,
  body.notes-library-page .public-note-actions .btn { min-height: 44px; padding: .5rem; }
}
