/* Home-specific component styles. Tokens (:root vars, reset, .app shell)
   live in shared/tokens.css — this file only holds markup genuinely
   specific to this app. Header/person-picker/notification-bell/search
   chrome duplicated verbatim from the other four apps' app.css, same
   "own copy per Pages project" convention as everywhere else. The
   launch-grid/launch-tile rules at the bottom are new to this app. */

/* ---------- Header ---------- */
.app-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(243,236,225,0.92);
  backdrop-filter: blur(8px);
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
}
.wordmark {
  display: flex; align-items: center; gap: 8px;
  font-size: 22px; letter-spacing: 0.2px;
  margin: 0 0 4px;
  text-decoration: none;
}
.wordmark .underline { position: relative; }
.wordmark .underline::after {
  content: ""; position: absolute; left: 2px; right: -4px; bottom: -4px;
  height: 6px; background: var(--timber); opacity: 0.28;
  border-radius: var(--r-pill); transform: rotate(-0.6deg);
}
.header-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.subtitle { font-size: 12.5px; color: var(--ink-soft); margin: 0; }

main { padding: 20px; display: flex; flex-direction: column; gap: 22px; }

/* ---------- Person picker ---------- */
.person-btn {
  width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid var(--border);
  background: var(--cream-card); display: flex; align-items: center; justify-content: center; color: var(--timber);
}
.person-sheet {
  position: fixed; inset: 0; background: rgba(58,46,36,0.35); z-index: 50;
  display: flex; align-items: flex-end; justify-content: center;
}
.person-sheet[hidden] { display: none; }
.person-sheet .panel {
  background: var(--cream-card); border-radius: var(--r-lg) var(--r-lg) 0 0; padding: 20px;
  width: 100%; max-width: 480px; box-shadow: var(--shadow-lg);
}
.person-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 12px; }
.person-option {
  display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: var(--r-md);
  border: 1.5px solid var(--border); background: var(--cream-bg); text-align: left;
}
.person-option.selected { border-color: var(--timber); background: var(--timber-tint); }
.person-option .avatar { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: #fff; }

/* ---------- Notification bell + global search (step 9) ----------
   Same "icon button opens a panel" interaction shape for both, sitting
   next to the person picker in the header. Duplicated verbatim into
   every app's app.css, same convention as the JS modules behind them. */
.header-actions { display: flex; align-items: center; gap: 8px; }

.notif-btn {
  position: relative;
  width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid var(--border);
  background: var(--cream-card); display: flex; align-items: center; justify-content: center;
  color: var(--timber); cursor: pointer;
}
.notif-badge {
  position: absolute; top: -3px; right: -3px; min-width: 16px; height: 16px; padding: 0 3px;
  border-radius: var(--r-pill); background: var(--cat-terracotta); color: #fff;
  font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center;
  line-height: 1;
}
.notif-panel {
  position: absolute; top: calc(100% + 8px); right: 0; width: 300px; max-height: 380px;
  overflow-y: auto; background: var(--cream-card); border: 1px solid var(--border);
  border-radius: var(--r-md); box-shadow: var(--shadow-lg); z-index: 60; padding: 4px 0;
}
.notif-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px 8px; font-size: 12.5px; font-weight: 700; color: var(--ink-soft);
  text-transform: uppercase; letter-spacing: 0.04em;
}
.notif-panel-head .link { font-size: 11.5px; text-transform: none; letter-spacing: 0; font-weight: 600; background: none; border: none; color: var(--timber); }
.notif-empty { padding: 16px 14px; font-size: 12.5px; color: var(--ink-soft); text-align: center; }
.notif-row { display: flex; align-items: flex-start; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--border); }
.notif-row-body { flex: 1; }
.notif-title { font-size: 13px; font-weight: 600; margin: 0 0 2px; }
.notif-body { font-size: 12px; color: var(--ink-soft); margin: 0 0 2px; }
.notif-when { font-size: 10.5px; color: var(--ink-soft); margin: 0; opacity: 0.8; }
.notif-dismiss { border: none; background: transparent; color: var(--ink-soft); font-size: 11px; cursor: pointer; padding: 2px 4px; border-radius: 50%; }
.notif-dismiss:hover { background: var(--timber-tint); color: var(--timber); }

.search-panel { width: 300px; padding: 10px; }
.search-panel .search-box {
  display: flex; align-items: center; gap: 8px; background: var(--cream-bg);
  border: 1px solid var(--border); border-radius: var(--r-pill); padding: 8px 12px; color: var(--ink-soft);
}
.search-panel .search-box input {
  border: none; background: transparent; outline: none; font-family: var(--font-body);
  font-size: 14px; color: var(--ink); flex: 1;
}
.search-panel .search-box input::placeholder { color: var(--ink-soft); }
#global-search-results { max-height: 300px; overflow-y: auto; margin-top: 6px; }
.search-empty { padding: 10px 4px; font-size: 12.5px; color: var(--ink-soft); text-align: center; }
.search-hit { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-radius: var(--r-sm); text-decoration: none; color: inherit; }
.search-hit:hover { background: var(--timber-tint); }
.search-hit-icon { font-size: 16px; }
.search-hit-body { display: flex; flex-direction: column; }
.search-hit-title { font-size: 13px; font-weight: 600; }
.search-hit-sub { font-size: 11px; color: var(--ink-soft); }

/* ---------- Launcher tiles ----------
   The one thing genuinely new to this app: a card per other app, each
   tinted with one of the five existing category tokens (see
   shared/tokens.css) rather than inventing new colours — same palette
   already used for per-person theming and room/category tags, just
   repurposed here as a per-app accent so the four tiles read as
   distinct at a glance. */
.launch-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (min-width: 560px) { .launch-grid { grid-template-columns: repeat(5, 1fr); } }

.launch-tile {
  display: flex; flex-direction: column; gap: 10px;
  background: var(--cream-card); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 18px 16px; box-shadow: var(--shadow-sm); text-decoration: none; color: inherit;
  transition: transform var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
.launch-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.launch-tile .lt-icon {
  width: 42px; height: 42px; border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  background: var(--tile-tint, var(--timber-tint)); color: var(--tile-accent, var(--timber));
}
.launch-tile .lt-title { font-family: var(--font-display); font-weight: 700; font-size: 15px; }
.launch-tile .lt-stat { font-size: 12px; color: var(--ink-soft); min-height: 15px; }

.launch-tile[data-tile="track"] { --tile-accent: var(--cat-blue); --tile-tint: var(--cat-blue-tint); }
.launch-tile[data-tile="do"] { --tile-accent: var(--cat-terracotta); --tile-tint: var(--cat-terracotta-tint); }
.launch-tile[data-tile="buy"] { --tile-accent: var(--cat-sage); --tile-tint: var(--cat-sage-tint); }
.launch-tile[data-tile="pack"] { --tile-accent: var(--cat-ochre); --tile-tint: var(--cat-ochre-tint); }
.launch-tile[data-tile="settings"] { --tile-accent: var(--cat-plum); --tile-tint: var(--cat-plum-tint); }
