/* TaskBlink Data, the signed-in home (#search) and Search History (#history): DESIGN-BRIEF 2.19 and the
   Search and SearchFirstDay artboards (package A7). Reads tb.css tokens only, so dark mode follows them.
   Every link and button here is a 44 px target. */

/* ------------------------------------------------------------------ *
 * The top: the greeting and TB.sentence (A1) with its hint, suggestions and note
 * ------------------------------------------------------------------ */
.tb-home { padding-top: 44px; padding-bottom: 80px; }
.tb-home__top { display: flex; flex-direction: column; align-items: center; text-align: center; }
.tb-home__hello { margin: 0; }
/* The router moves focus to the page's h1 after a route change; a heading is not a control, so no ring */
.tb-home__hello:focus-visible, .tb-hist h1:focus-visible { outline: none; }
.tb-home__sub { margin: 8px 0 0; font: 400 15px/1.5 var(--font); color: var(--ink-2); }
.tb-home__sentence { width: 100%; max-width: 900px; margin-top: 28px; }
.tb-home__sentence .tb-sentence__note { flex-wrap: wrap; }

/* The note's content (the cost line or a refusal): an icon, the words, then a refusal's fixes and link */
.tb-home__note { display: inline-flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 4px 8px; max-width: 900px; }
.tb-home__note--good > .tb-icon { color: var(--good); }
.tb-home__note--warn > .tb-icon { color: var(--warn); }
.tb-home__note--warn .tb-home__notetext { color: var(--ink); font-weight: 500; }
.tb-home__fix { flex-basis: 100%; display: flex; flex-wrap: wrap; justify-content: center; column-gap: 8px; }
.tb-home__fix .tb-chip { margin: 6px 0; }
.tb-home__notelink {
  display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 4px;
  font: 500 13px/1 var(--font); color: var(--brand-text); text-decoration: none;
}
.tb-home__notelink:hover { color: var(--brand-ink); text-decoration: underline; }

/* ------------------------------------------------------------------ *
 * Two rows of two areas (612 each at 1440, gap 24)
 * ------------------------------------------------------------------ */
.tb-home__areas { margin-top: 32px; }
.tb-home__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: start; }
.tb-home__grid + .tb-home__grid { margin-top: 32px; }
.tb-home__grid--fill { align-items: stretch; }
.tb-home__grid--span { grid-template-columns: minmax(0, 1fr); }
.tb-home__area { display: flex; flex-direction: column; min-width: 0; }

.tb-home__head { height: 32px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tb-home__title { margin: 0; font: 600 15px/1.3 var(--font); color: var(--ink); }
.tb-home__see {
  height: 44px; margin: -6px 0; display: inline-flex; align-items: center; gap: 2px;
  font: 500 13px/1 var(--font); color: var(--brand-text); text-decoration: none;
}
.tb-home__see:hover { color: var(--brand-ink); text-decoration: underline; }
.tb-home__see .tb-icon { width: 14px; height: 14px; }

.tb-home__card {
  margin-top: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--sh-card);
}
.tb-home__grid--fill .tb-home__card { flex: 1; }
.tb-home__muted { margin: 0; font: 400 13px/1.45 var(--font); color: var(--ink-3); }
.tb-home__emptyline { margin: 0; font: 600 14px/1.35 var(--font); color: var(--ink); }

/* Photo tiles (2.26): A2's .tb-thumb markup (TB.cards.tile), 40 px on cards, 32 px in history rows, a white
   2 px edge and the artboard's hairline ring. These rules stand alone too, so the home looks the same if
   tb-cards.css is not on the page; the 32 px stack overlaps by 8 (2.19), where A2's stacks overlap by 10. */
.tb-home__stack { display: flex; align-items: center; flex: none; }
.tb-home__stack--40 { height: 40px; }
.tb-home__stack--32 { height: 32px; }
.tb-home__stack .tb-home__tile {
  position: relative; display: block; flex: none; box-sizing: border-box; overflow: hidden; background: var(--bg-soft);
  border: 2px solid var(--surface); box-shadow: 0 0 0 1px rgba(14,18,48,.08);
}
.tb-home__stack--40 .tb-home__tile { width: 40px; height: 40px; border-radius: var(--r-md); }
.tb-home__stack--32 .tb-home__tile { width: 32px; height: 32px; border-radius: var(--r-sm); }
.tb-home__stack--40 > * + *, .tb-home__stack--40 > .tb-home__tile + .tb-home__tile { margin-left: -10px; }
.tb-home__stack--32 > * + *, .tb-home__stack--32 > .tb-home__tile + .tb-home__tile { margin-left: -8px; }
/* A tile shows its photo only once it has loaded, so a photo that fails is never seen before it goes */
.tb-home__stack .tb-thumb__img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block;
  opacity: 0; transition: opacity var(--t-hover) var(--ease);
}
.tb-home__stack .tb-thumb__img.is-loaded { opacity: 1; }
.tb-home__count {
  position: relative; flex: none; box-sizing: border-box; min-width: 40px; height: 40px; padding: 0 2px; border-radius: var(--r-md); border: 2px solid var(--surface);
  background: var(--bg-soft); box-shadow: inset 0 0 0 1px var(--line); white-space: nowrap;
  display: inline-flex; align-items: center; justify-content: center;
  font: 600 12px/1 var(--font-mono); color: var(--ink-2);
}
.tb-home__glyph {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg-soft); color: var(--ink-3); box-shadow: inset 0 0 0 1px var(--line);
}
.tb-home__glyph--40 { width: 40px; height: 40px; border-radius: 999px; background: var(--brand-tint); color: var(--brand); box-shadow: none; }
.tb-home__glyph--32 { width: 32px; height: 32px; border-radius: var(--r-sm); }

/* All my businesses */
.tb-home__mine { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.tb-home__mine--empty { gap: 6px; }
.tb-home__total { margin: 0; font: 600 22px/1.25 var(--font); letter-spacing: -0.01em; color: var(--ink); }
.tb-home__mine--empty .tb-home__total { font-size: 17px; }
.tb-home__facts { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 12px; row-gap: 8px; }
.tb-home__fact { display: flex; align-items: center; gap: 8px; font: 600 12.5px/18px var(--font); color: var(--ink); }
.tb-home__fact .tb-icon { width: 14px; height: 14px; color: var(--ink-3); }
.tb-home__factword { font-weight: 400; color: var(--ink-2); }
.tb-home__open { align-self: flex-start; margin-top: auto; padding: 0 16px; }
.tb-home__open .tb-icon { color: var(--ink-3); }

/* Search History rows: 60 tall, one link each */
.tb-home__hist { padding: 4px 20px; }
.tb-home__hist--empty { padding: 20px; display: flex; flex-direction: column; gap: 4px; }
.tb-home__rows { list-style: none; margin: 0; padding: 0; }
.tb-home__row + .tb-home__row { border-top: 1px solid var(--line); }
.tb-home__rowlink {
  min-height: 60px; margin: 0 -8px; padding: 0 8px; border-radius: var(--r-md);
  display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink);
  transition: background-color var(--t-hover) var(--ease);
}
.tb-home__rowlink:hover { background: var(--surface-2); color: var(--ink); }
.tb-home__thumbs { flex: none; display: flex; align-items: center; width: 56px; height: 32px; }
.tb-home__rowtext { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; text-align: left; }
.tb-home__rowlabel { font: 600 14px/1.35 var(--font); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-home__rowmeta { font: 400 12.5px/1.4 var(--font); color: var(--ink-3); }
.tb-home__pill { flex: none; gap: 4px; }
.tb-home__chevicon { width: 16px; height: 16px; color: var(--ink-4); }

/* Smart lists: cards 294 wide, two per area (four when the area spans the row) */
.tb-home__smartgrid { margin-top: 12px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.tb-home__area--span .tb-home__smartgrid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tb-home__smart {
  height: 196px; display: flex; flex-direction: column; padding: 16px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-card);
  text-decoration: none; color: var(--ink);
  transition: border-color var(--t-hover) var(--ease), box-shadow var(--t-hover) var(--ease);
}
.tb-home__smart:hover { color: var(--ink); border-color: var(--line-strong); box-shadow: var(--sh-card-hover); }
.tb-home__smarttop { display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 40px; }
.tb-home__keeps {
  flex: none; width: 28px; height: 28px; border-radius: 999px; background: var(--bg-soft); color: var(--ink-3);
  display: inline-flex; align-items: center; justify-content: center;
}
.tb-home__keeps .tb-icon { width: 14px; height: 14px; }
.tb-home__picked { flex: none; }
.tb-home__smartname {
  margin-top: 14px; font: 600 15px/1.33 var(--font); letter-spacing: -0.005em; color: var(--ink);
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
}
.tb-home__smartfoot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tb-home__smartcount { font: 400 13px/1.3 var(--font); color: var(--ink-2); }
.tb-home__uptodate { font: 400 12.5px/1.3 var(--font); color: var(--ink-3); }
.tb-home__new { flex: none; gap: 5px; }
.tb-home__dot { width: 6px; height: 6px; border-radius: 999px; background: var(--brand); flex: none; }

/* The Create tile (ends an area that has cards) and the Create card (fills an empty area), U20 */
/* 612 x 56 as drawn, also when Smart lists spans the row in phase A (it then lines up with two cards) */
.tb-home__createtile {
  margin-top: 16px; width: 100%; max-width: 612px; min-height: 56px; padding: 0 16px; border: 1.5px dashed var(--line-strong); border-radius: var(--r-lg);
  display: flex; align-items: center; gap: 10px; text-decoration: none;
  transition: background-color var(--t-hover) var(--ease), border-color var(--t-hover) var(--ease);
}
.tb-home__createtile:hover { background: var(--surface-2); border-color: var(--brand-line); }
.tb-home__createtile .tb-icon { color: var(--brand-text); width: 18px; height: 18px; }
.tb-home__createtitle { flex: none; font: 600 14px/1 var(--font); color: var(--ink); }
.tb-home__createsub { min-width: 0; font: 400 12.5px/1.3 var(--font); color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.tb-home__create {
  margin-top: 12px; width: 100%; max-width: 612px; min-height: 164px; padding: 24px; display: flex; gap: 16px;
  background: var(--surface); border: 1.5px dashed var(--line-strong); border-radius: var(--r-lg);
  text-decoration: none; color: var(--ink);
  transition: border-color var(--t-hover) var(--ease), background-color var(--t-hover) var(--ease);
}
.tb-home__create:hover { color: var(--ink); border-color: var(--brand-line); }
.tb-home__createicon {
  flex: none; width: 40px; height: 40px; border-radius: 999px; background: var(--brand-tint); color: var(--brand);
  display: flex; align-items: center; justify-content: center;
}
.tb-home__createicon .tb-icon { width: 20px; height: 20px; }
.tb-home__createtext { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; text-align: left; }
.tb-home__createhead { font: 600 17px/1.25 var(--font); letter-spacing: -0.01em; color: var(--ink); }
.tb-home__createdesc { font: 400 13.5px/1.5 var(--font); color: var(--ink-2); }
.tb-home__createbtn {
  margin-top: auto; align-self: flex-start; height: 36px; padding: 0 14px 0 12px; border-radius: var(--r-md);
  background: var(--surface); border: 1px solid var(--line-strong); color: var(--ink);
  font: 600 13px/1 var(--font); display: inline-flex; align-items: center; gap: 6px;
}
.tb-home__createbtn .tb-icon { color: var(--ink-2); }
.tb-home__create:hover .tb-home__createbtn { background: var(--surface-2); }

.tb-home__older {
  align-self: flex-start; margin-top: 8px; min-height: 44px; display: inline-flex; align-items: center;
  font: 500 13px/1.3 var(--font); color: var(--ink-3); text-decoration: underline; text-underline-offset: 3px;
}
.tb-home__older:hover { color: var(--brand-text); }

/* Loading and trouble */
.tb-home__skelhead { width: 140px; height: 16px; margin: 8px 0; }
.tb-home__skel { margin-top: 12px; border-radius: var(--r-lg); }
.tb-home__skel--tall { height: 246px; }
.tb-home__skel--short { height: 164px; }
.tb-home__failed { padding: 32px 0; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.tb-home__failed p { margin: 0; color: var(--ink-2); }

/* ------------------------------------------------------------------ *
 * #history: Search History's full page
 * ------------------------------------------------------------------ */
.tb-hist { max-width: calc(880px + 2 * var(--gutter)); padding-top: 32px; padding-bottom: 80px; }
.tb-hist__back {
  display: inline-flex; align-items: center; gap: 6px; height: 44px; margin-left: -4px; padding: 0 4px;
  font: 500 14px/1 var(--font); color: var(--ink-2); text-decoration: none;
}
.tb-hist__back:hover { color: var(--ink); }
.tb-hist__top .tb-h1 { margin-top: 4px; }
.tb-hist__sub { margin: 8px 0 0; font: 400 15px/1.5 var(--font); color: var(--ink-2); }
.tb-hist__card {
  margin-top: 24px; padding: 4px 20px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--sh-card);
}
.tb-hist__list { list-style: none; margin: 0; padding: 0; }
.tb-hist__row { display: flex; align-items: center; gap: 8px; }
.tb-hist__row + .tb-hist__row { border-top: 1px solid var(--line); }
.tb-hist__link { flex: 1; min-width: 0; }
.tb-hist__acts { flex: none; display: flex; align-items: center; gap: 4px; }
.tb-hist__row.is-editing { padding: 8px 0; }
.tb-hist__rename { flex: 1; min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; min-height: 60px; }
.tb-hist__input { flex: 1; min-width: 200px; width: auto; }
.tb-hist__error { flex-basis: 100%; margin: 0; }
.tb-hist__skelrow { height: 60px; display: flex; align-items: center; }
.tb-hist__skelrow + .tb-hist__skelrow { border-top: 1px solid var(--line); }
.tb-hist__skel { width: 100%; height: 32px; }
.tb-hist__empty { padding: 28px 0; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.tb-hist__empty p { margin: 0; color: var(--ink-2); }
.tb-hist__empty .tb-btn { margin-top: 8px; }
.tb-hist__more { margin-top: 16px; display: flex; justify-content: center; }
.tb-hist__more:empty { display: none; }

/* ------------------------------------------------------------------ *
 * Narrow screens: one column, a 16 px gutter, nothing scrolls sideways
 * ------------------------------------------------------------------ */
@media (max-width: 900px) {
  .tb-home__area--span .tb-home__smartgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .tb-home { padding-top: 24px; }
  .tb-home__grid { grid-template-columns: minmax(0, 1fr); }
  .tb-home__grid--fill { align-items: start; }
  .tb-home__grid + .tb-home__grid { margin-top: 24px; }
  .tb-home__grid > .tb-home__area + .tb-home__area { margin-top: 8px; }
  .tb-home__create { max-width: none; }
  .tb-hist__row { flex-wrap: wrap; row-gap: 0; padding-bottom: 6px; }
  .tb-hist__link { flex-basis: 100%; }
  .tb-hist__acts { margin-left: 60px; }
}
@media (max-width: 480px) {
  /* A history row's pill drops under its words, so the sentence keeps its width */
  .tb-home__rowlink { display: grid; grid-template-columns: 56px minmax(0, 1fr) 16px; column-gap: 12px; row-gap: 4px; padding-top: 10px; padding-bottom: 10px; }
  .tb-home__thumbs { grid-column: 1; grid-row: 1 / span 2; align-self: center; }
  .tb-home__rowtext { grid-column: 2; grid-row: 1; }
  .tb-home__pill { grid-column: 2; grid-row: 2; justify-self: start; }
  .tb-home__chevicon { grid-column: 3; grid-row: 1 / span 2; align-self: center; }
  .tb-home__smartgrid, .tb-home__area--span .tb-home__smartgrid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .tb-home__smart { height: auto; min-height: 150px; }
  .tb-home__createsub { display: none; }
  .tb-home__create { padding: 20px; gap: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .tb-home__rowlink, .tb-home__smart, .tb-home__createtile, .tb-home__create, .tb-home__stack .tb-thumb__img { transition: none; }
}
