/* The Quip to monday page's own parts (T101): the first-screen picture of one Quip thread (kit/QpMap.astro, ".kqpm"), the
   page's tool (kit/QpTool.astro, ".kqpt") and the small tag pills its tables share (".qptag"). Tokens only; light and dark
   follow the site's. Classes only: no inline style except the entrance delay "--n". */

/* ---------- tags: what happens to a part (load, rebuilt, not listed) ---------- */
.kqpm__tag, .qptag { display: inline-block; padding: 2px 8px; border: 1px solid var(--line-2); font-size: var(--fs-xs); line-height: 1.4; font-weight: 550; white-space: nowrap; }
.kqpm__tag--load, .qptag--load { border-color: var(--accent); background: var(--accent-tint); color: var(--accent-deep); }
.kqpm__tag--rebuilt, .qptag--rebuilt { border-color: var(--warn-ink); background: var(--warn-tint); color: var(--warn-ink); }
.kqpm__tag--unlisted, .qptag--unlisted { border-style: dashed; background: var(--paper); color: var(--muted); }

/* ---------- the first screen: one Quip thread and where its parts land ---------- */
.hero__qp { align-self: center; min-width: 0; }
.kqpm { margin: 0; padding: var(--s-4) var(--s-5); border: 1px solid var(--line); border-top: 3px solid var(--accent); background: var(--paper); box-shadow: var(--shadow-card); }
.kqpm__cap { margin: 0 0 var(--s-2); color: var(--accent-deep); }
.kqpm__thread { margin: 0 0 var(--s-3); padding-bottom: var(--s-3); border-bottom: 1px dashed var(--line-2); }
.kqpm__draw { display: block; width: 100%; height: auto; max-height: 128px; }
.kqpm__a { fill: var(--paper-2); stroke: var(--line-2); }
.kqpm__chip { fill: var(--accent-tint); stroke: var(--accent); }
.kqpm__ln { fill: var(--line-2); }
.kqpm__msg { fill: var(--accent); opacity: 0.7; }
.kqpm__b { fill: var(--ok-tint); stroke: var(--ok); }
.kqpm__l { fill: none; stroke: var(--faint); stroke-width: 1.5; }
.kqpm__t { fill: var(--ink); font-size: 10px; font-weight: 600; }
.kqpm__t2 { fill: var(--ok-ink); font-size: 9px; }
.kqpm__lane { margin: 0 0 var(--s-2); }
.kqpm__head { margin: 0 0 4px; padding-bottom: 3px; border-bottom: 1px solid var(--line-2); color: var(--muted); font-weight: 550; }
.kqpm__lane--menu .kqpm__head { color: var(--ok-ink); border-bottom-color: var(--ok); }
.kqpm__lane--api .kqpm__head { color: var(--accent-deep); border-bottom-color: var(--accent); }
.kqpm__rows { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.kqpm__row { display: grid; grid-template-columns: minmax(0, 1fr) 24px minmax(0, 1.15fr) auto; align-items: center; gap: var(--s-2); padding: 4px 10px; border: 1px solid var(--line-2); border-left-width: 3px; background: var(--paper); font-size: var(--fs-small); line-height: 1.3; }
.kqpm__row--load { border-left-color: var(--accent); }
.kqpm__row--rebuilt { border-left-color: var(--warn-ink); }
.kqpm__row--unlisted { border-left-style: dashed; border-left-color: var(--faint); }
.kqpm__q { font-weight: 550; color: var(--ink); overflow-wrap: anywhere; }
.kqpm__to { color: var(--ink-2); overflow-wrap: anywhere; }
.kqpm__arrow { width: 24px; height: 10px; stroke: var(--faint); }
.kqpm__tag { justify-self: end; text-align: center; }
.kqpm__src { margin: var(--s-2) 0 0; font-size: var(--fs-xs); line-height: 1.4; color: var(--muted); }
@media (prefers-reduced-motion: no-preference) {
  .kqpm__thread { animation: kqpm-fade 0.7s ease-out both; }
  .kqpm__fade { animation: kqpm-fade 0.5s ease-out both; animation-delay: calc(0.25s + var(--n, 0) * 120ms); }
  .kqpm__l { stroke-dasharray: 80; animation: kqpm-draw 0.9s ease-out 0.3s both; }
}
@keyframes kqpm-fade { from { opacity: 0; transform: scale(0.98); } }
@keyframes kqpm-draw { from { stroke-dashoffset: 80; } }
@media (max-width: 1000px) { .hero__qp { width: 100%; max-width: 620px; margin-top: var(--s-6); } }
@media (max-width: 600px) { .hero__qp { margin-top: var(--s-2); } }
@media (max-width: 480px) {
  .kqpm { padding: var(--s-2) var(--s-3); }
  .kqpm__thread { display: none; }
  .kqpm__lane { margin-bottom: var(--s-2); }
  .kqpm__row { grid-template-columns: minmax(0, 1fr) auto; row-gap: 0; padding: 2px 8px; line-height: 1.25; }
  .kqpm__to { grid-column: 1; grid-row: 2; font-size: var(--fs-xs); }
  .kqpm__arrow { display: none; }
  .kqpm__tag { grid-column: 2; grid-row: 1 / span 2; }
  .kqpm__rows { gap: 3px; }
  .kqpm__head { margin-bottom: 2px; }
  .kqpm__src { margin-top: var(--s-2); }
}

/* ---------- the tool: your Quip site in, the monday pieces, the export route and the dates out ---------- */
.kqpt { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: var(--s-6); align-items: start; }
.kqpt__form { display: grid; gap: var(--s-3); margin: 0; position: sticky; top: calc(var(--header-h, 72px) + var(--s-4)); align-self: start; }
.kqpt__group { margin: 0; padding: var(--s-4) var(--s-5); border: 1px solid var(--line); background: var(--paper); min-width: 0; }
.kqpt__legend { padding: 0; color: var(--accent-deep); cursor: pointer; }
.kqpt__group[open] > .kqpt__legend { margin-bottom: var(--s-3); }
.kqpt__ex { margin: 0; color: var(--muted); }
.kqpt__ex[hidden] { display: none; }
.kqpt__fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px var(--s-4); }
.kqpt__plan { display: grid; gap: var(--s-3); }
.kqpt__field { display: grid; grid-row: span 3; grid-template-rows: subgrid; min-width: 0; }
.kqpt__plan .kqpt__field { grid-row: auto; grid-template-rows: none; gap: 4px; }
.kqpt__field .kqpt__hint { margin-bottom: var(--s-3); }
.kqpt__label { font-size: var(--fs-small); font-weight: 550; line-height: 1.3; color: var(--ink); }
.kqpt__hint { display: block; font-size: var(--fs-xs); font-weight: 400; line-height: 1.4; color: var(--muted); }
.kqpt__num, .kqpt__sel, .kqpt__date { width: 100%; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line-2); background: var(--paper); color: var(--ink); font: inherit; font-size: var(--fs-body); }
.kqpt__num:hover, .kqpt__sel:hover, .kqpt__date:hover { border-color: var(--accent); }
.kqpt__num:focus-visible, .kqpt__sel:focus-visible, .kqpt__date:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-color: var(--accent); }
.kqpt__reset { justify-self: start; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 var(--s-2); border: 0; background: none; color: var(--accent-text); cursor: pointer; }
.kqpt__reset:hover { text-decoration: underline; }
.kqpt__result { position: sticky; top: calc(var(--header-h, 72px) + var(--s-4)); align-content: start; display: grid; gap: var(--s-3); padding: var(--s-5); border: 1px solid var(--line); border-top: 3px solid var(--ok); background: var(--paper); min-width: 0; }
.kqpt__kicker { margin: 0; color: var(--ok-ink); }
.kqpt__empty { margin: 0; font-size: var(--fs-small); line-height: 1.5; color: var(--muted); }
.kqpt__out { display: grid; gap: var(--s-3); }
.kqpt__out[hidden], .kqpt__empty[hidden], .kqpt__act[hidden], .kqpt__copy[hidden] { display: none; }
.kqpt.is-js .kqpt__out:not([hidden]) { animation: kqpt-in 300ms var(--ease) both; }
.kqpt__k, .kqpt__stamp { margin: 0; color: var(--muted); }
.kqpt__tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin: 0; padding: 0; list-style: none; }
.kqpt__tile { display: grid; gap: 2px; padding: 8px 10px; border: 1px solid var(--ok); background: var(--ok-tint); }
.kqpt__th { font-size: var(--fs-xs); font-weight: 550; color: var(--ok-ink); }
.kqpt__big { font-size: var(--fs-h4, 1.15rem); line-height: 1.2; color: var(--ink); overflow-wrap: anywhere; }
.kqpt__sm { font-size: var(--fs-xs); color: var(--muted); }
.kqpt__lines { display: grid; gap: var(--s-2); margin: 0; padding: 0; list-style: none; }
.kqpt__line { padding: var(--s-2) var(--s-3); border-left: 3px solid var(--line-2); background: var(--paper-2); font-size: var(--fs-small); line-height: 1.5; color: var(--ink); }
.kqpt__line--trip { border-left-color: var(--warn-ink); }
.kqpt__line--note { border-left-color: var(--ok); }
.kqpt__ls { display: inline; color: var(--link-blue); text-decoration: underline; text-underline-offset: 2px; font-size: var(--fs-xs); }
.kqpt__reads { display: grid; gap: 4px; margin: 0; }
.kqpt__reads > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s-3); align-items: baseline; padding: 6px 10px; border: 1px solid var(--line-2); background: var(--paper); }
.kqpt__reads dt { font-size: var(--fs-small); color: var(--ink-2); }
.kqpt__reads dd { margin: 0; font-weight: 600; color: var(--ink); text-align: right; }
.kqpt__reads .kqpt__plan-say { grid-column: 1 / -1; font-weight: 400; font-size: var(--fs-small); text-align: left; }
.kqpt__reads > div:last-child { grid-template-columns: minmax(0, 1fr); }
.kqpt__fine { margin: 0; font-size: var(--fs-xs); line-height: 1.5; color: var(--muted); }
.kqpt__act { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.kqpt__sources { margin-top: var(--s-6); }
.kqpt__sh { margin: 0 0 var(--s-3); padding: var(--s-2) 0; font-size: var(--fs-body); font-weight: 550; color: var(--accent-text); cursor: pointer; }
.kqpt__table { width: 100%; border-collapse: collapse; font-size: var(--fs-small); line-height: 1.45; }
.kqpt__table th, .kqpt__table td { padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.kqpt__table thead th { font-size: var(--fs-xs); font-weight: 550; color: var(--muted); }
.kqpt__table td a { color: var(--link-blue); text-decoration: underline; text-underline-offset: 2px; }
.kqpt__src { margin: var(--s-2) 0 0; font-size: var(--fs-xs); color: var(--muted); }
@keyframes kqpt-in { from { opacity: 0; transform: translateY(6px); } }
@media (max-width: 900px) { .kqpt { grid-template-columns: minmax(0, 1fr); } .kqpt__result, .kqpt__form { position: static; } }
@media (max-width: 560px) {
  .kqpt__group { padding: var(--s-3) var(--s-4); }
  .kqpt__tiles { grid-template-columns: minmax(0, 1fr); }
  .kqpt__act .btn { width: 100%; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  .kqpt.is-js .kqpt__out:not([hidden]) { animation: none; }
}
