* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  background: var(--soft);
  color: var(--fg);
  font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  display: grid;
  grid-template-columns: 220px minmax(0, 1040px);
  gap: 28px;
  justify-content: center;
  padding: 28px 20px 80px;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

/* The left column: filters and sites. */
.side { position: sticky; top: 28px; align-self: start; display: grid; gap: 4px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 18px; margin-bottom: 14px; }
.brand img { width: 26px; height: 26px; }
.filters { display: grid; gap: 2px; }
.fb { display: flex; justify-content: space-between; gap: 10px; padding: 7px 12px; border-radius: 8px; color: var(--muted); text-align: left; }
.fb:hover { background: var(--card); color: var(--fg); }
.fb[aria-pressed="true"] { background: var(--card); color: var(--fg); font-weight: 600; box-shadow: 0 1px 3px var(--shadow); }
.fl { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fc { font-variant-numeric: tabular-nums; }
.fb.due .fc { color: var(--due); font-weight: 600; }
.sec { margin: 18px 12px 6px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.06em; color: var(--muted); text-transform: uppercase; }

/* The top row and the bar for the ticked rows. */
.main { display: grid; gap: 14px; align-content: start; min-width: 0; }
.top { display: flex; gap: 10px; }
.search, .field { font: inherit; color: var(--fg); background: var(--card); border: 1px solid var(--card-line); border-radius: 9px; }
.search { flex: 1; min-width: 0; padding: 9px 14px; }
.field { padding: 6px 9px; }
.search:focus, .field:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.btn { border: 1px solid var(--card-line); background: var(--card); border-radius: 9px; padding: 8px 14px; font-weight: 600; white-space: nowrap; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; }
.btn.small { padding: 5px 10px; }

.bar { position: sticky; top: 10px; z-index: 6; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: #0f172a; color: #fff; border: 1px solid #334155; border-radius: 12px; padding: 10px 14px; box-shadow: 0 6px 18px var(--shadow); }
.bbtn { border: 1px solid #475569; border-radius: 8px; padding: 5px 12px; font-weight: 600; }
.bbtn:hover { border-color: #5eead4; }
#bar-move::after, #bar-repeat::after { content: " ▾"; font-size: 11px; }
#bar-repeat::before { content: "↻ "; }
#bar-delete.armed { background: var(--due); border-color: var(--due); }
.clear { margin-left: auto; color: #cbd5e1; font-size: 13px; }
.clear:hover { color: #fff; }

/* Menus: Move to and Repeat. */
.pop { position: relative; }
.menu { position: absolute; top: calc(100% + 6px); left: 0; z-index: 10; min-width: 250px; border: 1px solid var(--key-line); border-radius: 10px; overflow: hidden; background: var(--card); color: var(--fg); box-shadow: 0 8px 24px var(--shadow); text-align: left; }
.when .menu { left: auto; right: 0; }
.menu > button { display: flex; width: 100%; justify-content: space-between; gap: 12px; padding: 8px 12px; border-top: 1px solid var(--row-line); font-weight: 400; }
.menu > button:first-child { border-top: 0; }
.menu > button:hover, .menu > button:focus-visible { background: var(--accent-soft); outline: 0; }
.menu .mt { color: var(--muted); white-space: nowrap; }
.pick { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 10px 12px; border-top: 1px solid var(--row-line); background: var(--soft); }
.pick .mh { width: 100%; font-size: 12px; color: var(--muted); }

/* The list, grouped by day. */
.list { background: var(--card); border: 1px solid var(--soft-line); border-radius: 14px; padding: 6px 20px 14px; }
.grp h3 { margin: 16px 0 4px; font-size: 14px; font-weight: 600; color: var(--muted); }
.grp h3.due { color: var(--due); }
.rw { border-top: 1px solid var(--row-line); }
.grp h3 + .rw { border-top: 0; }
.row { display: flex; align-items: center; gap: 12px; padding: 10px 8px; margin: 0 -8px; border-radius: 8px; cursor: pointer; }
.row:hover { background: var(--soft); }
.row.on { background: var(--accent-soft); }
.tick { width: 17px; height: 17px; margin: 0; flex: none; accent-color: var(--accent-strong); cursor: pointer; }
.fav { width: 22px; height: 22px; border-radius: 6px; flex: none; display: grid; place-items: center; background: var(--accent-strong); color: #fff; font-size: 12px; font-weight: 700; overflow: hidden; }
.fav:has(img) { background: none; }
.fav img { width: 22px; height: 22px; }
.body { flex: 1; min-width: 0; }
.pt { display: block; max-width: 100%; font-weight: 600; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt:hover { text-decoration: underline; }
.ps { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ps.nt { color: var(--fg); opacity: 0.85; }
.lo { font-size: 12px; color: var(--due); }

.wb { display: grid; justify-items: end; padding: 3px 6px; border-radius: 6px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.wb:hover { background: var(--accent-soft); }
.wm { font-weight: 500; }
.wb.due .wm { color: var(--due); font-weight: 600; }
.ws { font-size: 12.5px; color: var(--muted); }
.ws.rp { color: var(--accent-text); }

.thumb { width: 96px; height: 60px; border-radius: 6px; flex: none; border: 1px solid var(--card-line); background: var(--soft) center / cover no-repeat; }
button.thumb:hover { outline: 2px solid var(--accent); outline-offset: 1px; }
.thumb.none { border-color: transparent; background: none; }
.thumb.away { border-style: dashed; border-color: var(--muted); }

.acts { display: flex; align-items: center; gap: 4px; flex: none; }
.ab { font-size: 12.5px; color: var(--accent-text); font-weight: 600; padding: 4px 7px; border-radius: 6px; opacity: 0; }
.row:hover .ab, .row:focus-within .ab, .ab.sn { opacity: 1; }
.ab:hover { background: var(--accent-soft); }
.x { color: var(--muted); font-size: 18px; width: 28px; height: 28px; border-radius: 7px; }
.x:hover { color: var(--due); background: var(--soft); }
.x.armed { background: var(--due); color: #fff; border-radius: 50%; font-size: 13px; font-weight: 700; }

.edit { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 4px 0 12px 61px; }
.edit .field[type="text"] { flex: 1 1 260px; }
.chk { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }

.empty { color: var(--muted); padding: 26px 4px 14px; text-align: center; }

.undo { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 12; display: flex; align-items: center; gap: 14px; background: #0f172a; color: #fff; border-radius: 10px; padding: 10px 16px; box-shadow: 0 8px 24px var(--shadow); max-width: calc(100% - 40px); }
#undo-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#undo-btn { color: #5eead4; font-weight: 700; }

/* A narrow window: the filters go above the list, in a row that scrolls sideways. */
@media (max-width: 820px) {
  body { grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 16px 12px 80px; }
  .side { position: static; }
  .filters { display: flex; overflow-x: auto; gap: 4px; }
  .fb { flex: none; }
  .sec { margin: 8px 12px 2px; }
  .thumb { width: 64px; height: 40px; }
  .thumb.none { display: none; }
  .list { padding: 4px 12px 10px; }
  .edit { padding-left: 0; }
}
