/* Apps (BB-52): the catalogue, a page of an app with its table, «Збери свою». The kit's own shapes and tokens: paper,
   ink, hairlines; the colour of the signal only where something was found or is about to come. */

/* ── the catalogue ── */
.app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.app-card { text-align: left; display: flex; flex-direction: column; gap: 12px; padding: 16px 18px; }
.app-card.on { box-shadow: inset 0 0 0 1px var(--ink); border-color: var(--ink); }
.app-card .app-n { font-size: 14.5px; font-weight: 600; }
.app-card.wish { background: var(--bg-muted); border-style: dashed; }
.app-card.wish .bul { margin: 0; color: var(--fg-muted); }
.app-card.wish .card-foot { margin-top: auto; }
/* what on the project's own site makes a wish worth making (BB-87): a quiet line, no colour of its own */
.app-card.wish .app-why { display: flex; align-items: flex-start; gap: 6px; margin: 0; }
.app-card.wish .app-why > svg.ic { width: 14px; height: 14px; margin-top: 1px; color: var(--fg-faint); }
.app-line { display: flex; align-items: flex-start; gap: 10px; padding: 9px 12px; border-radius: var(--r-md); background: var(--bg-muted); }
.app-line .logo, .app-line .tile { margin-top: 1px; }
.btn > .logo.xs { margin-right: -1px; }

/* ── the form of a search ── */
.pick-row { display: flex; flex-wrap: wrap; gap: 6px; }
.pick { height: 28px; padding: 0 11px; border-radius: var(--pill); font-size: 12.5px; font-weight: 500; color: var(--fg-muted); box-shadow: inset 0 0 0 1px var(--border); background: var(--paper); transition: background var(--fast), color var(--fast), box-shadow var(--fast); }
.pick:hover { box-shadow: inset 0 0 0 1px var(--border-strong); color: var(--fg); }
.pick[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); box-shadow: none; font-weight: 600; }
.app-count { font-size: 13px; color: var(--fg-muted); min-height: 20px; }
.app-count b { font-size: 15px; color: var(--fg); font-variant-numeric: tabular-nums; }

/* ── a field fed by a list of the app: chips, a line to type in, the list's answers under it (BB-64) ── */
.sg { position: relative; }
.sg-box { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; min-height: 38px; padding: 5px 8px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--paper); cursor: text; transition: border-color var(--fast), box-shadow var(--fast); }
.sg-box:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink) 8%, transparent); }
.sg.bad .sg-box { border-color: var(--error); box-shadow: 0 0 0 3px color-mix(in srgb, var(--error) 10%, transparent); }
.sg-chips { display: contents; }
.sg-in { flex: 1; min-width: 120px; border: 0; outline: 0; background: transparent; font: inherit; font-size: 13.5px; line-height: 20px; padding: 3px; color: var(--fg); }
.sg-in::placeholder { color: var(--fg-subtle); }
.sg-chip { display: inline-flex; align-items: center; gap: 3px; height: 26px; padding: 0 4px 0 10px; border-radius: var(--pill); background: var(--bg-subtle); font-size: 12.5px; font-weight: 500; max-width: 100%; min-width: 0; }
.sg-chip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sg-chip button { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; color: var(--fg-subtle); flex: none; }
.sg-chip button:hover { background: var(--border); color: var(--fg); }
.sg-chip button svg { width: 10px; height: 10px; stroke-width: 2.5; }
.sg-list { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); max-height: 252px; overflow: auto; background: var(--paper); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); padding: 5px; }
.sg-opt { display: block; width: 100%; text-align: left; padding: 7px 9px; border-radius: var(--r-sm); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sg-opt:hover, .sg-opt.on { background: var(--bg-subtle); }
.sg-none { padding: 7px 9px; font-size: 12.5px; color: var(--fg-subtle); }
/* «опиши словами»: one line above the fields, the product's model fills them */
.app-words-box { padding-bottom: 14px; margin-bottom: 2px; border-bottom: 1px solid var(--border); }
.app-words { display: flex; gap: 8px; align-items: center; }
.app-said { font-size: 12.5px; line-height: 1.5; color: var(--fg-muted); margin-top: 8px; }
@media (max-width: 560px) { .app-words { flex-wrap: wrap; } .app-words > .grow { flex-basis: 100%; } }

/* ── the table ── */
/* a table wants the width of the window, not of a page of text */
.page > .wrap.app-wide { max-width: 1680px; }
.tb-strip { display: flex; gap: 6px; margin-bottom: 14px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.tb-tab { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px; border-radius: var(--pill); font-size: 12.5px; color: var(--fg-muted); box-shadow: inset 0 0 0 1px var(--border); background: var(--paper); white-space: nowrap; flex: none; max-width: 300px; }
.tb-tab .t { overflow: hidden; text-overflow: ellipsis; }
.tb-tab .n { font-size: 11px; font-weight: 600; color: var(--fg-subtle); font-variant-numeric: tabular-nums; }
.tb-tab:hover { color: var(--fg); box-shadow: inset 0 0 0 1px var(--border-strong); }
.tb-tab.on { background: var(--ink); color: var(--on-ink); box-shadow: none; font-weight: 600; }
.tb-tab.on .n { color: color-mix(in srgb, var(--on-ink) 65%, transparent); }
.tb-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; min-height: 32px; }
/* the name and the numbers keep a line of their own when the buttons leave them no room (a phone, a narrow window) */
.tb-bar > .grow { flex: 1 1 340px; }
.tb-bar .tb-name { font-size: 14.5px; font-weight: 600; max-width: min(100%, 460px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-tbl th.ck, .app-tbl td.ck { width: 34px; padding-right: 0; }
.app-tbl input[type="checkbox"] { accent-color: var(--ink); width: 14px; height: 14px; display: block; }
/* the name keeps its room: in a narrow window the columns scroll sideways, the name is never squeezed to nothing */
.app-tbl .who { min-width: 230px; }
.app-tbl .who-n b { max-width: 190px; }
.app-tbl tr.picked { background: color-mix(in srgb, var(--ink) 4%, var(--paper)); }
.app-tbl .who-n .tb-li { color: var(--fg-faint); display: inline-grid; flex: none; }
.app-tbl .who-n .tb-li:hover { color: var(--fg); }
.app-tbl .who-n .tb-li svg { width: 13px; height: 13px; }
.app-tbl .in-ppl { width: 16px; height: 16px; border-radius: 50%; display: inline-grid; place-items: center; flex: none; background: var(--success-95); color: var(--success-fg); }
.app-tbl .in-ppl svg { width: 10px; height: 10px; stroke-width: 2.5; }
.app-tbl tr.taken .who b { color: var(--fg-muted); }
/* a column of an app: a hairline on its left sets it apart from what the search itself gave */
.app-tbl .th-col, .app-tbl .td-col { border-left: 1px solid var(--border); min-width: 190px; }
.app-tbl .th-col { text-transform: none; letter-spacing: 0; font-size: 12px; color: var(--fg); padding-top: 6px; padding-bottom: 6px; }
.app-tbl .th-col .fill { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px 0 6px; border-radius: var(--pill); background: var(--ink); color: var(--on-ink); font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; flex: none; }
.app-tbl .th-col .fill svg { width: 10px; height: 10px; }
.app-tbl .th-col .fill .spin { width: 10px; height: 10px; border-width: 1.5px; }
.app-tbl .th-col .fill:disabled, .app-tbl .th-col .fill.on { opacity: .7; }
.app-tbl .th-col .th-x { width: 20px; height: 20px; border-radius: 50%; display: inline-grid; place-items: center; color: var(--fg-faint); opacity: 0; transition: opacity var(--fast), background var(--fast); flex: none; }
.app-tbl .th-col .th-x svg { width: 11px; height: 11px; }
.app-tbl .th-col:hover .th-x, .app-tbl .th-col .th-x:focus-visible { opacity: 1; }
.app-tbl .th-col .th-x:hover { background: color-mix(in srgb, var(--fg) 8%, transparent); color: var(--fg); }
.cell { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; max-width: 280px; min-width: 0; }
.cell .val { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell.ok .val { font-weight: 500; box-shadow: inset 0 -2px 0 color-mix(in srgb, var(--signal) 55%, transparent); }
.cell.none, .cell.need { color: var(--fg-faint); }
.cell.err { color: var(--error-fg); }
.cell.wait { color: var(--signal); }
.tbl-foot { flex-wrap: wrap; }

/* ── «Збери свою» ── */
.soon-hero { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 28px; align-items: center; padding: 8px 0 26px; }
.soon-h { font-size: 30px; line-height: 1.12; letter-spacing: -.02em; font-weight: 700; margin: 14px 0 12px; max-width: 440px; text-wrap: balance; }
.soon-pic { border-radius: var(--r-2xl); background: var(--bg-muted); padding: 14px; min-width: 0; }
.soon-svg { width: 100%; height: auto; display: block; }
.soon-svg .ln { fill: none; stroke: var(--border-strong); stroke-width: 1; }
.soon-svg .paper { fill: var(--paper); }
.soon-svg .rail { fill: var(--bg-subtle); stroke: none; }
.soon-svg .fill { fill: color-mix(in srgb, var(--fg) 20%, var(--paper)); }
.soon-svg .fill2 { fill: color-mix(in srgb, var(--fg) 10%, var(--paper)); }
.soon-svg .tx { font: 500 10.5px var(--font); fill: var(--fg-muted); }
.soon-svg .ask-t { font-size: 11.5px; fill: var(--fg); }
.soon-svg .ask-veil { fill: var(--paper); transform-box: fill-box; transform-origin: right center; animation: soon-type 9s steps(42, end) infinite; }
.soon-svg .sig { fill: var(--signal); }
.soon-svg .sig-soft { fill: color-mix(in srgb, var(--signal) 12%, var(--paper)); stroke: color-mix(in srgb, var(--signal) 55%, var(--paper)); stroke-width: 1; }
.soon-svg .sig-fill { fill: var(--signal); }
.soon-svg .sig-ln { fill: none; stroke: var(--signal); stroke-width: 1.2; stroke-linecap: round; }
.soon-svg .sig-t { fill: color-mix(in srgb, var(--signal) 70%, var(--fg)); font-weight: 600; }
.soon-svg .on-sig { fill: #fff; font-weight: 600; }
.soon-svg .part { opacity: 0; transform-box: fill-box; transform-origin: center; animation: soon-land 9s var(--spring, ease-out) infinite; }
.soon-svg .p1 { animation-delay: 0s; --at: 34%; } .soon-svg .p2 { animation-name: soon-land2; } .soon-svg .p3 { animation-name: soon-land3; } .soon-svg .p4 { animation-name: soon-land4; }
.soon-svg .cellv { transform-box: fill-box; transform-origin: left center; animation: soon-cell 9s ease-out infinite; animation-delay: calc(var(--i) * .12s); }
@keyframes soon-type { 0% { transform: scaleX(1); } 26%, 100% { transform: scaleX(0); } }
@keyframes soon-land { 0%, 30% { opacity: 0; transform: translateY(10px) scale(.94); } 36%, 94% { opacity: 1; transform: none; } 100% { opacity: 0; transform: none; } }
@keyframes soon-land2 { 0%, 40% { opacity: 0; transform: translateY(-10px) scale(.94); } 46%, 94% { opacity: 1; transform: none; } 100% { opacity: 0; transform: none; } }
@keyframes soon-land3 { 0%, 50% { opacity: 0; transform: translateX(14px) scale(.97); } 57%, 94% { opacity: 1; transform: none; } 100% { opacity: 0; transform: none; } }
@keyframes soon-land4 { 0%, 62% { opacity: 0; transform: scale(.6); } 68%, 94% { opacity: 1; transform: none; } 100% { opacity: 0; transform: none; } }
@keyframes soon-cell { 0%, 58% { transform: scaleX(0); } 70%, 100% { transform: scaleX(1); } }
.soon-ways { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.soon-way { padding: 22px 22px 24px 0; }
.soon-way + .soon-way { padding-left: 22px; border-left: 1px solid var(--border); }
.soon-way .h3 { font-size: 15.5px; }
.soon-how { margin-top: 26px; }
.soon-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.soon-steps li { display: flex; gap: 10px; align-items: flex-start; }
.soon-steps .n { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; background: var(--ink); color: var(--on-ink); flex: none; }
.soon-steps b { font-size: 13px; font-weight: 600; display: block; margin-bottom: 2px; }

@media (max-width: 960px) {
  .soon-hero { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .soon-h { font-size: 24px; }
  .soon-ways { grid-template-columns: minmax(0, 1fr); }
  .soon-way, .soon-way + .soon-way { padding: 18px 0; border-left: 0; }
  .soon-way + .soon-way { border-top: 1px solid var(--border); }
  .soon-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .app-tbl .th-col, .app-tbl .td-col { min-width: 150px; }
}
@media (max-width: 560px) { .soon-steps { grid-template-columns: minmax(0, 1fr); } .app-grid { grid-template-columns: minmax(0, 1fr); } }
@media (prefers-reduced-motion: reduce) {
  .soon-svg .part, .soon-svg .cellv, .soon-svg .ask-veil { animation: none; opacity: 1; transform: none; }
  .soon-svg .ask-veil { display: none; }
}

/* ── work handed to an app (BB-90): the list of tasks, one task with its turns, the form of a new one ── */
.app-long { min-height: 132px; resize: vertical; line-height: 1.5; }
.app-flag { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; }
.app-flag input { margin-top: 3px; flex: none; }
.aw-list { display: flex; flex-direction: column; gap: 8px; }
.aw-row { text-align: left; display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; }
.aw-row.aw-asks { box-shadow: inset 2px 0 0 var(--warn); }
.aw-t { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aw-said { margin-top: 3px; font-size: 13px; line-height: 1.45; color: var(--fg-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.aw-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 12px; color: var(--fg-subtle); }
.aw-who { display: inline-flex; align-items: center; gap: 4px; color: var(--fg-muted); }
.aw-who svg { width: 12px; height: 12px; }
.aw-live { display: inline-flex; align-items: center; gap: 6px; flex: none; font-size: 12.5px; color: var(--fg-muted); white-space: nowrap; }
.aw-live .spin { width: 12px; height: 12px; }
.aw-waits { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 13px; color: var(--fg-muted); }
.aw-waits svg { width: 14px; height: 14px; flex: none; }
.aw-about { display: flex; align-items: center; gap: 10px; }
.aw-head { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.aw-person { cursor: pointer; }
.aw-turns { display: flex; flex-direction: column; gap: 14px; }
.aw-turn { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.aw-turn-h { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 13px; }
.aw-turn.aw-me .aw-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13.5px; line-height: 1.5; padding: 10px 12px; border-radius: var(--r-md); background: var(--bg-muted); }
.aw-turn.aw-app .md { font-size: 13.5px; line-height: 1.55; overflow-wrap: anywhere; }
.aw-turn.aw-app .md > :first-child { margin-top: 0; }
.aw-link { color: var(--fg); text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 2px; overflow-wrap: anywhere; }
.aw-link:hover { text-decoration-color: currentColor; }
.aw-files { display: flex; flex-wrap: wrap; gap: 6px; }
.aw-file { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; height: 30px; padding: 0 10px; border-radius: var(--r-md); box-shadow: inset 0 0 0 1px var(--border); background: var(--paper); font-size: 12.5px; }
.aw-file:hover { box-shadow: inset 0 0 0 1px var(--border-strong); }
.aw-file svg { width: 13px; height: 13px; flex: none; color: var(--fg-subtle); }
.aw-file .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aw-answer { min-height: 76px; resize: vertical; line-height: 1.5; }
.aw-reply { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }

/* ── one grid of apps and services to connect (BB-109) ── */
.grow-hidden { margin: 26px 0 0; }
.grow-hidden .link { font-size: inherit; vertical-align: baseline; }

/* ── a card is its own press (BB-119): the word of what a press does, at the end of the name's row. Where there is a
   pointer it shows on hover and focus and takes no room before; it is only clipped, not removed, so a screen reader
   still says what the card does. Where there is no pointer it is always there. ── */
.app-card { position: relative; }
.app-card .app-hint { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--fg-muted); white-space: nowrap;
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.app-card .app-hint svg { width: 12px; height: 12px; }
.app-card:hover .app-hint, .app-card:focus-visible .app-hint { position: static; width: auto; height: auto; overflow: visible; clip-path: none; }
@media (hover: none) { .app-card .app-hint { position: static; width: auto; height: auto; overflow: visible; clip-path: none; opacity: .75; } }
/* a press waiting for the server (pressOf): the word of the press shows with a spinner for its arrow, the card keeps its shape */
.app-card[aria-busy="true"] { cursor: progress; }
.app-card[aria-busy="true"] .app-hint { position: static; width: auto; height: auto; overflow: visible; clip-path: none; }
.app-card[aria-busy="true"] .app-hint svg { display: none; }
.app-card .app-hint .spin { width: 11px; height: 11px; border-width: 1.5px; }
