/* =========================================================
   Action Items (Projects hub, version 39)
   Loaded after theme.css on the tool pages. Same frame as Shift Tasks (.tk): the list on the left, the recap on the
   right (who has what, and the text to copy). Projects purple takes the place of safety yellow inside this tool.
   On phones the List and Recap tabs switch panes.
   ========================================================= */
@media screen {

#panel-items {
  --mascot: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 50 58'%3E%3Cellipse cx='24' cy='54' rx='18' ry='3' fill='%231B2125' opacity='.15'/%3E%3Cg transform='translate(1 4)'%3E%3Crect x='9' y='9' width='30' height='37' rx='4' fill='%23B89CFF' stroke='%231B2125' stroke-width='2.4'/%3E%3Crect x='13' y='15' width='22' height='28' rx='2' fill='%23fff' stroke='%231B2125' stroke-width='1.8'/%3E%3Crect x='18' y='5' width='12' height='8' rx='2.5' fill='%231B2125'/%3E%3Ccircle cx='20' cy='24' r='2.1' fill='%231B2125'/%3E%3Ccircle cx='28' cy='24' r='2.1' fill='%231B2125'/%3E%3Cpath d='M21.5 29q2.5 2.6 5 0' fill='none' stroke='%231B2125' stroke-width='2' stroke-linecap='round'/%3E%3Cellipse cx='16.6' cy='29' rx='2.2' ry='1.4' fill='%23F4B6B0'/%3E%3Cellipse cx='31.4' cy='29' rx='2.2' ry='1.4' fill='%23F4B6B0'/%3E%3C/g%3E%3C/svg%3E"); --mascot-w: 54px; --mascot-h: 62px; --note: "who does what by when";
  /* the tool's accent: Projects purple (ink text on it is 7:1) */
  --yel: #b89cff; --yel-hover: #c9b3ff; --yel-soft: #eee8ff; --yel-line: #d6c8ff; --yel-ink: #4a2f86; --on-yel: #1b2125; --hl: #b89cff;
}
:root:lang(es) #panel-items { --note: "quién hace qué y para cuándo"; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-tc-theme="light"]) #panel-items { --yel-soft: #251d3a; --yel-line: #3d2f63; --yel-ink: #d0c0ff; --hl: #4b3684; }
}
:root[data-theme="dark"]:not([data-tc-theme="light"]) #panel-items, :root[data-tc-theme="dark"] #panel-items { --yel-soft: #251d3a; --yel-line: #3d2f63; --yel-ink: #d0c0ff; --hl: #4b3684; }

/* ---------- the frame: the list, and the recap beside it ---------- */
.ai .tk-main { grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr); }
.ai-side { background: var(--canvas); }
@media (min-width: 921px) { .ai-side { border-left: 2px solid var(--edge); border-radius: 0 16px 16px 0; } }
.ai .tk-try, .ai .notice, .ai .warn { margin: 6px 0 0; }
.ai-print-btn svg { width: 18px; height: 18px; flex: none; }

/* ---------- add an item: what, who, when ---------- */
.ai-add { display: grid; grid-template-columns: minmax(0, 1fr) minmax(120px, 170px) minmax(140px, 170px) auto; align-items: end; gap: 10px;
  margin: 12px 0 14px; }
.ai-add .tk-l em { font-style: normal; font-weight: 400; color: var(--soft); }
.ai-add-b { min-height: 44px !important; }
.ai-add-err { grid-column: 1 / -1; }
@media (max-width: 1180px) { .ai-add { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; } .ai-f-what { grid-column: 1 / -1; } }

/* ---------- people: Everyone, then each name ---------- */
.ai-chips { --fade-size: 2rem; display: flex; gap: 8px; margin: 0 0 6px; padding: 2px 2px 6px; overflow-x: auto; scrollbar-width: none; scroll-padding-inline: var(--fade-size); }
.ai-chips::-webkit-scrollbar { display: none; }
.ai-chip { flex: none; display: inline-flex; align-items: center; gap: 7px; min-height: 42px; padding: 0 14px; border: 2px solid var(--edge); border-radius: 999px;
  background: var(--surface); color: var(--ink); font: 600 14px/1 var(--f-ui); white-space: nowrap; cursor: pointer; }
.ai-chip:hover { background: var(--yel-soft); }
.ai-chip-n { color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
/* the one showing: hub fill and an underline (a border, so it shows in forced colors too) */
.ai-chip[aria-pressed="true"] { position: relative; background: var(--yel); color: #1b2125; }
.ai-chip[aria-pressed="true"] .ai-chip-n { color: #1b2125; }
.ai-chip[aria-pressed="true"]::after { content: ""; position: absolute; inset: auto 14px 5px; border-bottom: 2px solid currentColor; }

/* ---------- the groups and the items ---------- */
.ai-grp { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.ai-grp:first-child { border-top: 0; padding-top: 4px; }
.ai-grp h3 { display: inline-flex; align-items: center; gap: 9px; }
.ai-dot { width: 12px; height: 12px; border: 2px solid var(--edge); border-radius: 3px; background: var(--surface); }
.ai-grp[data-g="over"] .ai-dot { background: var(--edge); }
.ai-grp[data-g="week"] .ai-dot { background: var(--yel); }
.ai-grp[data-g="later"] .ai-dot { background: var(--yel-soft); }
.ai-grp[data-g="done"] .ai-dot { background: var(--line-2); }
.ai-item .tk-sub { gap: 4px 12px; margin-top: 5px; }
.ai-who { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); font-weight: 600; }
/* the initials keep their soft color in both themes, so the letter is ink */
.ai-av { flex: none; display: grid; place-items: center; width: 22px; height: 22px; border: 2px solid #1b2125; border-radius: 50%; background: var(--av, #e3e7e5);
  color: #1b2125; font: 800 11px/1 var(--f-ui); }
.ai-due { color: var(--muted); font-weight: 600; }
.ai-due.soon { color: var(--ink); font-weight: 700; }
.ai-due.over { padding: 2px 8px; border-radius: 6px; background: #1b2125; color: #fff; font-weight: 700; box-shadow: 0 0 0 1px var(--edge); }
.ai-item.done .ai-due, .ai-item.done .ai-who { color: var(--soft); }
.ai-empty { margin: 14px 0 6px; padding: 16px 14px; border: 2px dashed var(--line-2); border-radius: 12px; color: var(--muted); font-size: 14.5px; text-align: center; }
.tk .ai-done-btn { min-height: 44px; margin-top: 8px; font-size: 14.5px; }

/* the edit row under an item */
.ai .ai-edit { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; padding: 8px 0 12px; }
.ai-e-what, .ai-e-acts { grid-column: 1 / -1; }
.ai-edit .tk-l em { font-style: normal; font-weight: 400; color: var(--soft); }
.ai-e-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.tk .ai-del { margin-left: auto; min-height: 40px; }

/* ---------- the recap side ---------- */
.ai-box { margin-top: 14px; padding: 12px 14px 14px; border: 2px solid var(--edge); border-radius: 12px; background: var(--surface); display: grid; gap: 8px; }
.ai-box .tk-sec-h h3 { font-size: 21px; }
.ai-owners { display: grid; }
.ai-owner { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 4px 8px; border: 0; border-bottom: 1px solid var(--line);
  border-radius: 0; background: none; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.ai-owner:last-child { border-bottom: 0; }
.ai-owner:hover { background: var(--surface-2); }
.ai-owner[aria-pressed="true"] { background: var(--yel-soft); box-shadow: inset 4px 0 0 var(--yel); }
.ai-owner-n { flex: 1; min-width: 0; font-weight: 700; overflow-wrap: anywhere; }
.ai-owner-c { flex: none; font-size: 13px; color: var(--muted); }
.ai-owner-c.over { color: var(--ink); font-weight: 700; }
.tk .ai-recap { min-height: 200px; font-size: 13px; }
.ai-copyrow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.ai-copy-msg { flex: 1 1 160px; font-weight: 600; color: var(--ink); }

/* ---------- phones: one pane at a time ---------- */
@media (max-width: 920px) {
  .ai .tk-main { display: block; }
  .ai[data-pane="list"] .ai-side, .ai[data-pane="recap"] .ai-list { display: none; }
  .ai-side { background: var(--surface); min-height: 60vh; padding-top: 4px; }
  .ai-side > .tk-pane-h { min-height: 0; }   /* the Recap tab names this pane; its heading stays for screen readers, with no empty row */
  .ai-add { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); margin-top: 6px; }
  .ai-f-what, .ai-add-b { grid-column: 1 / -1; }
  .ai-chips { margin-inline: calc(-1 * var(--gutter)); padding-inline: var(--gutter); }
  .ai-box { margin-top: 12px; }
}
@media (max-width: 420px) { .ai .ai-edit { grid-template-columns: minmax(0, 1fr); } }

} /* end screen */

/* the people chips fade out at an edge with more past it (scroll-driven, where the browser has it; the custom
   properties are registered in desk-board.css) */
@supports (animation-timeline: scroll()) {
  .ai-chips { mask: linear-gradient(black, black) no-clip subtract,
      linear-gradient(to right, black, transparent) 0 0 / var(--fade-start) 100% no-repeat no-clip,
      linear-gradient(to right, transparent, black) 100% 0 / var(--fade-end) 100% no-repeat no-clip;
    animation: db-fade-start linear both, db-fade-end linear both; animation-timeline: scroll(self inline);
    animation-range: 0 var(--fade-size), calc(100% - var(--fade-size)) 100%; }
}

/* ---------- the printed list (screen preview and paper) ---------- */
.st-paper .ai-sheet { width: 816px; padding: 48px; box-shadow: 0 1px 2px rgba(17, 22, 24, .14), 0 10px 26px rgba(17, 22, 24, .14); }
.ai-s-meta { margin-bottom: 18px; }
.ai-s-table th.ai-s-ck, .ai-s-table td:first-child { width: 30px; }
.ai-s-table .ai-s-who { width: 22%; }
.ai-s-table .ai-s-due { width: 22%; }
.ai-s-table td { height: 30px; }
.ai-s-table td + td { border-left: 1px solid var(--pt-rule); }
.ai-s-table td .cs-box { margin: 0 0 1px; }
.ai-s-late { font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--pt-head); }

/* Ctrl+P on Action Items: the list without the buttons */
@media print {
  .ai-add, .ai-chips, .ai-done-btn, .ai-print-btn, .ai-side, .ai-item .tk-more, .ai-edit { display: none !important; }
}
