/* ============================================================
   Stage 2 · Screen 8.11 — Client Home
   ============================================================ */
.home {
  max-width: 1100px;
  margin: 0 auto;
  padding: var(--space-7) var(--space-7) var(--space-8);
}

/* Header */
.home-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: var(--space-5);
  padding-bottom: var(--space-6);
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: var(--space-7);
}
.home-header__date {
  color: var(--ink-tertiary);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0 0 var(--space-2);
}
.home-header__title { margin: 0 0 var(--space-2); text-wrap: balance; }
.home-header__sub { margin: 0; color: var(--ink-secondary); }
.home-header__locale {
  display: flex; align-items: center; gap: var(--space-1);
  background: none; border: 1px solid var(--line-soft);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-sm);
  font-size: 12px; color: var(--ink-tertiary);
  cursor: pointer;
}
.home-header__locale:hover { border-color: var(--ink-secondary); }
.home-header__locale .is-active { color: var(--ink-primary); font-weight: 500; }
.home-header__right { display: flex; align-items: center; gap: var(--space-3); }

/* Case picker — quiet segmented control, hairline on canvas */
.home-casepick { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid var(--line-soft); border-radius: var(--radius-sm); background: var(--surface-canvas); }
.home-casepick__opt { background: none; border: none; cursor: pointer; font: inherit; font-size: 12px; color: var(--ink-tertiary); padding: var(--space-1) var(--space-3); border-radius: calc(var(--radius-sm) - 1px); white-space: nowrap; }
.home-casepick__opt:hover { color: var(--ink-primary); }
.home-casepick__opt.is-active { background: var(--surface-raised); color: var(--ink-primary); font-weight: 600; box-shadow: inset 0 0 0 1px var(--line-soft); }

.home__main { display: flex; flex-direction: column; gap: var(--space-7); }

/* Hero (CTA + active run) */
.home-hero {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: var(--space-5);
}
@media (max-width: 880px) { .home-hero { grid-template-columns: 1fr; } }

.home-hero__cta {
  display: flex; align-items: center; gap: var(--space-5);
  padding: var(--space-6);
  background: var(--surface-raised);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  cursor: pointer;
  text-align: left;
  color: var(--ink-primary);
  transition: border-color 160ms var(--ease-enter), transform 160ms var(--ease-enter);
  position: relative; overflow: hidden;
}
.home-hero__cta:hover {
  border-color: var(--accent-primary);
  transform: translateY(-1px);
}
.home-hero__cta:focus-visible { outline: 2px solid var(--ink-primary); outline-offset: 2px; }
.home-hero__cta-icon {
  width: 56px; height: 56px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-primary-soft);
  color: var(--accent-primary);
  border-radius: 50%;
  flex-shrink: 0;
}
.home-hero__cta-text { flex: 1; display: flex; flex-direction: column; gap: var(--space-1); }
.home-hero__cta-arrow {
  font-size: 24px;
  color: var(--ink-tertiary);
  transition: transform 160ms var(--ease-enter), color 160ms var(--ease-enter);
}
.home-hero__cta:hover .home-hero__cta-arrow {
  transform: translateX(4px);
  color: var(--accent-primary);
}

.home-hero__active {
  padding: var(--space-5);
  background: var(--surface-raised);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  display: flex; flex-direction: column; gap: var(--space-3);
}
.home-hero__active-head {
  display: flex; justify-content: space-between; align-items: center; gap: var(--space-2);
}
.home-hero__active-title {
  margin: 0;
  text-wrap: pretty;
}
.home-hero__active-prog {
  display: flex; flex-direction: column; gap: var(--space-2);
  margin-top: var(--space-2);
}
.home-hero__active-bar {
  height: 4px;
  background: var(--surface-sunk);
  border-radius: 2px;
  overflow: hidden;
}
.home-hero__active-fill {
  height: 100%;
  background: var(--accent-data);
  transition: width 600ms var(--ease-enter);
  position: relative;
}
.home-hero__active-fill::after {
  /* breathing pulse */
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6), transparent);
  animation: home-shimmer 1800ms infinite linear;
}
@keyframes home-shimmer {
  from { transform: translateX(-100%); }
  to   { transform: translateX(100%); }
}
.home-hero__active-btn {
  align-self: flex-start;
  margin-top: var(--space-2);
  padding: 0;
  background: none !important; border: none !important;
}

/* Recent decisions */
.home-recent {}
.home-recent__head {
  display: flex; justify-content: space-between; align-items: flex-end;
  margin-bottom: var(--space-4);
}
.home-recent__all {
  color: var(--ink-secondary);
  text-decoration: none;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
}
.home-recent__all:hover {
  background: var(--surface-sunk);
  color: var(--ink-primary);
}

.home-recent__list {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column;
}
.home-recent__list li { border-bottom: 1px solid var(--line-soft); }
.home-recent__list li:first-child { border-top: 1px solid var(--line-soft); }

.home-recent__row {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto 24px;
  gap: var(--space-5);
  align-items: center;
  padding: var(--space-5) var(--space-3);
  background: none; border: none;
  text-align: left; cursor: pointer;
  color: var(--ink-primary);
  transition: background 140ms var(--ease-enter);
  position: relative;
}
.home-recent__row:hover { background: var(--surface-sunk); }
.home-recent__row:focus-visible {
  outline: 2px solid var(--ink-primary);
  outline-offset: -2px;
}

.home-recent__row-main { min-width: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.home-recent__row-titleline {
  display: flex; align-items: baseline; gap: var(--space-3);
  flex-wrap: wrap; row-gap: var(--space-1);
}
.home-recent__row-titleline .t-h3 { line-height: 1.4; }
.home-recent__row-headline {
  margin: 0;
  color: var(--ink-secondary);
  text-wrap: pretty;
  max-width: 580px;
}

.home-recent__row-meta {
  display: flex; flex-direction: column; align-items: flex-end; gap: var(--space-2);
  min-width: 180px;
}
.home-recent__row-conf {
  display: flex; align-items: center; gap: var(--space-3);
}
.home-recent__row-when {
  color: var(--ink-tertiary);
  font-variant-numeric: tabular-nums;
}
.home-recent__row-arrow {
  color: var(--ink-tertiary);
  font-size: 18px;
  transition: transform 140ms var(--ease-enter), color 140ms var(--ease-enter);
}
.home-recent__row:hover .home-recent__row-arrow {
  transform: translateX(3px);
  color: var(--ink-primary);
}

@media (max-width: 720px) {
  .home-recent__row { grid-template-columns: 1fr; gap: var(--space-3); }
  .home-recent__row-meta { align-items: flex-start; min-width: 0; }
  .home-recent__row-arrow { display: none; }
}

/* Library footer — blended: shares the page surface, hairline border,
   amber reserved for the seal mark + link only (meaning, not a fill band) */
.home-library {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: var(--space-5);
  align-items: center;
  padding: var(--space-6);
  background: var(--surface-raised);
  border-radius: var(--radius-lg);
  border: 1px solid var(--line-soft);
}
.home-library__seal {
  color: var(--accent-primary);
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
}
.home-library__main { min-width: 0; }
.home-library__link {
  color: var(--ink-primary);
  text-decoration: none;
  padding: var(--space-2) var(--space-4);
  background: var(--surface-raised);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  font-size: 13px;
  white-space: nowrap;
}
.home-library__link:hover {
  border-color: var(--ink-secondary);
}
@media (max-width: 720px) {
  .home-library { grid-template-columns: 1fr; }
  .home-library__seal { display: none; }
}

/* ============================================================
   Mobile — Stage 2 Screen 8.11 client home
   ============================================================ */
@media (max-width: 767px) {
  .home { padding: var(--space-4) var(--space-4) var(--space-6); }

  /* Header — stack date/title/sub, drop separate locale (it's in app shell user pill) */
  .home-header {
    flex-direction: column; align-items: stretch; gap: var(--space-3);
    padding-bottom: var(--space-4); margin-bottom: var(--space-5);
  }
  .home-header__locale { align-self: flex-start; }
  .home-header__title.t-h1 { font-size: 26px; line-height: 32px; }

  /* Main gap tightens */
  .home__main { gap: var(--space-5); }

  /* CTA — full-width, stack icon + text + arrow */
  .home-hero { gap: var(--space-3); }
  .home-hero__cta {
    padding: var(--space-4);
    gap: var(--space-3);
    width: 100%;
  }
  .home-hero__cta-icon { width: 48px; height: 48px; }
  .home-hero__cta-arrow { font-size: 20px; }

  /* Active run card — tighter padding */
  .home-hero__active { padding: var(--space-4); }
  .home-hero__active-head { flex-direction: column; align-items: flex-start; gap: var(--space-2); }

  /* Recent decisions — already stacks at 720px; bump tap target */
  .home-recent__row { padding: var(--space-4) var(--space-3); }
  .home-recent__row-titleline { flex-wrap: wrap; gap: var(--space-2); }
  .home-recent__row-headline { font-size: 14px; line-height: 22px; }

  /* Library footer */
  .home-library { padding: var(--space-4); gap: var(--space-3); }
  .home-library__link { width: 100%; text-align: center; min-height: 44px; display: flex; align-items: center; justify-content: center; }
}
