/* Timeline bookmarks (bookmarks.js): flags on the strip, the add / edit popover, the list. Loaded after timeline.css. */

/* ---- flags: amber (the brand, never an alert color), a thin line down the strip ---- */
.tlbms { position: absolute; inset: 0; pointer-events: none; z-index: 4; }
.tlbm { position: absolute; top: 21px; width: 18px; height: 18px; padding: 0; transform: translateX(-9px); display: flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--accent); border-radius: 5px; background: var(--surface); color: var(--accent); cursor: pointer; pointer-events: auto; box-shadow: 0 0 0 1px var(--surface); }
.tlbm::before { content: ""; position: absolute; left: 7px; top: 17px; width: 2px; height: 120px; background: var(--accent); opacity: .55; pointer-events: none; }
.tlbm.all::before { background: repeating-linear-gradient(to bottom, var(--accent) 0 4px, transparent 4px 7px); opacity: .7; }
.tlbm::after { content: ""; position: absolute; inset: -6px -5px; }
.tlbm .ic { width: 11px; height: 11px; stroke-width: 2.5; }
.tlbm.kept { background: var(--accent); color: var(--accent-ink); }
.tlbm.kept .ic { fill: currentColor; }
.tlbm:hover, .tlbm:focus-visible { transform: translateX(-9px) scale(1.15); z-index: 2; outline: none; }
.tlbm:focus-visible { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
@media (pointer: coarse) { .tlbm::after { inset: -10px -8px; } }
#tlBm .ic, #tlBmList .ic { color: var(--accent); }
#tlBm[hidden] { display: none; }
@media (max-width: 600px) { #tlBmList span { display: none; } }

/* ---- hover note ---- */
.bmtip { max-width: 300px; }
.bmtip .tt1 .ic { width: 14px; height: 14px; color: var(--accent); }
.bmnote { white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; }
.bmtip .bmnote { margin: 2px 0; font-size: var(--fs); }

/* ---- popover: add / edit form, one bookmark ---- */
.bmpop { width: min(340px, calc(100vw - 12px)); padding: 10px; }
.bmh { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.bmh .ic { width: 16px; height: 16px; color: var(--accent); flex: none; }
.bmh .tm { margin-left: auto; color: var(--muted); font-size: var(--fs-s); font-variant-numeric: tabular-nums; text-align: right; }
.bmform textarea { display: block; width: 100%; box-sizing: border-box; min-height: 64px; resize: vertical; font: inherit; }
.bmrow { display: flex; align-items: center; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.bmrow select { flex: 1 1 140px; min-width: 0; width: auto; }
.bmkeep { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; cursor: pointer; }
.bmkeep input { margin: 0; }
.bmerr { margin-top: 6px; color: var(--bad); font-size: var(--fs-s); }
.bmerr[hidden] { display: none; }
.bmbtns { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.bmbtns .bmcount { margin-right: auto; color: var(--muted); font-size: var(--fs-s); font-variant-numeric: tabular-nums; }
.bmview .bmnote { margin: 4px 0 6px; }
.bmview .tm, .bmpop .tm { color: var(--muted); font-size: var(--fs-s); }
.bmbtns .btn .ic { width: 15px; height: 15px; }

/* ---- the list ---- */
.bmdlg { width: min(620px, 96vw); }
.bmfil { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.bmq { position: relative; flex: 1 1 220px; display: flex; flex-direction: row; align-items: center; margin: 0; }
.bmq .ic { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--muted); pointer-events: none; }
.bmq input { width: 100%; padding-left: 30px; }
.bmfil select { flex: 0 1 180px; min-width: 0; width: auto; }
.bmrows { display: flex; flex-direction: column; gap: 2px; max-height: min(60vh, 520px); overflow-y: auto; margin-bottom: 8px; }
.bmr { display: flex; align-items: stretch; gap: 4px; border-radius: var(--r1); }
.bmr:hover { background: var(--surface2); }
.bmgo { flex: 1; min-width: 0; display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; padding: 8px; background: none; border: 0; border-radius: var(--r1); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.bmgo:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.bmt { display: flex; align-items: baseline; gap: 8px; min-width: 0; flex-wrap: wrap; }
.bmt b { font-variant-numeric: tabular-nums; font-weight: 600; }
.bmt .tm { color: var(--muted); font-size: var(--fs-s); }
.bmk { display: flex; align-items: center; color: var(--accent); }
.bmk .ic { width: 14px; height: 14px; }
.bmgo .bmnote { grid-column: 1 / -1; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--text); }
.bmacts { display: flex; align-items: center; gap: 4px; padding-right: 4px; flex: none; }
.bmempty { padding: 18px 8px; color: var(--muted); text-align: center; }
@media (max-width: 560px) {
  .bmr { flex-wrap: wrap; border-bottom: 1px solid var(--line); border-radius: 0; padding-bottom: 4px; }
  .bmacts { width: 100%; justify-content: flex-end; }
  .bmfil select { flex: 1 1 100%; }
}
@media (pointer: coarse) { .bmacts .btn { min-height: 40px; min-width: 40px; } }
