/* Compact mobile-first home — starred actions + section rows */

.home-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.home-header__end {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.home-header .home-user-menu {
  position: relative;
  flex: 0 0 auto;
  z-index: 100;
}

.home-user-menu__trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  cursor: pointer;
  overflow: hidden;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.15s ease;
}

.home-user-menu__trigger:active {
  transform: scale(0.96);
}

.home-user-menu__trigger[aria-expanded="true"] {
  border-color: var(--border-hover);
  box-shadow: 0 2px 8px rgba(17, 17, 17, 0.1);
}

.home-user-menu__avatar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: var(--muted);
}

.home-user-menu__avatar-fallback {
  position: relative;
  z-index: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.home-user-menu__avatar-photo {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.home-user-menu__avatar.is-loaded .home-user-menu__avatar-photo {
  opacity: 1;
}

.home-user-menu__avatar--panel {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--surface2);
  border: 1px solid var(--border);
}

.home-user-menu__panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(240px, calc(100vw - 32px));
  padding: 14px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 12px 36px rgba(17, 17, 17, 0.18);
  box-sizing: border-box;
}

.home-user-menu__profile {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.home-user-menu__identity {
  min-width: 0;
  flex: 1;
}

.home-user-menu__name {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-user-menu__email {
  margin: 2px 0 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-user-menu__divider {
  height: 1px;
  margin: 12px 0 8px;
  background: var(--border);
}

.home-user-menu__divider[hidden],
.home-user-menu__item[hidden] {
  display: none !important;
}

.home-user-menu__item,
.home-user-menu__sign-out {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 10px 8px;
  border: none;
  border-radius: 10px;
  background: transparent;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  box-sizing: border-box;
  transition: background 0.15s ease;
}

.home-user-menu__item:active,
.home-user-menu__sign-out:active {
  background: var(--surface2);
  transform: scale(0.99);
}

@media (hover: hover) and (pointer: fine) {
  .home-user-menu__item:hover,
  .home-user-menu__sign-out:hover {
    background: var(--surface2);
  }
}

.tc-header {
  animation: fadeUp 0.4s ease both 0.04s;
}

@media (max-width: 600px) {
  .home-header {
    margin-bottom: 12px;
  }
}

.home-quick-card {
  margin-top: 0;
  background: rgba(255, 90, 0, 0.08);
  border-color: rgba(255, 90, 0, 0.28);
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.home-block-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
}

.home-block-label::before {
  content: "";
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  background: var(--accent);
  clip-path: polygon(50% 0%, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%);
}

.home-empty-banner {
  display: none;
  margin: 0;
  padding: 14px 16px;
  border-radius: var(--radius, 20px);
  border: 1px solid var(--border);
  background: var(--surface2, rgba(0, 0, 0, 0.03));
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
}

[data-section-empty].is-section-empty .home-empty-banner {
  display: block;
}

[data-section-empty].is-section-empty .home-section-list {
  display: none;
}

.home-quick-card[hidden],
.home-quick-card.is-favorite-empty {
  display: none !important;
}

.home-quick-grid {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.home-quick-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex: 0 0 calc((100% - 16px) / 3);
  width: calc((100% - 16px) / 3);
  min-height: 74px;
  padding: 10px 6px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: inherit;
  text-align: center;
  text-decoration: none;
  user-select: none;
  -webkit-user-select: none;
  scroll-snap-align: start;
  box-sizing: border-box;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    transform 0.15s ease;
}

.home-quick-action--primary {
  border-color: var(--accent);
  background: var(--accent);
}

.home-quick-action--primary .home-quick-action__label {
  color: #fff;
}

.home-quick-action--primary .home-quick-action__sub {
  color: rgba(255, 255, 255, 0.85);
}

.home-quick-action:active {
  transform: scale(0.97);
}

.home-quick-action__label {
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
}

.home-quick-action__sub {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.2;
}

.home-section-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Each section is a disclosure: header button + panel holding its hub cards. */
.home-section {
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.home-section.is-open {
  border-color: rgba(255, 90, 0, 0.35);
}

.home-section-heading {
  margin: 0;
  font: inherit;
}

.home-section-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 60px;
  padding: 13px 12px;
  border: 0;
  border-radius: 20px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  text-decoration: none;
  -webkit-appearance: none;
  appearance: none;
  transition:
    background 0.2s ease,
    transform 0.15s ease;
}

.home-section-row:active {
  transform: scale(0.99);
}

@media (hover: hover) and (pointer: fine) {
  .home-section-row:hover {
    background: var(--surface2);
  }
}

.home-section-row__icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 38px;
  background: rgba(255, 90, 0, 0.1);
  border: 1px solid rgba(255, 90, 0, 0.22);
  color: var(--accent);
}

.home-section-row__icon--safety {
  background: rgba(255, 90, 0, 0.1);
  border-color: rgba(255, 90, 0, 0.22);
  color: var(--accent);
}

.home-section-row__body {
  flex: 1;
  min-width: 0;
}

.home-section-row__title {
  display: block;
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.home-section-row__meta {
  display: block;
  margin: 3px 0 0;
  font-size: 0.8rem;
  font-weight: 400;
  line-height: 1.35;
  color: var(--muted);
}

.home-section-row__chevron {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  color: var(--muted);
  opacity: 0.7;
  transition:
    transform 0.18s ease,
    color 0.18s ease,
    opacity 0.18s ease;
}

.home-section.is-open .home-section-row__chevron {
  transform: rotate(90deg);
  color: var(--accent);
  opacity: 1;
}

.home-section-panel {
  margin: 0 12px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}

.home-section-panel[hidden] {
  display: none;
}

/*
 * Inside a panel the hub tiles become compact rows: five 118px tiles are
 * taller than a phone viewport, which defeats keeping home in view.
 */
.home-section-panel .prod-grid {
  grid-template-columns: 1fr;
  gap: 8px;
}

.home-section-panel .prod-card {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 9px 12px;
  border-radius: 14px;
}

.home-section-panel .prod-card::before {
  display: none;
}

.home-section-panel .prod-card-icon {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 10px;
}

.home-section-panel .prod-card-icon .prod-svg {
  width: 17px;
  height: 17px;
}

.home-section-panel .prod-card-label {
  flex: 1;
  min-width: 0;
  flex-direction: row;
  align-items: baseline;
  gap: 6px;
  margin-top: 0;
}

.home-section-panel .prod-card-top {
  font-size: 0.68rem;
}

.home-section-panel .prod-card-bot {
  font-size: 0.95rem;
}

.home-section-panel .prod-card-arrow {
  position: static;
  right: auto;
  bottom: auto;
}

@media (min-width: 520px) {
  .home-quick-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    overflow: visible;
    scroll-snap-type: none;
  }

  .home-quick-action {
    flex: unset;
    width: auto;
    min-height: 78px;
    scroll-snap-align: unset;
  }

  .home-section-panel .prod-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}
