/* list.css (B6a): My characters (.ls-*), the sign-in screen (.si-*), the
 * dialogs they open, and the shell's notices above a screen (.cs-notice:
 * the missing rules pack, a conflict on the open sheet). Kit's Clean
 * tokens only; every transition names a --duration and an --ease token.
 * Targets are 44 px on a touch screen or under 560 px. */

/* ---- notices above the screen ---- */
.cs-notices { max-width: 1240px; margin: 0 auto; padding: 0 16px; }
.cs-notices:empty { display: none; }
.cs-notice {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 12px; padding: 10px 12px;
  border-radius: var(--radius); background: var(--warning-soft); color: var(--warning-soft-text); font-size: var(--text-sm);
}
.cs-notice-text { flex: 1 1 240px; min-width: 0; overflow-wrap: anywhere; }
.cs-notice .ls-conflict { flex: 1 1 100%; margin: 0; padding: 0; background: none; color: inherit; }

/* ---- the list ---- */
.ls-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ls-banners { display: flex; flex-direction: column; gap: 8px; }
.ls-banners:not(:empty) { margin-bottom: 12px; }
.ls-banner {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 10px 12px;
  border-radius: var(--radius); background: var(--accent-soft); color: var(--accent-soft-text); font-size: var(--text-sm);
}
.ls-banner.is-ok { background: var(--success-soft); color: var(--success-soft-text); }
.ls-banner.is-danger { background: var(--danger-soft); color: var(--danger-soft-text); }
.ls-banner-text { flex: 1 1 260px; min-width: 0; overflow-wrap: anywhere; }
.ls-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.ls-file { display: none; }
.ls-search {
  flex: 1 1 200px; max-width: 320px; min-width: 0; min-height: 34px; padding: 6px 10px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit; font-size: var(--text-sm);
}
.ls-search:focus-visible, .ls-card .ls-name:focus-visible, .si-input:focus-visible, .ls-trash summary:focus-visible { outline: none; box-shadow: var(--ring); }
.ls-status { min-height: 1.4em; margin: 0 0 8px; font-size: var(--text-sm); color: var(--text-muted); }
.ls-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 12px; }
.ls-cards > .empty { grid-column: 1 / -1; }
.ls-card {
  display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 14px;
  border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); color: var(--text);
  box-shadow: var(--shadow-1);
  transition: box-shadow var(--duration) var(--ease-standard), border-color var(--duration) var(--ease-standard);
}
@media (hover: hover) { .ls-card:hover { box-shadow: var(--shadow-2); } }
.ls-card-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ls-avatar {
  display: inline-flex; flex: none; align-items: center; justify-content: center; width: 40px; height: 40px;
  border-radius: var(--radius-full); background: var(--accent-soft); color: var(--accent-soft-text); font-weight: 600;
}
.ls-card-title { min-width: 0; }
.ls-name { display: inline-block; color: var(--text); font-weight: 600; font-size: var(--text-lg); text-decoration: none; overflow-wrap: anywhere; }
.ls-summary { font-size: var(--text-sm); color: var(--text-muted); overflow-wrap: anywhere; }
.ls-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.ls-sync[data-state="synced"] { background: var(--success-soft); color: var(--success-soft-text); border-color: transparent; }
.ls-sync[data-state="conflict"] { background: var(--warning-soft); color: var(--warning-soft-text); border-color: transparent; }
.ls-sync[data-state="offline"], .ls-sync[data-state="dirty"], .ls-sync[data-state="syncing"] { background: var(--info-soft); color: var(--info-soft-text); border-color: transparent; }
.ls-sync[data-state="rejected"] { background: var(--danger-soft); color: var(--danger-soft-text); border-color: transparent; }
.ls-actions { margin-top: auto; }
.ls-sync-toggle { min-height: 34px; }
.ls-conflict {
  display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 10px 12px;
  border-radius: var(--radius); background: var(--warning-soft); color: var(--warning-soft-text); font-size: var(--text-sm);
}
.ls-conflict-text { margin: 0; overflow-wrap: anywhere; }

/* ---- the trash ---- */
.ls-trash-wrap { min-width: 0; }
.ls-trash { margin-top: 20px; font-size: var(--text-sm); }
.ls-trash summary { display: list-item; padding: 8px 0; min-height: 34px; cursor: pointer; color: var(--text-muted); border-radius: var(--radius-sm); }
.ls-trash-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ls-trash-item { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ls-trash-name { flex: 1 1 160px; min-width: 0; overflow-wrap: anywhere; }

/* ---- dialogs (import clash, compare) ---- */
.ls-dialog {
  width: min(480px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 0; overflow: auto;
  border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface-raised); color: var(--text);
  box-shadow: var(--shadow-3);
}
.ls-dialog::backdrop { background: var(--scrim); }
.ls-dialog-form { display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 16px; }
.ls-dialog-form p { margin: 0; overflow-wrap: anywhere; }
.ls-dialog-title { margin: 0; font-size: var(--text-lg); }
.ls-dialog-actions { justify-content: flex-end; }
.ls-compare { width: 100%; border-collapse: collapse; font-size: var(--text-sm); table-layout: fixed; }
.ls-compare th, .ls-compare td { padding: 6px 8px; text-align: left; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
.ls-compare thead th { color: var(--text-muted); font-weight: 600; }
.ls-compare tr.is-different td { background: var(--warning-soft); color: var(--warning-soft-text); }

/* ---- sign in ---- */
.si-screen { max-width: 420px; margin: 0 auto; }
.si-intro, .si-who, .si-note { margin: 0 0 12px; overflow-wrap: anywhere; }
.si-note { padding: 10px 12px; border-radius: var(--radius); background: var(--success-soft); color: var(--success-soft-text); font-size: var(--text-sm); }
.si-form { display: flex; flex-direction: column; gap: 12px; }
.si-field { display: flex; flex-direction: column; gap: 4px; }
.si-label { font-size: var(--text-sm); font-weight: 600; }
.si-input {
  min-height: 44px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font: inherit;
}
.si-error { min-height: 1.4em; margin: 0; color: var(--danger-soft-text); font-size: var(--text-sm); }
.si-error:empty { min-height: 0; }
.si-submit { justify-content: center; min-height: 44px; }
.si-account { margin-top: 16px; }

/* ---- touch: 44 px targets ---- */
@media (pointer: coarse), (max-width: 559px) {
  .ls-list .cs-btn, .si-screen .cs-btn, .ls-dialog .cs-btn, .cs-notice .cs-btn, .ls-search, .ls-sync-toggle, .ls-trash summary { min-height: 44px; }
  .ls-list .cs-btn, .si-screen .cs-btn, .ls-dialog .cs-btn, .cs-notice .cs-btn { min-width: 44px; }
  .ls-name { display: inline-flex; align-items: center; min-height: 44px; }
  .ls-sync-toggle input { width: 20px; height: 20px; }
  .cs-appnav a { min-width: 44px; justify-content: center; }
}
@media (max-width: 559px) {
  .ls-search { flex-basis: 100%; max-width: none; }
  .ls-tools .cs-spacer, .ls-actions .cs-spacer { display: none; }
}
