/* syad_kit.part_registry: tiles, top bar, menu and settings list.
   Built on ui-kit's --ui- variables (with fallbacks). Its own variables are --pr-. */

.pr-chip {
  display: inline-grid; place-items: center; flex: none;
  background: var(--pr-accent, var(--ui-accent, #64748b));
  color: var(--pr-accent-text, var(--ui-accent-text, #fff));
}
.pr-chip svg { width: 58%; height: 58%; display: block; }
.pr-chip--sm { width: 34px; height: 34px; border-radius: 9px; font-size: 18px; }
.pr-chip--md { width: 42px; height: 42px; border-radius: 11px; font-size: 22px; }
.pr-chip--lg { width: 54px; height: 54px; border-radius: 14px; font-size: 28px; }
.pr-chip__emoji { line-height: 1; }

/* top bar */
.pr-bar { display: flex; align-items: center; gap: 10px; min-height: 52px; }
.pr-bar__title {
  flex: 1; min-width: 0; margin: 0; font-size: var(--ui-text-lg, 26px); line-height: 1.2;
  font-weight: 650; letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pr-bar__home {
  display: inline-grid; place-items: center; flex: none; width: var(--ui-tap, 48px); height: var(--ui-tap, 48px);
  margin-left: -14px; border-radius: 12px; color: var(--ui-dim, inherit); text-decoration: none;
}
.pr-bar__home svg { width: 26px; height: 26px; }
.pr-bar__home:hover { color: var(--ui-text, inherit); }
.pr-bar__part {                                      /* 1.1.0: the part's icon as a link */
  display: inline-grid; place-items: center; flex: none; min-width: var(--ui-tap, 48px);
  min-height: var(--ui-tap, 48px); margin: 0 -7px; border-radius: 12px; text-decoration: none;
}
.pr-bar__title-link { color: inherit; text-decoration: none; }
.pr-bar__title-link:hover { text-decoration: underline; text-underline-offset: 4px; }

/* menu */
.pr-menu { position: relative; flex: none; }
.pr-menu__button {
  list-style: none; display: grid; place-items: center; width: var(--ui-tap, 48px); height: var(--ui-tap, 48px);
  border-radius: 50%; cursor: pointer; background: var(--ui-surface2, #ddd); color: var(--ui-text, inherit);
  font-weight: 650; font-size: var(--ui-text-sm, 17px); user-select: none;
}
.pr-menu__button::-webkit-details-marker { display: none; }
.pr-menu[open] > .pr-menu__button { background: var(--ui-accent-dim, #ddd); color: var(--ui-accent-link, inherit); }
.pr-menu__sheet {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 40; width: max-content; min-width: 260px;
  max-width: calc(100vw - 24px); padding: 14px; display: grid; gap: 10px;
  background: var(--ui-surface, #fff); border: 1px solid var(--ui-border, #ccc); border-radius: 14px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.35);
}
.pr-menu__who { margin: 0 2px; color: var(--ui-dim, inherit); font-size: 0.95rem; }
.pr-menu__link {
  display: flex; align-items: center; min-height: var(--ui-tap, 48px); padding: 0 12px; border-radius: 10px;
  color: var(--ui-text, inherit); text-decoration: none; font-weight: 600;
}
.pr-menu__link:hover { background: var(--ui-surface2, #eee); }

/* home tiles */
.pr-tiles ul {
  list-style: none; margin: 10px 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px;
}
.pr-tile {
  display: flex; flex-direction: column; justify-content: space-between; gap: 22px;
  min-height: 136px; padding: 16px; border-radius: 16px; text-decoration: none; color: var(--ui-text, inherit);
  background: color-mix(in srgb, var(--pr-accent) 11%, var(--ui-surface, #fff));
  -webkit-tap-highlight-color: transparent;
}
.pr-tile:hover { background: color-mix(in srgb, var(--pr-accent) 18%, var(--ui-surface, #fff)); }
.pr-tile:active { transform: scale(0.98); }
.pr-tile__name { font-size: var(--ui-text-md, 20px); font-weight: 650; line-height: 1.2; }
/* Light theme: a stronger tint, so each tile clearly shows its part's accent (1.0.1). */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .pr-tile { background: color-mix(in srgb, var(--pr-accent) 20%, var(--ui-surface, #fff)); }
  :root:not([data-theme="dark"]) .pr-tile:hover { background: color-mix(in srgb, var(--pr-accent) 27%, var(--ui-surface, #fff)); }
}
:root[data-theme="light"] .pr-tile { background: color-mix(in srgb, var(--pr-accent) 20%, var(--ui-surface, #fff)); }
:root[data-theme="light"] .pr-tile:hover { background: color-mix(in srgb, var(--pr-accent) 27%, var(--ui-surface, #fff)); }

/* settings list: indented under its heading */
.pr-list { list-style: none; margin: 0; padding: 0 0 0 14px; }
.pr-list__link {
  display: flex; align-items: center; gap: 12px; min-height: 58px;
  color: var(--ui-text, inherit); text-decoration: none; font-weight: 600;
  border-bottom: 1px solid var(--ui-border, #ccc);
}
.pr-list li:last-child .pr-list__link { border-bottom: 0; }

@media (prefers-reduced-motion: reduce) { .pr-tile:active { transform: none; } }
