/* «المهام والتكليفات»: the home screenshot became six focused cards of Tind's own
   tiles (today's app and open PRs). The copy sits beside them; the card under the
   pointer (or the one the cycle reached) stays sharp and the rest dim. Flat cards,
   one frame each (ui-rules §4). Entrances run only under .js-motion, so without JS,
   with reduced motion or with motion paused everything is simply visible. */
@media (min-width: 1101px) {
  .feature-row.work-row {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
    align-items: stretch;
  }
  .feature-row.work-row .feature-copy {
    display: flex;
    flex-direction: column;
    padding-block-start: 12px;
  }
}
/* The index: beside the cards, the copy column names the six and follows the focus,
   so the column is as tall as the grid. Below 1101px the row stacks and each card
   carries its own caption instead. */
.wf-index {
  display: none;
}
@media (min-width: 1101px) {
  .work-row .wf-cap {
    display: none;
  }
  .work-row .wf-card {
    grid-template-rows: 1fr;
  }
  .work-row .wf-ui {
    min-height: 168px;
  }
  .wf-index {
    flex: 1;
    display: grid;
    grid-auto-rows: 1fr;
    margin: 32px 0 0;
    padding: 0;
    list-style: none;
    border-block-start: 1px solid var(--line);
  }
  .wf-index li {
    display: grid;
  }
  .wf-index li + li {
    border-block-start: 1px solid var(--line);
  }
  .wf-index button {
    display: grid;
    grid-template-columns: 20px 1fr;
    column-gap: 14px;
    align-content: center;
    align-items: center;
    padding: 12px 0;
    border: 0;
    background: none;
    font: inherit;
    text-align: start;
    color: var(--ink);
    cursor: pointer;
    transition: color var(--duration-base) var(--ease);
  }
  .wf-index svg {
    width: 20px;
    height: 20px;
    color: var(--accent);
  }
  .wf-index b {
    font-weight: 500;
    font-size: 16px;
  }
  .wf-index .d {
    grid-column: 2;
    display: grid;
    grid-template-rows: 1fr;
    color: var(--muted);
    font-size: 13px;
    transition:
      grid-template-rows var(--duration-reveal) var(--ease),
      opacity var(--duration-base) var(--ease);
  }
  .wf-index .d span {
    overflow: hidden;
  }
  /* Once the script follows the focus, only the lit card's line stays open. */
  .wf-index.live li:not(.on) button {
    color: var(--muted);
  }
  .wf-index.live li:not(.on) svg {
    color: inherit;
  }
  .wf-index.live li:not(.on) .d {
    grid-template-rows: 0fr;
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .wf-index .d,
  .wf-index button {
    transition: none;
  }
}
.work-focus {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  min-width: 0;
}
.wf-card {
  position: relative;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  min-width: 0;
  cursor: default;
  transition:
    opacity var(--duration-reveal) var(--ease),
    transform var(--duration-reveal) var(--ease),
    scale var(--duration-reveal) var(--ease),
    border-color var(--duration-base) var(--ease);
}
.work-focus.has-focus .wf-card:not(.focused) {
  opacity: 0.72;
  scale: 0.985;
}
.work-focus .wf-card.focused {
  border-color: var(--accent);
}
.js-motion .work-focus .wf-card.reveal:not(.visible):not(:focus-within) {
  opacity: 0;
}
.wf-ui {
  position: relative;
  min-height: 130px;
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 14px;
  border-radius: 14px;
  background: var(--bg);
  overflow: clip;
  font-size: 13px;
  line-height: 1.6;
}
.wf-cap {
  display: grid;
  gap: 2px;
}
.wf-cap b {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  font-size: 15px;
}
.wf-cap b svg {
  width: 18px;
  height: 18px;
  flex: none;
  color: var(--accent);
}
.wf-cap > span {
  color: var(--muted);
  font-size: 13px;
}
.wf-ui svg {
  flex: none;
}
.wf-ui .ui-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12.5px;
  color: var(--muted);
}
.wf-ui .ui-head b {
  color: var(--ink);
  font-weight: 500;
  font-size: 13.5px;
}
.wf-ui .pill {
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11.5px;
  background: var(--accent-soft);
  color: var(--accent);
  white-space: nowrap;
}
.wf-ui .pill.warn {
  background: var(--warning-bg);
  color: var(--warning);
}
.wf-ui .pill.late {
  background: var(--danger-bg);
  color: var(--danger);
}
.wf-ui .rows {
  display: grid;
  gap: 6px;
}
.wf-ui .t {
  color: var(--muted);
  font-size: 12px;
}
.wf-ui .bar {
  position: relative;
  height: 4px;
  border-radius: 2px;
  background: var(--surface-2);
  overflow: hidden;
}
.wf-ui .bar i {
  position: absolute;
  inset: 0 0 0 auto;
  width: var(--w);
  background: var(--accent);
  border-radius: 2px;
  transform-origin: right;
}
.wf-ui .bar i.g { background: var(--success); }
.wf-ui .bar i.a { background: var(--warning); }
.wf-ui .bar i.r { background: var(--danger); }
/* جلسات الأسبوع */
.wf-ui .cols {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  align-items: end;
  height: 92px;
  margin: 0;
  padding: 0;
  list-style: none;
  container-type: inline-size;
}
.wf-ui .cols li {
  display: grid;
  gap: 4px;
  align-content: end;
  height: 100%;
}
.wf-ui .cols .c {
  display: grid;
  align-content: end;
  height: 100%;
}
.wf-ui .cols .c i {
  display: block;
  height: var(--h);
  border-radius: 4px 4px 2px 2px;
  background: var(--accent);
  transform-origin: bottom;
}
.wf-ui .cols li.today .c i { background: var(--success); }
.wf-ui .cols small {
  text-align: center;
  color: var(--muted);
  /* full day names at every card width: the size follows the chart's own width */
  font-size: 11px;
  font-size: clamp(8px, 5.2cqi, 11px);
  line-height: 1.2;
  white-space: nowrap;
}
.wf-ui .cols li.today small {
  color: var(--ink);
  font-weight: 500;
}
/* مهام الملف */
.wf-ui .check {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.wf-ui .check .box {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1.5px solid color-mix(in srgb, var(--line) 60%, var(--muted));
  display: grid;
  place-items: center;
}
.wf-ui .check .box svg {
  width: 12px;
  height: 12px;
  color: var(--on-action);
  opacity: 0;
}
/* الوكالات */
.wf-ui .poa {
  display: grid;
  gap: 4px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.wf-ui .poa .top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.wf-ui .poa .top small {
  color: var(--muted);
  font-size: 12px;
}
/* التواصل */
.wf-ui .tl {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}
.wf-ui .tl li {
  position: relative;
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  padding-block: 6px;
}
.wf-ui .tl .ic {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
}
.wf-ui .tl .ic svg {
  width: 12px;
  height: 12px;
}
.wf-ui .tl li::before {
  content: "";
  position: absolute;
  inset-inline-start: 10.5px;
  top: 30px;
  bottom: -6px;
  width: 1px;
  background: var(--line);
}
.wf-ui .tl li:last-child::before {
  display: none;
}
.wf-ui .tl small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
/* رأس الملف */
.wf-ui .hdr {
  display: grid;
  gap: 10px;
}
.wf-ui .hdr .title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  font-weight: 500;
  font-size: 14px;
}
.wf-ui .hdr .title small {
  color: var(--muted);
  font-weight: 400;
  font-size: 12px;
}
.wf-ui .hdr .next {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.wf-ui .hdr .next div {
  min-width: 0;
  display: grid;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  font-size: 12.5px;
}
.wf-ui .hdr .next small {
  color: var(--muted);
  font-size: 11.5px;
}
.wf-ui .hdr .next b {
  font-weight: 500;
  font-size: 15px;
}
/* طباعة وتصدير */
.wf-ui .exp {
  display: grid;
  gap: 10px;
}
.wf-ui .exp .btns {
  display: flex;
  gap: 8px;
}
.wf-ui .exp .btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  font-size: 13px;
}
.wf-ui .exp .btn svg {
  width: 14px;
  height: 14px;
  color: var(--accent);
}
.wf-ui .exp .btn.on {
  border-color: var(--accent);
  color: var(--accent);
}
.wf-ui .exp .sheet {
  display: grid;
  gap: 4px;
}
.wf-ui .exp .sheet i {
  display: block;
  height: 8px;
  border-radius: 3px;
  background: var(--surface-2);
  transform-origin: right;
}
.wf-ui .exp .sheet i:nth-child(1) { width: 90%; background: var(--accent-soft); }
.wf-ui .exp .sheet i:nth-child(2) { width: 100%; }
.wf-ui .exp .sheet i:nth-child(3) { width: 96%; }
.wf-ui .exp .sheet i:nth-child(4) { width: 100%; }
.wf-ui .exp .sheet i:nth-child(5) { width: 70%; }
.wf-ui .exp .done {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--success);
  font-size: 12.5px;
}
.wf-ui .exp .done svg {
  width: 14px;
  height: 14px;
}

/* Entrances: rows settle in, bars grow, the first task ticks itself. Only with
   JS and motion (.js-motion), and only once the card is in view (.in). */
@media (prefers-reduced-motion: no-preference) {
  .js-motion .wf-ui .poa,
  .js-motion .wf-ui .check,
  .js-motion .wf-ui .tl li,
  .js-motion .wf-ui .hdr .next div {
    opacity: 0;
    translate: 0 6px;
  }
  .js-motion .wf-ui .bar i,
  .js-motion .wf-ui .exp .sheet i {
    scale: 0 1;
  }
  .js-motion .wf-ui .cols .c i {
    scale: 1 0;
  }
  .js-motion .wf-ui .exp .done {
    opacity: 0;
  }
  .js-motion .wf-card.in .poa,
  .js-motion .wf-card.in .check,
  .js-motion .wf-card.in .tl li,
  .js-motion .wf-card.in .hdr .next div {
    animation: wf-settle var(--duration-base) var(--ease) forwards;
    animation-delay: calc(var(--k, 0) * 60ms + 120ms);
  }
  .js-motion .wf-card.in .bar i {
    animation: wf-grow-x var(--duration-reveal) var(--ease) forwards;
    animation-delay: calc(var(--k, 0) * 60ms + 200ms);
  }
  .js-motion .wf-card.in .cols .c i {
    animation: wf-grow-y var(--duration-reveal) var(--ease) forwards;
    animation-delay: calc(var(--k, 0) * 50ms + 150ms);
  }
  .js-motion .wf-card.in .exp .sheet i {
    animation: wf-grow-x var(--duration-reveal) var(--ease) forwards;
    animation-delay: calc(var(--k, 0) * 60ms + 600ms);
  }
  .js-motion .wf-card.in .exp .done {
    animation: wf-fade var(--duration-base) var(--ease) forwards;
    animation-delay: 1300ms;
  }
  .js-motion .wf-card.in .check.tick .box {
    animation: wf-tick var(--duration-base) var(--ease) forwards;
    animation-delay: 1400ms;
  }
  .js-motion .wf-card.in .check.tick .box svg {
    animation: wf-fade var(--duration-fast) var(--ease) forwards;
    animation-delay: 1500ms;
  }
  .js-motion .wf-card.in .check.tick .txt {
    animation: wf-strike var(--duration-base) var(--ease) forwards;
    animation-delay: 1500ms;
  }
}
/* When the focus reaches a card again, only its bars and columns regrow; the rows
   and text stay put, so the card never blanks. The -b twins restart the animation. */
@media (prefers-reduced-motion: no-preference) {
  .js-motion .wf-card.in.again .bar i,
  .js-motion .wf-card.in.again .exp .sheet i {
    animation-name: wf-grow-x-b;
  }
  .js-motion .wf-card.in.again .cols .c i {
    animation-name: wf-grow-y-b;
  }
}
@keyframes wf-settle { to { opacity: 1; translate: 0 0; } }
@keyframes wf-grow-x { to { scale: 1 1; } }
@keyframes wf-grow-x-b { to { scale: 1 1; } }
@keyframes wf-grow-y { to { scale: 1 1; } }
@keyframes wf-grow-y-b { to { scale: 1 1; } }
@keyframes wf-fade { to { opacity: 1; } }
@keyframes wf-tick { to { background: var(--success); border-color: var(--success); } }
@keyframes wf-strike { to { color: var(--muted); } }
:root[data-motion="paused"] .wf-ui .poa,
:root[data-motion="paused"] .wf-ui .check,
:root[data-motion="paused"] .wf-ui .tl li,
:root[data-motion="paused"] .wf-ui .hdr .next div,
:root[data-motion="paused"] .wf-ui .bar i,
:root[data-motion="paused"] .wf-ui .exp .sheet i,
:root[data-motion="paused"] .wf-ui .cols .c i,
:root[data-motion="paused"] .wf-ui .exp .done {
  opacity: 1 !important;
  translate: none !important;
  scale: none !important;
}
:root[data-motion="paused"] .work-focus .wf-card {
  opacity: 1 !important;
  scale: none !important;
}
@media (max-width: 560px) {
  .work-focus {
    grid-template-columns: 1fr;
  }
}
